![]() |
Driving Straight
Hey, so as we get close to the season, there's one thing we wanna understand how to do. We wanna understand how to drive straight using autonomous period. Using a PIDController for distance will not work since the two sides of the chassis may drive in a different speed. Using a PIDController for speed might work a little better though it will be hard to land in the distance we tried to go to. So how do we go into doing something like that?
Good luck in the season everybody! |
Re: Driving Straight
Quote:
|
Re: Driving Straight
When WPILib 2017 is released, take a look at the gyro example. It is a sample program to demonstrate how to use a gyro sensor to make a robot drive straight. The program uses a joystick to drive forwards and backwards while the gyro is used for direction keeping. You can replace the joystick in the example with the output from a PIDController to drive straight for a certain distance.
You can get to the Gyro example by: File -> New -> Other -> WPILib Robot Java Development -> Example Robot Java Project -> Gyro |
Re: Driving Straight
If you simply can't wait that long, feel free to look at our AutoDrive command, which locks onto the current heading (yaw) from our navX when it starts and uses PID to maintain that heading as it drives. The same approach could be used for any gyro.
|
Re: Driving Straight
Quote:
https://github.com/trc492/FtcSamples...cPidDrive.java |
| All times are GMT -5. The time now is 15:38. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi