View Single Post
  #7   Spotlight this post!  
Unread 28-02-2012, 21:27
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Re: Use Gyro to turn 90 Degrees

Alright I will be testing that tomorrow. I was curious about the value range because we had the bot set up with the following code:
Code:
float angle = gyro.GetAngle() + 90;
myRobot.Drive(-0.2, -angle / 30);
The robot went straight before the "+ 90"; the -0.2 is because a negative value is actually forward on the bot.

The result when running this was that the robot would turn right at a medium rate and continue turning after passing 90 degrees.

The other result that seemed odd was that changing "/ 30" to "/ 1" caused a slower turn rate while changing it to "/ 60" caused a faster turn rate.
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote