View Single Post
  #3   Spotlight this post!  
Unread Today, 02:06
soundfx's Avatar
soundfx soundfx is offline
Registered User
AKA: Aaron J
FRC #3238 (Cyborg Ferrets)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Anacortes, WA
Posts: 24
soundfx is an unknown quantity at this point
Re: Can I use gyro to drive straight in teleop period?

Quote:
Originally Posted by versole View Post
I wanted to know if you can drive straight using the gyro sensor because we don't have encoder to correct the speed of each motor. We're using tankdrive and right now the problem we're facing is that it's not going in the direction we wanted. For instance, if we move left and right stick to up direction the robot doesn't go straight, and for some reason, I think the speed of left side of the robot is going faster then the right side.

Also, I wanted to know if we can use it in autonomous mode. Like I need help with turning the robot with gyro (corresponding the wheel with the gyro angle.)

This is our first year so we're rookie, and their no programming mentor to mentor us.
Our team reuses this class as a basic implementation of a pi controller attempting to keep rotation to a minimum. We only usually only use it for holonomic drive trains, but it could easily be used for a tank drive. We only use a pi controller here, but you could easily modify this for a more accurate pid controller, or use the wpilib class.

EDIT:
I didn't internalize that you were using tank drive. You could still try to use this, but it might be a little harder to adapt. I suppose if you run this method only when both joystick values are within some value of each other, it might work.
__________________


"I got 99 problems but 0.999 ain't 1."
~Orteil

Last edited by soundfx : Today at 02:09. Reason: Didn't internalize whole post, needed to update.
Reply With Quote