While programming for teleOp, our primary goal is to make it so that anyone can pick up a controller and control the robot. The code constantly changes with drivers’ input and any complications that could occur with controlling it. The main thing that needs to be fine-tuned is the arm positions; if they are off, it can't score, and it could even break the robot if it's too far off.
The arms and claw use preset positions for the board's top, middle, and bottom areas, as well as putting it in its set position for moving around the field. This allows the drivers to 1. not break the robot and 2. be quick and efficient at scoring. There are also buttons for more minor adjustments when needed. Sometimes, when the arm goes up or down, there is a slight jitter, or the robot almost falls over from the weight of the arm moving. To fix this issue, with the help of one of our mentor’s pseudocode, we developed a power ramp function that slowly accelerates from one speed to a new speed. This increases the time it takes to reach the desired position, meaning less momentum.
Using two claws, we wanted to be able to control them both separately instead of with one button, so using left or right triggers, respectively, opens or closes the left or right claw. It uses timers to distinguish between button presses, so it's not trying to open and close simultaneously.
Using mecanum wheels allows for quicker and more versatile movement; sometimes, the regular speed is either too fast or too slow, depending on the situation. This is why we use a speed variable that can adjust the speed; it is connected to the bumpers to either set the motors to run at full speed or at a slower speed.