![]() |
Mechanum wheel programming in C++
Has anyone programmed the mechanum wheels using C++?/
if so could you share? thanks |
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)To calculate the magnitude and direction from joystick reading, you can do: Code:
MecanumDrive_Polar(joystick->GetMagnitude(), joystick->GetDirectionDegrees(), 0.0); |
Re: Mechanum wheel programming in C++
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? |
Re: Mechanum wheel programming in C++
Quote:
You take the commands from the joysticks and you process them (it's called inverse kinematics) to create the 4 wheel speeds. The drive interface could be a single 3-axis joystick, or two 2-axis joysticks, or any other input device(s). Mecanum has three completely independent degrees of freedom: fore/aft strafe (right/left) rotate (turn, yaw) A mecanum vehicle can perform all three of these motions simultaneously. Here's some reference C code for you: Code:
// 3-axis joystick interface to a mecanum drive |
Re: Mechanum wheel programming in C++
Quote:
Code:
Either: |
Re: Mechanum wheel programming in C++
Quote:
Quote:
-Joe |
Re: Mechanum wheel programming in C++
so does one need only two joysticks or do you need to use 4 with two drivers. seems to me two joysticks would work. Did you find any brand or type better than another. I am looking at the Logitech Extreme 3D Pro. It has the 3 axis capability.
thanks |
Re: Mechanum wheel programming in C++
For driving mecanum, two joysticks would work. Even one would work if the joystick has at least 3 axes (e.g. X, Y and Twist). I don't have the Logitech Extreme 3D Pro, so I can't comment on it.
|
Re: Mechanum wheel programming in C++
Quote:
|
Re: Mechanum wheel programming in C++
Quote:
Did you use two joysticks? thanks John |
Re: Mechanum wheel programming in C++
Yes, It would be extremely helpful if the sample C++ Code for Mechanum Wheels is provided with a good explaination :)
Thanks |
Re: Mechanum wheel programming in C++
1 Attachment(s)
Quote:
Quote:
-Joe |
Re: Mechanum wheel programming in C++
Quote:
Thanks |
Re: Mechanum wheel programming in C++
Quote:
-Joe |
Re: Mechanum wheel programming in C++
Quote:
John |
| All times are GMT -5. The time now is 14:55. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi