Skip to content

Angular Offsets (Setup)

2018macbookair edited this page Jun 6, 2024 · 2 revisions

Alright, if you're here, I'm assuming you need to set your angular offsets for the modules! If you don't, unwanted behaviours, such as spinning in circles, not driving straight, and gear/module wear are not only common, but also practically inevitable. This is a fairly short process, but it is also semi-hard, and requires at least two people.

  1. You need to deploy the robot code, and have smartdashboard pulled up. On smartdashboard there should be four numbers, that are labeled: FrontLeftModuleOffset, BackLeftModuleOffset, FrontRightModuleOffset and BackRightModuleOffset. One person will need to use the left joystick (translation) or the equivalent in your code to move each module in the position individually. The position that the modules need to be moved into is as follows: Rotated to straight, and spinning in the forwards direction of your robot. Once the module (let's just say the frontLeft module for the sake of an example) is spinning forwards and facing straight forwards, the second person needs to record the absolute encoder value from smartdashboard, I generally record it to three decimal points. You then need to enter these values into lines 67-70 of your constants file, in the corresponding module places. IT IS EXTREMELY IMPORTANT THAT THE DRIVER HOLDS THE WHEELS AS STRAIGHT AS POSSIBLE DURING THIS TIME, AS THIS DECIDES HOW STRAIGHT THE ROBOT MOVES

  2. The second option is to simply go into the REV Hardware Client, make sure the robot is disabled, and twist the wheels into the forward position. On the RHC, set the angular offsets so that the wheels are at zero when facing directly forward.

Clone this wiki locally