Go to Post Ooohh!! Fire!! - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 30-03-2012, 11:00
cddp14 cddp14 is offline
Registered User
FRC #1270
 
Join Date: Feb 2007
Location: Clevleand, Oh
Posts: 10
cddp14 is an unknown quantity at this point
Flipping the X - axis

Ok. this a simple problem that I know I am just overlooking a small detail. For this years robot we what to be able to push a button to be able to make the back of the robot to become the front and vice versa during TeleOp mode. The only problem is that the x-axis of doesn't adjust when the switch is made. when the robot is reversed and you move the joystick to the left the robot turns to the right and vice versa. Here is my code below:
MyBase->ArcadeDrive(Driver);
if(Driver->GetRawButton(6))// reverse direction of robot
{

MyBase->SetInvertedMotor(RobotDrive::kRearLeftMotor, true);
MyBase->SetInvertedMotor(RobotDrive::kFrontLeftMotor,true );
MyBase->SetInvertedMotor(RobotDrive::kRearRightMotor, true);
MyBase->SetInvertedMotor(RobotDrive::kFrontRightMotor,tru e);

}
if(Driver->GetRawButton(7))// normal configuration
{

MyBase->SetInvertedMotor(RobotDrive::kRearRightMotor, false);
MyBase->SetInvertedMotor(RobotDrive::kFrontRightMotor,fal se);
MyBase->SetInvertedMotor(RobotDrive::kRearLeftMotor, false);
MyBase->SetInvertedMotor(RobotDrive::kFrontLeftMotor,fals e);


}
How can I get the X- axis to switch with the reversal? Thanks in advance. Also, I am using WindRiver.

Last edited by cddp14 : 30-03-2012 at 11:02.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 17:36.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi