So I’m looking at using Python in my team this next season and I have a couple of questions for those of you that used it (with success or failure). I am planning on using Ubuntu 11.04 as my development machine first off. Will this work? How does file transference work? Is it a good idea to write Python and C++ side by side? Any other help for a relatively new member would be nice too.
Yes, it will work. FTP is used to copy files to the robot, which of course is available on Unix (you can also use the provided upload script – written in Python – to do it for you). You’ll need an equivalent to NetConsole for debugging purposes–“nc” (aka netcat) should work for this, but if not, it should be pretty easy to implement an equivalent in Python. Basically it’s just sending/receiving UDP packets of text to port 6666.
Note the Python version installed on the robot is Python 3; while not strictly required, you may find it useful to have Python 3 installed on Ubuntu as well.
There’s no equivalent to the driver station available for Unix yet. The protocol’s been pretty completely reverse engineered–there’s even a basic start to a driver station in the RobotPy repository (https://github.com/robotpy/robotpy/tree/2011/sim/dspy) but it just does basic enable/disable, no joystick support or the like. It should be a straightforward project to enhance this with something like pygame to add the necessary joystick support.
It’s rather difficult to develop C++ robot code on Unix. I’ve heard it’s possible but never done it myself–Wind River Workbench isn’t available, and you’ll need your own GCC cross-compiler hosted on Unix.
I’ve done it with netcat.
I could be wrong, but aren’t custom driver stations not allowed according to the current rules? As far as I know, I am pretty sure this has to do with field management. (See http://www.chiefdelphi.com/forums/showthread.php?t=87795&highlight=iphone+driver+station) Using Ubuntu for development should be fine though. I suppose you could use the custom driver station for debugging and practice, but I would suggest using the official driver station (better to become familiar with something your going to be using in competition than have to adapt to that on the fly). Don’t get me wrong, I’d love to see more FIRST integration with Linux or Mac, but for now, I think we are constrained to using Microsoft products, at least officially.