View Single Post
  #5   Spotlight this post!  
Unread 03-12-2011, 06:54 PM
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: Line Tracking Code Help

Quote:
Originally Posted by davidalln View Post
My raw autonomous code wouldn't be much use to you, as its deeply integrated in our system and would be difficult to read if you don't know what everything does. But here's the basic idea:

Code:
if (leftSensorTripped) {
   robotDrive->TankDrive(0.7, 0.8);
} else if (rightSensorTripped) {
   robotDrive->TankDrive(0.8, 0.7);
} else {
   robotDrive->TankDrive(0.7, 0.7);
}
This will gradually get your robot back on the line without overcorrecting. Obviously this is oversimplified and you'll need to adapt it to your bot, but this shows the basic idea. Note that this will not work well in the Y (middle autonomous) as you need a much sharper turn at the corner. For that you need to make a sharper turn.
Thanks for the info. We've gotten our line tracking code working and now we just need access to a real field for tuning!

Mike
Reply With Quote