Log in

View Full Version : Initial release of RobotPy for 2015


virtuald
03-01-2015, 12:48
Now that kickoff is over and the game has been released, we're happy to announce the initial release of RobotPy for 2015. There's a lot of moving pieces in various stages of completion, but here's where we are now:

* WPILib (https://github.com/robotpy/robotpy-wpilib) is available and should be fully functional. Check out our getting started guide (http://robotpy.readthedocs.org/en/latest/getting_started.html) to install WPILib and the Python interpreter on your robot.
* pynetworktables (https://github.com/robotpy/pynetworktables) is available for robots and clients to connect to the SmartDashboard or from coprocessors, and should be fully functional.
* pyfrc (https://github.com/robotpy/pyfrc) is mostly there, with the simulator working and some of the unit test functionality working. I'm hoping to finish this up by the end of the weekend.
* We have initial support for the FRCSim Simulator (https://github.com/robotpy/robotpy-frcsim.git), but the documentation is light and not all devices have been implemented yet. The python version of the GearsBot example (https://github.com/robotpy/robotpy-wpilib/tree/master/examples/examples/GearsBot) mostly works though. :)
* The Eclipse plugins aren't anywhere near functional yet (sorry!). Hopefully by next week.
* We've got numpy built for the RoboRIO, and it's easily installable via opkg. Check out https://github.com/robotpy/roborio-packages for more information.

Our initial RobotPy release for 2015 is now available for download on our release page (https://github.com/robotpy/robotpy-wpilib/releases).

The team has put months of effort into this release, and we're really excited about 2015! Special thanks to Christian Balcom (@computer-whisperer, FRC Team 4819), who has done a significant amount of work on the pure python port of WPILib, and various useful tooling.

Go ahead and start using what we have, and report bugs as you find them! We expect that there will be a lot of bugfixes over the next few weeks, but that will probably be true for the other languages too. Please report any problems on our issue tracker (https://github.com/robotpy/robotpy-wpilib/issues) as you find them!

SamCyanide
03-01-2015, 19:45
Sweet! Python forever, dude. I believe I'll be getting to using one of our boards for python soon.

Thanks for continuing support and here's to a year of FRC python innovation!

Aero
05-01-2015, 18:58
This is amazing! In the three days I've had to play with this, I've gotten automatic uploading from my IDE working, along with on-the-fly code reloading. Upload times on the cRIO were around a minute and a half with reboot included, now I can get new code running in less than 7 seconds.

My favorite part is real debugging on the RoboRio :D

virtuald
05-01-2015, 19:15
This is amazing! In the three days I've had to play with this, I've gotten automatic uploading from my IDE working, along with on-the-fly code reloading. Upload times on the cRIO were around a minute and a half with reboot included, now I can get new code running in less than 7 seconds.

My favorite part is real debugging on the RoboRio :D

Great to hear! Perhaps you'd be interested in posting some docs for others to use? :)

How are you debugging? Via pdb, or remotely (we have an open bug (https://github.com/robotpy/robotpy-wpilib/issues/99) for setting up remote debugging).

Aero
06-01-2015, 14:21
Great to hear! Perhaps you'd be interested in posting some docs for others to use? :)

Of course! I haven't managed to reload code while the robot is enabled (that's pretty dangerous anyways), but I have automatic reloading for your source files post-upload.
I'm using my IDE (IntellJ IDEA)'s deployment function to upload the files over SCP on save.

Here's the script! It's pretty well-commented, so anyone should be able to figure it out & adapt it to their setup pretty quickly.

https://gist.github.com/aerobit/05c3bc5c71f60d52736e


How are you debugging? Via pdb, or remotely

I'm just using my IDE's remote debugger (again, PyCharm/IntelliJ IDEA).
Works perfectly!


One question; I'm trying to get the Encoder class working, but no matter if I pass it two DigitalChannels or two ints representing the channels, the constructor fails with a "TypeError: 'int' object is not iterable".
Here's the full error log.
https://gist.github.com/aerobit/37ad61b750b8e11b555e

virtuald
06-01-2015, 14:38
I'm using my IDE (IntellJ IDEA)'s deployment function to upload the files over SCP on save.

Here's the script! It's pretty well-commented, so anyone should be able to figure it out & adapt it to their setup pretty quickly.


Ah, that kind of auto-reload. You'll probably want to adapt your locations/etc to work with what pyfrc does, or use pyfrc to do the upload for you (just released today). It installs stuff in such a way that the FIRST/NI stuff will autostart it on bootup, and can be controlled by the standard FIRST tools.


I'm just using my IDE's remote debugger (again, PyCharm/IntelliJ IDEA).
Works perfectly!


Cool.


One question; I'm trying to get the Encoder class working, but no matter if I pass it two DigitalChannels or two ints representing the channels, the constructor fails with a "TypeError: 'int' object is not iterable".
Here's the full error log.
https://gist.github.com/aerobit/37ad61b750b8e11b555e

That should work. There are unit tests for it even. File a bug on github.

NotInControl
12-01-2015, 14:46
I had a question on the pynetworktables port. Does it implement the "tables" package of WPILib, in particular I am looking for the IRemoteConnectionListener class and ITableListener class.

I didn't see them when browsing the github repo, maybe I overlooked it.

Thanks for putting this together. Def a useful resource.

virtuald
12-01-2015, 14:53
I had a question on the pynetworktables port. Does it implement the "tables" package of WPILib, in particular I am looking for the IRemoteConnectionListener class and ITableListener class.

I didn't see them when browsing the github repo, maybe I overlooked it.

Thanks for putting this together. Def a useful resource.

It is a full implementation of NetworkTables, and it does implement that functionality, though some of it has been converted to use callbacks instead of needing to implement the class. Check out NetworkTable.addConnectionListener (http://pynetworktables.readthedocs.org/en/latest/networktables.html#networktables.NetworkTable.addC onnectionListener) and NetworkTable.addTableListener (http://pynetworktables.readthedocs.org/en/latest/networktables.html#networktables.NetworkTable.addT ableListener)

Also, there is a sample available that shows the use of the table listener (https://github.com/robotpy/pynetworktables/blob/master/samples/listener.py).