View Single Post
  #12   Spotlight this post!  
Unread 29-02-2012, 23:16
Fletch1373's Avatar
Fletch1373 Fletch1373 is offline
Registered User
AKA: Fletch
FRC #3181 (Panthers)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Rochester, NY
Posts: 251
Fletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud of
Re: Programming Mecanum Wheels - 4 Victors

Quote:
Originally Posted by Unforgiven_Hero View Post
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);				
		}
	}
__________________
Student:
<04: FRC0213> <05-08: FRC1373>
Mentor:
<09-10: FRC0809> <11-12: FRC3555> <12-14: FRC0073> <15-??: FRC3181>
Volunteer:
<FTAA> <CSA> <Defense Coordinator> <Scorekeeper> <Robot Inspector> <Official Scorer>
2016 Tour:
CTWAT [DefCoord] > Pittsburgh[Mentor/DefCoord] > TVR[FTAA] > FLR[CSA] > NE DCMP[CSA] > CMP[CSA]
Reply With Quote