|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
RobotPy 2012.1
I've released the first release of RobotPy for the 2012 season: 2012.1
Download from http://firstforge.wpi.edu/sf/go/proj...robotpy.2012_1 Major changes from 2011.3 release:
Release notes:
GitHub (for those interested in the details): http://github.com/robotpy/robotpy Last edited by Peter Johnson : 09-01-2012 at 01:19. Reason: Mention 4-slot cRIO support. |
|
#2
|
|||
|
|||
|
Re: RobotPy 2012.1
Looks quite awesome.. I would consider python as my primary language... but given the fact that the teams is not gonna be too happy with me if i use not officially supported software.. I probably won't use after the competition is over...
Hopefully FIRST could adopt this as well! |
|
#3
|
|||
|
|||
|
Re: RobotPy 2012.1
How are you deciding what to wrap and what to reimplement?
|
|
#4
|
|||
|
|||
|
Re: RobotPy 2012.1
Basically I decided to wrap the low level "core" classes, and reimplement the higher level frameworks (NetworkTables, SmartDashboard, Commands). My main reasoning was that the higher level frameworks would feel much more Pythonic (e.g. natural to use) if duck typing could be used for the various interfaces (e.g. SmartDashboardData, NetworkTableChangeListener) rather than forcing people to derive from multiple base classes and remember to call all of the base class __init__ methods (required when you have a wrappered class or bad things can happen). Also, when the user code fails, error messages tend to be a lot better for native than for wrappered classes.
Something like PIDController is on the line; currently it's wrapped C++ but I'm definitely leaning towards making it native Python in the future. I perhaps could have saved myself some work by wrapping a modified NetworkTables rather than reimplementing the whole thing, but I'm pretty pleased with the end result. Line counts of the reimplementations (SLOC): NetworkTables.py: 1201 Preferences.py: 384 SmartDashboard.py: 355 Commands.py: 884 Buttons.py: 116 |
|
#5
|
|||
|
|||
|
Re: RobotPy 2012.1
If you implemented the Network Tables completely in Python, does that mean that it is a portable implementation that runs on a PC also?
Did you model your ports on the C++ implementations or the Java implementations or both? There have been several bug fixes between the last beta release and the kick-off release in the command stuff. Are you tracking bug fixes in your python implementations? |
|
#6
|
|||
|
|||
|
Re: RobotPy 2012.1
Quote:
C++ implementations (basically I copied and pasted the C++ code and did line-for-line translation). Considering I reported most/all of those bugs (discovered while reimplementing), I believe so. I do check for deltas in the C++ source between each WPILib revision as I often need to update my wrappers. |
|
#7
|
|||
|
|||
|
Re: RobotPy 2012.1
About the vision stuff: I am not quite understanding how to use it.
Last year, this worked: Code:
import wpilib import vision import nivision self.axisCamera = vision.AxisCamera.GetInstance() ... But the problem I have is on the "import vision", where I get a bunch of undefined reference messages: Quote:
|
|
#8
|
|||
|
|||
|
Re: RobotPy 2012.1
Oh, hah! The one piece of information I left out, that this is on an 8-slot cRIO, turns out to be the key. And this issue turns out to be caused not at all by RobotPy, but by the cRIO image v43, for cRIOFRC (the 8-slot version).
There are two versions of nivision.out delivered as part the v43 cRIO image, one for the 4-slot and another for the 8-slot cRIO. It turns out that they do not both have the same symbol table. All of the "undefined" symbols I quoted in the prior message are defined in the cRIOFRC2 (4-slot) version of nivision.out, but *not* in the cRIOFRC (8-slot) version. So I worked around this by commenting out these symbols from the Packages/nivision/sip/nivisionmod.sip file and rebuilding RobotPy. And so the code fragment I showed before now works fine. |
|
#9
|
||||
|
||||
|
Re: RobotPy 2012.1
RobotPy 2012.2 is out, has the latest changes to WPILib and fixes the undefined references problem with the vision packages.
http://www.chiefdelphi.com/forums/sh...d.php?t=102361 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|