![]() |
RobotPy: Python for FRC
After being inspired by Ross Light and Team 973's success in porting Lua to the cRIO (see the "Announcing FIRSTLua" thread), I have completed a port of Python to the cRIO, called RobotPy.
RobotPy is a fully functioning port of Python 3.1.2 that can be used for programming your FRC robot. The full set of WPILib functions, including CANJaguar, is available in Python via "import wpilib". As with the Lua port,
I've performed some initial testing on Team 294's 2010 robot, including running CAN bus Jaguars and compressors and pneumatics. Examples and installation documentation are available on the website and are also included in the download. Also, the download .zip file includes a prebuilt FRC_UserProgram.out, so you don't need to have any programming software installed to get up and running (just FTP a bunch of files to your robot)! Please report any bugs you find via the RobotPy website's ticket system (note: registration is required). RobotPy website: http://www.tortall.net/projects/robotpy/ While the download .zip doesn't include the source code, it is available via a git repository. See the Download page on the website for details. With the exception of modules with large dependencies (e.g. databases), almost all of the Python standard library is included. So yes, you can parse XML files with expat on the robot if you so choose :). Much of this is untested however (I have not tried to run the Python test suite on the robot). Major thanks go to Ross Light and Team 973; this project would not have happened without them creating FIRSTLua first to inspire me to port Python. RobotPy uses the WPILib SWIG wrapper created by Ross, with the addition of CANJaguar. The idea of using a boot script to auto-reload the user code is also taken from FIRSTLua. |
Re: RobotPy: Python for FRC
thank you so much :)
I'm already porting my team's high level motor grouper and pneumatics classes, I'm hoping these can be included with your permission, of course |
Re: RobotPy: Python for FRC
Quote:
|
Re: RobotPy: Python for FRC
I have most of the common inputs that my team used coded in python for prototyping, so I will be done with the whole thing by tomorrow
|
Re: RobotPy: Python for FRC
Quote:
Do sockets work? That would make it easy to add a telnet server to the robot, and allow remote execution of code to aid testing. Also, does print work correctly? Thanks again for doing this! I'm really excited. |
Re: RobotPy: Python for FRC
Quote:
Yes, print works correctly. Feel free to tackle NumPy and SciPy. FYI, to date, I've been integrating C/C++ modules directly into Python/Lib and Python/Modules/ (and updating Modules/config.c to add them to _PyImport_Inittab), because it's all a static executable anyway. |
Re: RobotPy: Python for FRC
Quote:
|
Re: RobotPy: Python for FRC
where does print go?
|
Re: RobotPy: Python for FRC
Quote:
|
Re: RobotPy: Python for FRC
I have basic driving functions and inputs programmed:
output.py Code:
#Made by Sam Dodrill for Team 2412, WTFPLCode:
#made by Sam Dodrill for team 2412, but you can use it too |
Re: RobotPy: Python for FRC
1 Attachment(s)
Code Zipped up and is attatched.
First Release, nothing fancy |
Re: RobotPy: Python for FRC
Quote:
|
Re: RobotPy: Python for FRC
Quote:
|
Re: RobotPy: Python for FRC
This is totally awesome. When I saw the Lua thing, I was thinking the same thing, so I'm glad someone took the time to do it. I'll have to try it on the bot later.
|
Re: RobotPy: Python for FRC
I'm super excited to see this! I love Python as a langue, and I can't wait to maybe load this on a practice robot.
|
| All times are GMT -5. The time now is 19:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi