View Single Post
  #5   Spotlight this post!  
Unread 01-10-2011, 09:01 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++

Quote:
Originally Posted by johncap100 View Post
my understand is that we need to specify each motor/wheel assembly , ie all four individually as each wheel is connected indepedently to a single motor.

so then do we use the above statements for each motor/wheel assembly?

thanks

have you actually written some code just to move the bot with mechanum wheels?
You have 4 individual motors one for each wheel but you don't have to deal with them yourself, the WPI library will take care the rest for you. So when you instantiate the RobotDrive object, you will need to initialize it with four motors in its constructor. Once you define the RobotDrive object with four motors, you can make the MecanumDrive_Polar call to drive it around. The RobotDrive object will figure out the power and direction for each wheel for you.
Code:
Either:
RobotDrive(UINT32 frontLeftMotorChannel, UINT32 rearLeftMotorChannel,
	UINT32 frontRightMotorChannel, UINT32 rearRightMotorChannel,
             float sensitivity = 0.5);
Or:
RobotDrive(SpeedController *frontLeftMotor, SpeedController *rearLeftMotor,
	SpeedController *frontRightMotor, SpeedController *rearRightMotor,
	float sensitivity = 0.5);
And yes, we were using Mecanum wheels last year so we did write some code for them.
__________________

Last edited by mikets : 01-10-2011 at 09:12 PM.
Reply With Quote