Log in

View Full Version : Two Talons for Two Sets of Wheels


simon1636
21-01-2016, 04:04
Hi! My team's robot has two sets of 3 wheels on each side. It's 6 in all. The left side is hooked up to a talon as well as the right. We are trying to get each game pad joystick to run each side seperately. In order to do this, would you assign each stick a talon, and have it so that when that joystick is pushed, the talons speed is set to a number? This is what I thought, but if anyone can show some sample code of our desired outcome, that would be great! Thank you guys so much!:)

EmileH
21-01-2016, 07:12
Hi! My team's robot has two sets of 3 wheels on each side. It's 6 in all. The left side is hooked up to a talon as well as the right. We are trying to get each game pad joystick to run each side seperately. In order to do this, would you assign each stick a talon, and have it so that when that joystick is pushed, the talons speed is set to a number? This is what I thought, but if anyone can show some sample code of our desired outcome, that would be great! Thank you guys so much!:)

Check out the Tank Drive class. When you go to create a project in eclipse, instead of clicking Robot Java Project, click "Example Robot Java Project" and find tank drive in the list.

BenD
21-01-2016, 10:57
After defining your Talons and Joystick objects in your Robot class, create a RobotDrive object like so:
RobotDrive drive = new RobotDrive(leftTalon, rightTalon);

Then simply call the tank drive function on your RobotDrive object:
drive.tankDrive(leftJoystick, rightJoystick);