View Single Post
  #1   Spotlight this post!  
Unread 07-03-2006, 21:06
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Keeping a certain heading using a gyro

Hi all,

OK, I've been looking at Kevin's gyro code, and have been trying to work out an algorithm to maintain a certain heading using the gyro supplied in the kit.

My thoughts are leaning towards something like this:

Code:
Reset_Gyro_Angle();
if(Get_Gyro_Angle > 10){//1 degree
   turn left
}
else if(Get_Gyro_Angle < -10){//-1 degree
   turn right
}
else
   stop
Am I correct about the gyro values, where a positive value would be a turn to the right and a negative value would be a turn to the left?

And would this code (without optimizations) allow self adjustment to a certain heading (despite oscillations)?

Thanks,
__________________