|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Gyro problem, please help!
Gyros tend to drift, but not by large amounts. Make sure your robot isn't moving when you power on to minimize the drift. We've found that the normal gyro drift doesn't affect us much during autonomous, and during teleop we always use offsets rather than absolute angles when giving gyro-based commands. (ie. use the current gyro angle + some offset rather than using an absolute angle)
|
|
#2
|
|||
|
|||
|
Re: Gyro problem, please help!
What do you mean by offset ?
|
|
#3
|
|||
|
|||
|
Re: Gyro problem, please help!
For example, if you know the robot is straight and you want to turn 30 degrees (but your gyro drift is adding up), you could turn to gyro.getAngle() + 30.0. Another solution, as MagiChau wrote, is to reset the gyro if you know where your robot is pointed.
Last edited by Gigakaiser : 20-03-2013 at 00:54. |
|
#4
|
|||
|
|||
|
Re: Gyro problem, please help!
Quote:
I already written a program for that but never get to test it because our robot is packed up and only thing i could access from our lab is bunch of sensors and a crio. does is work properly when you use it like that ? |
|
#5
|
|||
|
|||
|
Re: Gyro problem, please help!
Quote:
double lastAngle = 0; double newAngle =0; double realAngle = 0; gyro.reset(); while (isEnabled() && isOperatorControl()) { double move = y.getY(); motor.set(move/5); if (move > 0.01 || move < -0.01) { newAngle = gyro.getAngle(); lastAngle = realAngle; } else { realAngle = newAngle + lastAngle; gyro.reset(); } System.out.println(realAngle); System.out.println(move); Timer.delay(0.05); } } do you think this will work ? |
|
#6
|
||||
|
||||
|
Re: Gyro problem, please help!
Zach, 1 degree every 1-3 minutes is actually good performance from the KOP gyro. As far as I know, you're not going to be able to improve on it substantially.
Perhaps you can tell us the application. I can't think of many applications for a gyro that would be messed up by 1 degree over the course of the match. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|