Mk3 Swerve Offsets not working round 2

Hi, our team is having trouble with the offset on the Mk3 modules, again…
We decided to try out the new code from Swervedrive specialists and found some success with it, and we really liked the way it was set up, but after spending ages to try and set the offsets we are unable to get numbers that actually work, they are all off by 90ish degrees or reversed or going their own way.

This is the thread we got the code from code

Here is our process

  • Deploy code with offset set to 0
  • Align all modules to point the gear to the left
  • Use a straight piece of wood to make sure they are aligned correctly
  • Read the values (Current angle) from shuffleboard, and add them to the code
  • deploy the code, test and fail

What we’ve tried

  • One user on the original thread suggested changing our encoder settings to have direction as true and the bootup behavior to absolute, our encoders are still using these settings
  • We tried changing each motor’s offset alone by adding 90 or 180 to see if it would align correctly, sometimes nothing would change, sometimes they all would change even though only one module was being changed

Currently, we have all the wheels point about 90 to the left of where they should be and add/sub 90 either results in no change or complete chaos in the direction they are going

Any help on the matter would be greatly appreciated

Check your gyro angle. The default is field centric, so it probably thinks it’s sideways. we had this problem with our NavX, our solution is to manually calibrate it on power cycle. This has to do the magnetometer being funky. Our team is switching to the pigeon 2 as soon as they ship.

1 Like

Yes! It worked. Thank you so much! We got it driving again but our Xbox controller seems to keep losing connection to the robot, driver station still sees and it looks normal there but the inputs freeze for the robot so it’ll keep moving whatever it remember last, no idea if this is another problem entirely or if it has something to do with the swerve still, but thank you once again.

Thank you, will update to this ASAP

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.