View Single Post
  #14   Spotlight this post!  
Unread 14-02-2011, 13:44
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Encoders in Auto Mode

ok so correct my if im wrong but for 60 inches it would look something like this?


Code:
encoder->Setdistanceperpulse (60.0)
double distanceTraveled = (leftfrontEncoder->GetDistance() +
                                     rightFrontEncoder->GetDistance() +
                                     leftRearEncoder->GetDistance() +
                                     rightRearEncoder->GetDistance())/4.0;
if (distanceTraveled < targetDistance)
{
    MecaumDrive_Polar(forwardPower, 0.0, 0.0);
}
else
{
   MecaumDrive_Polar(0.0, 0.0, 0.0);
}
thanks for the help in advance im new to c++
Reply With Quote