编译并部署机器人代码

机器人项目必须在编译(构建)和部署之后才能在 roboRIO 上运行。由于代码不是在机器人控制器上编译的,这个过程被称为“交叉编译”。

要编译并部署机器人项目,请执行以下一项操作:

  1. 打开命令面板,然后输入或选择 “Build Robot Code”

  2. 打开 VS Code 窗口右上角椭圆所指示的快捷菜单,然后选择“Build Robot Code”

  3. 右键单击项目层次结构中的 build.gradle 文件,然后选择“Build Robot Code”

../../../_images/building-code-options.png

Deploy robot code by selecting “Deploy Robot Code” from any of the three locations from the previous instructions. That will build (if necessary) and deploy the robot program to the roboRIO.

警告

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.

If successful, we will see a “Build Successful” message (1) and the RioLog will open with the console output from the robot program as it runs (2).

../../../_images/build-successful.png