Quote:
Originally Posted by Unforgiven_Hero
Okay so here is where I stand, don't have a chance to test it on the practice bot today but will tomorrow. Anyone got any advice on the program and is there anything essential I should add or do to this program? Not totally sure how to do the twist part for the Mecanum wheels using an Attack3 joystick...
Here it is:
|
You require the second joystick because each Attack3 only has 2 axes, but you need 3. So you will use the X- and Y-axis of Attack1 for moving straight(front/back and sideways), and the X-axis of Attack2 to do rotation. the getTwist method does nothing with Attack3 joysticks because they don't have the 3rd(or Twist) axis.
Code:
void OperatorControl(void)
{
GetWatchdog().SetEnabled(true);
drive->SetSafetyEnabled(true);
while (IsOperatorControl())
{
drive->MecanumDrive_Cartesian(Attack1->GetX(),Attack1->GetY(),Attack2->GetX());
Wait(0.005);
}
}