PDA

View Full Version : RobotPy 2011.2


Peter Johnson
01-15-2011, 03:49 AM
I've released RobotPy (Python for FRC) 2011.2.

http://firstforge.wpi.edu/sf/projects/robotpy

Major changes from 2011.1 release:

Victor class is now available in wpilib.
PCVideoServer class is available via "import vision". The other vision classes are not yet available.


Sorry for not getting the vision classes done for this release, but I felt the lack of the Victor class demanded a quick release. I'm actively working on them (holy cow is nivision huge!) but it'll take a few more days to complete.

Robototes2412
01-17-2011, 03:36 PM
Sample code to activate camera

import vision
test_cam = vision.PCVideoServer()

Keep in mind that this only has the camera stream data to the dashboard at 320X240, that cannot be changed until nivision and all that other funky stuff is bound.

It is significantly laggy over wireless, but that is how it is for everyone.

BotnEyedJoe
01-21-2011, 09:57 AM
Thanks for this, Peter. It has been an awesome addition to the FRC world, and we have been using it intensely since its release.

Speaking only for ourselves regarding this: The vision lib would certainly be at the top of our 'love to have that' list (and you've mentioned that it is coming). The SmartDashboard looks interesting also - we did not find support for it in 11.2 - hope that's easy to add.

On a related note, perhaps you have time to share your viewpoint on where would someone interested in helping this effort begin (say, if they had some learning curve to overcome re: SIP and wrapping a new library)?

byteit101
01-21-2011, 01:25 PM
The SmartDashboard looks interesting also - we did not find support for it in 11.2 - hope that's easy to add.

I'm working on getting ZomB to work with python, If you want to help me get it going, feel free to PM me.

pmalmsten
01-21-2011, 05:29 PM
The SmartDashboard looks interesting also - we did not find support for it in 11.2 - hope that's easy to add.

Hi guys,

I'm the lead developer of the Smart Dashboard project. I haven't looked at any
of the Python code yet, but I would be happy to help port the robot side code. I'll take a look at that sometime in the next week or so.

That's pretty cool to have Python working on robots; thanks for your hard work Peter.

~Paul Malmsten

Peter Johnson
01-22-2011, 12:14 AM
Speaking only for ourselves regarding this: The vision lib would certainly be at the top of our 'love to have that' list (and you've mentioned that it is coming). The SmartDashboard looks interesting also - we did not find support for it in 11.2 - hope that's easy to add.

On a related note, perhaps you have time to share your viewpoint on where would someone interested in helping this effort begin (say, if they had some learning curve to overcome re: SIP and wrapping a new library)?

SmartDashboard should be in 11.2... at least I'm generating wrapper code for it. I've not tested it yet, but it should work, something like:

ds = wpilib.DriverStation.GetInstance()
dash = wpilib.SmartDashboard(ds.GetUserStatusDataSem())
ds.SetHighPriorityDashboardPackerToUse(dash)


I'm definitely working hard on the image processing stuff. Is it just the vision/vision2009 libraries that are useful, or do people really use a lot of stuff in nivision directly as well? Nivision is very large and raw C (rather than C++) so it's taking a lot of time to wrap it.

SIP is a good place to start, although SWIG can be used as well (although if your classes extend WPILib classes you'll need to use SIP). The next step is to check out the codebase (from git) and look at how the various packages are wrapped (WPILib namely).

BotnEyedJoe
01-23-2011, 06:29 PM
SmartDashboard should be in 11.2... at least I'm generating wrapper code for it. I've not tested it yet, but it should work, something like:

ds = wpilib.DriverStation.GetInstance()
dash = wpilib.SmartDashboard(ds.GetUserStatusDataSem())
ds.SetHighPriorityDashboardPackerToUse(dash)
I'm definitely working hard on the image processing stuff. Is it just the vision/vision2009 libraries that are useful, or do people really use a lot of stuff in nivision directly as well? Nivision is very large and raw C (rather than C++) so it's taking a lot of time to wrap it.

SIP is a good place to start, although SWIG can be used as well (although if your classes extend WPILib classes you'll need to use SIP). The next step is to check out the codebase (from git) and look at how the various packages are wrapped (WPILib namely).

OK, got the SmartDashboard working on the robot side with your example code - thanks! Something funky happening on the SmartDashboard client side though: each Log() call seems to create a new widget; I'll have to investigate this further.

I think the vision/vision2009 interfaces have been the most useful to us up 'til now; we have not yet had to delve into the IMAQ functions. Looking for functionality akin to the 2010ImageDemo, essentially.

Cloned the git repository; learning SIP is next on our list. Having it in the toolbox also might provide an escape valve for situations where wrapping an entire C++ lib might be too much work, in which case we could just wrap customized code that implements only the functionality necessary.

lemiant
05-25-2011, 09:10 PM
How do you debug with RobotPy?