TODO:
- Log loop time of subsystems
- Use pose3d from photon where applicable
- Make sure all motors have valid CTRE pro license and are visible in phoenix tool
- Update all motor controllers to latest PRO version
- Make sure all motors have correct can id according to code (change the canid on the controller, dont change the code)
- Make sure the wheelbase width and length, motor choice, as well as gearing are set correctly in swerveconstants.h
- The robot should be on blocks so it can't drive on the ground!!!
- Using pheonix tuner, drive the azimuth motor "forward" (blinking green), the module azimuth should rotate counter-clockwise when viewed from the top
- Manually move the azimuth of the module to 0 degrees (0 being where the drive wheel will drive forward with the bevel gear facing the center of the robot) and drive the drive motor "forward" (blinking green). The module wheel should be spinning so that the robot would move forward if on the ground.
- Do this for all 4 modules and record them. Change the code to fix this if any of them are wrong.
- While the robot is still on blocks, shove a straight metal bar on the left side of the wheel forks so they are parallel to eachother. MAKE SURE THE BEVEL GEAR OF THE MODULE IS FACING TOWARDS THE CENTER OF THE ROBOT
- In phoenix tuner, record the RAW encoder value (without offset) for both the front and back left encoders. Have someone hold the bar in place without moving.
- Repeat for the right side
- Change the encoder offsets in the code to match.
- Make sure the pigeon 2 imu is securely mounted on the robot
- Follow the direction from CTRE to calibrate the IMU.
- Record the offset values and change the code to match
- Put the robot on the ground and manually move the azimuth motor to its 0 position
- Run the sysid steer torque commands using a controller. Make sure to run all 4 tests (quasistatic and dynamic forward and backwards)
- Using tuner, generate a log file getting the motor position, motor velocity, and motor torquecurrent and sysid state.
- Open sysid and find gains (use sysid guide for this)
- If you are using mk4n's in the back, repeat for back module using a different sysid command
- Record the ff and PID constants and update the code to match
- Set the robot on the ground
- Point the front of the robot away from you and make sure the driverstation is behind the robot.
- Open advantage scope. All of the swerve movement should match what you see in the "Swerve" Tab in advantage scope.
- Change the driverstation alliance to blue
- Verify the robot moves with the joystick in the correct way. Push the left stick forward slowly. the robot should move forward. Push the left stick back and the robot should move backwards.
- Push the left stick to the right. The robot should move right. Push the left stick to the left. The robot should move left.
- Push the right stick to the right. The robot should rotate clockwise looking at it from the top. Push the right stick left. The robot should rotate counter clockwise
- Rotate the robot with the stick to 90 degrees and make it go forward. The robot should move away from you. (not to the right)
- In the advantage scope odometry tab, the robot should be in the correct spot on the field as if the robot was started at 0,0 (the right side wall of the blue alliance corner.)
- Put the robot against a wall with frc carpet on the floor.
- Open tuner and graph the torquecurrent and velocity of one of the drive wheels
- Slowly drive the robot into the wall while slowly increasing the speed using the joystick until the velocity of the wheel is not zero
- Record the torque current of the wheel at the point where the velocity isnt zero
- Update the slip current value in the code to match
- Put the robot on the ground and manually move the all of the azimuth motors to their 0 positions
- Run the sysid drive torque commands using a controller. Make sure to run all 4 tests (quasistatic and dynamic forward and backwards)
- Using tuner, generate a log file getting the motor position, motor velocity, and motor torquecurrent and sysid state.
- Open sysid and find gains (use sysid guide for this)
- Record the ff and PID constants and update the code to match
- Put the robot on the ground facing forward and turn it on
- Run the wheel radius command from a controller and make sure it rotates fully around 2 times. Do the same in reverse mode
- The wheel radius will be printed in the console connected to the DS. Record this and change the code to match
- Put a tape measure on the ground and drive the robot forward 3 feet. Make sure your odometry measured distance matches
- Change the drive command to use closed loop driving instead of open loop
- Move the robot around in teleop to make sure it responds the same as open loop driving
- Create a path in choreo that starts at 0,0 and moves forward 3 ft give it a slow max velocity
- Run the path and see if it completes the path within tolerance
- Adjust path pid tuning to make it follow correctly.
- Try driving a path where you drive in a square
- Try a path where you drive straight and rotate
- Try a more complicated path
- Up the choreo max torque until you can't track accuratley.
- Add vision (EZ)
- Keep upping max torque until you cant even track with vision