Aoutonomous with Navx

Hello.
I’m 7748 Techtolia mentor. We want to write the 2nd year of our team and the autonom return code with navx. We have a 4-motor drivetrain , we use our motor drives Victorspx and PWM.
We want to take a turn in the autonomous period by taking the angle value from navx mxp.
Urgent help please, as we have 1 day left for our region.

We also want to rotate with the key.

There’s a number of great examples for this, including NavX’s own docs.

For a very simplified bot and example, you can find an old one (for generic gyros) here: https://wpilib.screenstepslive.com/s/3120/m/7912/l/85772-gyros-to-control-robot-driving-direction

The general principal is simply this:

  • Figure out what angle you want to go to
  • Figure out what angle you’re at
  • Use that difference to generate an Error term, either manually (with a gain multiplier to create a simple P controller) or with a full PID controller.
  • That generates your Turn output, which can be fed into drivetrain.arcadeDrive(0,turnOutput)
  • To drive along that direction, you do the same thing with a non-zero forward value. (just make sure you’re facing the intended direction before you start driving)

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