Deploy Python program to roboRIO
Note
Before deploying the code to your robot, you must start by installing RobotPy on your computer
In particular, it is expected that you have ran robotpy sync
to download all of the roboRIO python dependencies.
py -3 -m robotpy deploy
python3 -m robotpy deploy
python3 -m robotpy deploy
When you execute the robotpy deploy
subcommand, it will do the following:
Run
pytest
tests on your code (will exit if they fail)Install Python on the roboRIO (if not already present)
Install python packages on the roboRIO as specified by your
pyproject.toml
(if not already present)Copy the entire robot project directory to the roboRIO and execute it
Avertissement
Avoid powering off the robot while deploying robot code. Interrupting the deployment process can corrupt the roboRIO filesystem and prevent your code from working until the roboRIO is re-imaged.
When successful, you will see a SUCCESS: Deploy was successful!
message.
You can watch your robot code’s output (and see any problems) with netconsole by using the Driver Station Log Viewer or pynetconsole. You can use netconsole and the normal FRC tools to interact with the running robot code.
Voir aussi
Immediate feedback via Netconsole
When deploying the code to the roboRIO, you can have immediate feedback by adding the option –nc. This will cause the deploy command to show your program’s console output, by launching a netconsole listener.
py -3 -m robotpy deploy --nc
python3 -m robotpy deploy --nc
python3 -m robotpy deploy --nc
Note
Viewing netconsole output requires the driver station software to be connected to your robot
Skipping Tests
In the event that the tests are failing but you want to upload the code anyway, you can skip them by adding the option –skip-tests.
py -3 -m robotpy deploy --skip-tests
python3 -m robotpy deploy --skip-tests
python3 -m robotpy deploy --skip-tests