Auton using a nav-X and Talon's

Out of curiosity…

Our team has been switching over from Sparks to Talons/Victors for our drivetrain. While we made the switch last year, with last year not requiring a lot of Auton, there wasn’t a need for too many PID loops when navigating in Auton.

This year, we’d like to leverage the full feedback and PID capabilities of the Talons for keeping our DriveStraight commands on target, while still using our nav-X gyro to execute a DriveTurnToAngle command when necessary.

Does anyone have any suggestions for a team looking at making the transition. Any tips or tricks we should consider as we work on the Java code? (We are using the latest WPI libraries.)

Thanks in advance!

1 Like

We use our navx for drive straight, although our current implementation is a bit jankey. It uses an xbox controller and will go straight while the x button is held by setting the current angle reading to the target and using a p loop to keep it at that angle. It works pretty well, totally fixing the natural drift of the drivetrain, but is a bit clunky to interact with, so we are coming up with a bigger brain method on the notButtonMode branch. Either way, the repo is here (https://github.com/AlphaKnights/2020_DriveStraightGyro), so take a look.

It doesn’t work with turning unfortunately, because haven’t figured out how to calc the angle that a tankdrive robot is going at based on controller input. Once we get that working, it’ll be even better.

Thanks!! :slight_smile: We will take a look at your repo.

At this time, we do use an xbox controller (arcade drive) with differential drive.

The biggest tip I can give you is just follow through with MotionMagic. Once you do the initial calculations (by following their documentation), it was dead simple to drive straight for a distance and also turn to given angles using MotionMagic trapezoidal motion profiles.

Edit to add:
Here’s a link to our github from last year that implemented all of this in the command based framework.

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