View Single Post
  #2   Spotlight this post!  
Unread 01-10-2011, 07:57 PM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Mechanum wheel programming in C++

The WPI library provides the RobotDrive object that includes a method:
Code:
void RobotDrive::MecanumDrive_Polar(float magnitude, float direction, float rotation)
You can call this method to drive the mechanum wheels. It is using polar coordinate system where you specify the magnitude and direction you want to go. Rotation will specify the heading you want the robot to face.

To calculate the magnitude and direction from joystick reading, you can do:
Code:
MecanumDrive_Polar(joystick->GetMagnitude(), joystick->GetDirectionDegrees(), 0.0);
__________________

Last edited by mikets : 01-10-2011 at 08:21 PM.
Reply With Quote