Subir programa de Python a la roboRIO

Nota

Antes de subir el código a su robot, usted debe empezar instalando RobotPy en su computadora

En particular, es esperado que usted haya corrido robotpy sync para descargar todas las dependencias de python roboRIO

py -3 -m robotpy deploy
python3 -m robotpy deploy
python3 -m robotpy deploy

Cuando usted ejecute el subcomando robotpy deploy, este hará lo siguiente

  • 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

Advertencia

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.

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

Nota

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