|
Page 1 of 1
|
[ 4 posts ] |
|
Programming turns with the gyro
Author |
Message |
RickyT
Rookie
Joined: Sat Jan 16, 2016 10:21 pm Posts: 2
|
 Programming turns with the gyro
With a gyro installed can we use the simple TurnLeft xxx degrees command or do we have to use the whole getGyroDegrees/SetMotor/SetMotor set of commands?
|
Sat Jan 16, 2016 10:34 pm |
|
 |
Tabor473
Moderator
Joined: Tue May 19, 2015 3:07 pm Posts: 91
|
 Re: Programming turns with the gyro
You are going to have to program it yourself using something like getGyroDegrees. The turnLeft function uses encoders in the motors.
|
Mon Jan 18, 2016 5:39 pm |
|
 |
RickyT
Rookie
Joined: Sat Jan 16, 2016 10:21 pm Posts: 2
|
 Re: Programming turns with the gyro
OK. So we rewrote the program with getGyroDegree and setMotor lines, but noticed another problem. The gyro doesn't measure degrees accurately. In fact, if I check the Device Info for the gyro, the degrees will increase by one degree every 6 seconds (or so) even though the robot is stationary the whole time. This can't be considered "drift" if it's not even moving, can it? I'm thinking that my gyro is defective.
|
Tue Jan 19, 2016 9:18 pm |
|
 |
Tabor473
Moderator
Joined: Tue May 19, 2015 3:07 pm Posts: 91
|
 Re: Programming turns with the gyro
So ya what you are experiencing is drift. Usually for simple applications like this the best solution is to reset the gyro value before each turn. If this is impractical for your implementation you could try using the built in encoders for tracking rotation instead.
|
Thu Jan 21, 2016 10:00 am |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|