Running Code on the Robot - TAMSFormers5212/TAMSformers-Database GitHub Wiki
Before attempting to deploy anything to the robot or even pushing code to github, it is beneficial to run a build first to check that the code compiles. Though there are still errors that can occur that prevent correct robot function, building is the first step when testing code.
WPILib comes with a couple ways to simulate the robot. The base simulation system can be run in VS Code.
AdvantageScope is a logging software and is now included when installing WPILib (guide). This can be used in conjunction with AdvantageKit to simulate robot code or replay those logs.
- Note: You need to code the simulation first.
During practice outside of competitions, you can connect to the robot's radio through wifi. After turning on the robot, the radio will need time to boot up, and this will finish when the orange LED on the radio turns on. *for the OEMP5 radio used prior to 2025. New Vivid Hosting radio has not been used before.
At competitions, the radio will be reflashed to work with the event's FMS. This means the wifi function will not work, and you will need to connect physically through either ethernet to the radio (or network switch) or USB-B to the roborio.
Deploying Code requires connection to the robot as it first builds the code and then sends it to the robot.
The driverstation can refer to both the NI Driver Station and also the physical driverstation we made. The NI Driver Station application is needed to run the robot both in practice and at competition.
The Driver Station allows you to run the robot in 4 modes. Enabling will allow the robot to move, and disabling prevents the robot from being able to use motors and certain ports. You can use the enable/disable buttons on the driver station. Alternatively, press enter to disable and [+]+\ to enable when practicing and quickly enabling/disabling is nessecary. This is not an option during competition.
Pressing the space bar will e-stop the robot. This stops all functions on the robot and will require a power cycle and closing and reopening driver station to enable again.
This is the human controlled portion of the match, and selecting this option will allow you to control the robot with the usb controllers.
When you enable Auto, it will run the autonomous code immediately. Make sure the space is clear and be ready to disable quickly.
Practice mode is useful if you want to prepare for competition. It goes through each step of a competition match: a pause, an autonomous period, and then teleop. The timings can be changed in the setup tab.
Test mode runs a test code. It has to be coded separately unlike the other modes. You can run a startup or systems check with this mode.