View Single Post
  #54   Spotlight this post!  
Unread 29-09-2007, 19:48
psquared89's Avatar
psquared89 psquared89 is offline
Registered User
AKA: Pat Pannuto
FRC #0245 (Adambots)
Team Role: Driver
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Rochester Hills, MI
Posts: 73
psquared89 is a jewel in the roughpsquared89 is a jewel in the roughpsquared89 is a jewel in the roughpsquared89 is a jewel in the rough
Re: How important is Linux?

I feel like I can (hopefully) provide a lot of insight into this debate as our team presently uses Linux to run our robot. The IFI chip is just an I/O slave between the radio, PWMs, Victors, etc, and our co-processor - which is running Linux. The coprocessor is a 400 mHz GUMSTIX embedded processor, and I think it's a fair equivalent to what could possibly be used on robots in the future. (Teams interested in reading more about this, feel free to visit our site - but be warned, in changing over to mediawiki we lost some stuff, so a lot of the information is outdated (ignore all things "modules"))

Anyway, here's some of the things that we noticed, day-to-day, that are very nice:
* Easy access to a hardware timer. Seriously, how many threads are there about the sketchy interrupt timer and all of that, whatever happens, the new chip MUST have a clock.
* No interrupt worries. It's really nice to have an 'unlimited' number of interrupts available and not have to worry about bogging down processing capabilities. In that same vein...
* Far fewer efficiency concerns. This one's a double-edged sword; at one point last year our robot had 4 PID and 4 PI loops running simultaneously without any slowdown. Point being that you forget about programming efficiently, which is a useful skill IMO that's easy to let go of when presented with greater resources. Even as computers get stronger, everyone knows they do get bogged down from time-to-time, but efficiency is continually becoming less of an issue to all programmers - a dangerous trend IMO, but I digress
* No flashing. This one's really nice, particularly for anyone who's had to tweak PID constants before. Even if the new controller had the most lightweight OS in the world just enough for a basic file system that would allow quick 'saves' and then a 'restart', the sometimes 2 minute flash process is unacceptable.
* Floats. I know there are bit-shifting workarounds for the sometimes sketchy floating-point performance found in all things IFI they just become one less thing to think about and one less thing that could go wrong.

The bigger things, that maybe not everyone will care about:
* Language flexibility. Our code is written in Python. Even if interpreted languages are a little slower in run-time, I prefer it to compiling. Error handling and such are much more flexible too.
* Threading. Sure, they aren't necessary, but they're nice. For instance, we ran each PID loop as its own thread and polled its state whenever we updated PWM values - why should the main program wait for this? This allows the very well optimized kernel to schedule work, not the inexperienced programmer.
* Non-volatile run-time memory. A file system allows you to run simplistic programs whose only requirement allows you to save data between runs. The simplest being one that simply polls all pertinent variables, records time and state for each. Then parses the file into variable values with delta t's and can playback and pre-recorded run. It's still dead reckoning, and wouldn't have worked for the last few year's autons, but it's nice nonetheless.

Random Cool Things That Also Become Possibilities:

* Wireless Programming. This was really convenient for tweaking drive wheel PID constants. We replaced the GUMSTIX with a laptop running the same set of code (it's python, it'll go anywhere -- flexibility) and a wireless card. This allowed us to update PID constants on the fly over an ad-hoc nework with ssh from another laptop while the robot ran by radio on our practice field. It's as close to tweaking under real time situations as possible.



If anyone has questions about our experiences, please feel free to PM me. Mostly, however, I encourage you to TRY IT. If you have a laptop with a serial port and python, you're good to go. I'll make an effort to update our site soon to make testing easier, but everything you need is there. You don't need to wonder about the future, try running your robot with Linux right now - adambots.com

Pat
__________________
At the end of the game, the King and the Pawn both go back into the same box.
~ Italian Proverb
---------------------------------
adambots.com

Last edited by psquared89 : 29-09-2007 at 19:58.