Getting started with Commands in Python

I have been scouring the web (including most all the links from this forum) for a sample of using wpilib Commands with RobotPy and have been unsuccessful. There are a number of tutorials on Commands out there if you are using C++ or Java but we (team 4561) are using Python and RobotPy.

Does anyone have a good example to share?

Or, is this even possible? The list of available classes for RobotPy here ( does not list Command, Subsystem, Scheduler and related classes. But, I get the feeling that list is a bit dated.

Steve Wasleski
Mentor - Team 4561

Hey Steve,

I believe all of the commands stuff has been wrapped in Python. However, I’m not aware of anyone who is actually using it. Using it should be pretty straightforward – the object names and function names are the same as the C++ library that it wraps. I think Peter had added some useful things for the Preferences class, but I don’t know much about that.

Unfortunately, the robot simulator / wpilib in pyfrc does not currently support commands.

We are also struggling with command code. I’ll speak with my programmers tonight and see if we can generate a concise, reproducible error.

Waz, feel free to message me or robobenklein on this if you want to take it offline.

Hey Tim,

This thread was from 2014, so the information is out of date.

The command stuff is 100% python this year, and should work without too many problems. I’ve gotten the pacgoat/GearsBot examples working in the 3D simulator. Unfortunately, nobody has stepped up to port the unit tests from java to python, so it’s possible (probable) that there are bugs in the implementation.