Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   How do I use Robotdrive.h? (http://www.chiefdelphi.com/forums/showthread.php?t=120537)

Darkseer54 17-10-2013 19:38

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

mikets 17-10-2013 21:18

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);



All times are GMT -5. The time now is 12:53.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi