Coding the Robot

We’ve been using Visual Studio Code (the preferred IDE used to be Eclipse) and have been diving into Java to try and learn how to automate portions of our robot.

The WPILib API has some methods for using speed controllers (Spark Max motor controllers), but we haven’t yet figured out the appropriate way to turn them a certain number of rotations with our current hardware. A potential method surfaced in the Rev Robotics API with some mentions on how to measure total rotations, but it wasn’t immediately obvious on how to actually set the motor to move only one.


We’ve also looked at moving them a certain distance by setting a maximum duration that they would be powered for. While we’ve attempted this in the past during the autonomous period at the beginning of the game, the biggest problem with this approach is the potential for network packet loss or wattage differences during game play. It doesn’t seem like anything very specific, like picking up a ball, lifting it to a certain height, and placing it in a bucket could be accomplished using this method.

Currently when driving manually we have to be very careful and precise, whereas if the appropriate program is setup, a series of events could be accomplished with the press of a single button. So we are still actively working on learning to code and are experimenting with various approaches.