Go to Post Robot shoots forward across field and jams itself into opposing alliance bridge. It was, however, the fastest our robot ever went. - PandaHatMan [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 11-02-2011, 10:13 PM
WillF WillF is offline
Team Captain
FRC #2945 (B.A.N.G (Bolts and Nuts Gang))
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Manitou Springs, CO
Posts: 12
WillF is an unknown quantity at this point
Python Compatibility

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.
__________________
"Light a man a fire and he will be warm for a day. Light a man on fire and he will be warm for the rest of his life..." -Terry Pratchett
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2011, 11:16 PM
Peter Johnson Peter Johnson is offline
With great power comes great I^2*R
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 138
Peter Johnson is a splendid one to beholdPeter Johnson is a splendid one to beholdPeter Johnson is a splendid one to beholdPeter Johnson is a splendid one to beholdPeter Johnson is a splendid one to beholdPeter Johnson is a splendid one to beholdPeter Johnson is a splendid one to beholdPeter Johnson is a splendid one to behold
Re: Python Compatibility

Quote:
Originally Posted by WillF View Post
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?
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.
__________________
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote
  #3   Spotlight this post!  
Unread 11-03-2011, 02:36 PM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 7,711
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Python Compatibility

Quote:
Originally Posted by Peter Johnson View Post
"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.
I've done it with netcat.
Reply With Quote
  #4   Spotlight this post!  
Unread 11-03-2011, 03:49 PM
Sconrad Sconrad is offline
Registered User
AKA: Connor Young
FRC #0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2011
Location: Yorktown
Posts: 40
Sconrad is an unknown quantity at this point
Re: Python Compatibility

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+sta tion) 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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 05:06 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi