View Single Post
  #3   Spotlight this post!  
Unread 11-03-2010, 23:35
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: switching turning direction using arcade drive?

You can use the ArcadeDrive method that takes raw values for the speed/turn inputs. This is the signature:
Code:
void RobotDrive::ArcadeDrive(float moveValue, float rotateValue, bool squaredInputs = true);
So instead of doing something like this
Code:
 myDrive.ArcadeDrive(myJoystick);
You could do something like
Code:
float orientation = 1;

if(goingBackwards) 
   orientation = -1;

myDrive.ArcadeDrive(myJoystick.GetY() * orientation, myJoystick.GetX());
You shouldn't have to reverse the motors with that.

EDIT: You shouldn't have to reverse the X axis actually. Kind of counter intuitive, but thats the way it works out. A left hand turn is a left hand turn looking forward and backward. You just want to change your direction. (moveValue)

Last edited by Tom Bottiglieri : 11-03-2010 at 23:45.