|
Re: Joystick Assigning/ Change to Tank Drive
Just to add clarification to what byteit said, about the leftStick.GetY();
For the tank drive function accepts 2 float values.
What you said, is myRobot->TankDrive(stick,stick2); This is passing the 2 joysticks themselves, which would not work. Instead, you should pass their Y Values.
leftStick.GetY() returns a float value from -1(all the way foward) to 1 (all the way backwards).
So in order to drive the robot, (assuming everything else is correct) you would do this:
myRobot.TankDrive( leftStick.GetY(), rightStick.GetY() );
Note: You may need to make one of those values negative (put a "-" infront of one, such as -leftStick.GetY()) so the robot will drive straight when pushed full fowards, not turn.
|