|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
How do I use Robotdrive.h?
Salutations from Team 1086! I am a new programmer and I am trying to set up Cartesian Mecanum code for our robot. I am trying to set up halo drive. In other words, I want to have one joystick control the forward/backward movement and strafing, while another joystick controls rotation. My question is, how can I use the WPI Library's Robotdrive.h? What can I use from this?
Thanks! Zach 1086 Blue Cheese |
|
#2
|
||||
|
||||
|
Re: How do I use Robotdrive.h?
Let's say you have the leftDriveStick and the rightDriveStick. The right stick X and Y will be the forward/backward and strafe. The left stick X will be the rotate.
Code:
Joystick leftStick; Joystick rightStick; RobotDrive robotDrive; float x = DEAD_BAND(rightStick.GetX()); float y = DEAD_BAND(rightStick.GetY()); float rot = DEAD_BAND(leftStick.GetX()); robotDrive.MecanumDrive_Cartesian(x, y, rot); Last edited by mikets : 17-10-2013 at 21:21. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|