Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Two Talons for Two Sets of Wheels (http://www.chiefdelphi.com/forums/showthread.php?t=142244)

simon1636 21-01-2016 04:04

Two Talons for Two Sets of Wheels
 
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

Re: Two Talons for Two Sets of Wheels
 
Quote:

Originally Posted by simon1636 (Post 1527655)
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

Re: Two Talons for Two Sets of Wheels
 
After defining your Talons and Joystick objects in your Robot class, create a RobotDrive object like so:
Code:

RobotDrive drive = new RobotDrive(leftTalon, rightTalon);
Then simply call the tank drive function on your RobotDrive object:
Code:

drive.tankDrive(leftJoystick, rightJoystick);


All times are GMT -5. The time now is 10:25.

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