![]() |
Mecanum drive code
Hey guys our team just got mecanum wheels but I have no idea how to write the code for these... We use java and have two sets of joysticks we can use. One set has a z axis and the other doesn't so whatever is easier. Any help is appreciated! Thanks in advance.
|
Re: Mecanum drive code
WPILibJ currently supports two mecanum control methods. They are methods of RobotDrive (thanks to 2168 for the API mirror).
If you have a gyro on your robot, you can try field-centric (cartesian) control. This means that, regardless of orientation, your robot will move in the direction that your joystick points. For field-centric control, you can call the mecanumDrive_Cartesian method of RobotDrive: Code:
RobotDrive drive;Code:
drive.mecanumDrive_Polar(joystick.getMagnitude(), joystick.getDirectionDegrees(), joystick.getTwist()); |
| All times are GMT -5. The time now is 22:40. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi