Quote:
Originally Posted by Ozuru
I just changed the testing code to this now and the issue persists. Shouldn't this have fixed it?
Code:
package org.usfirst.frc.team2559.robot;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Talon;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class Robot extends IterativeRobot {
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
Talon talonleft0 = new Talon(3);
Talon talonleft1 = new Talon(4);
Talon talonright0 = new Talon(5);
Talon talonright1 = new Talon(6);
RobotDrive rDrive;
public void robotInit() {
rDrive = new RobotDrive(talonleft0, talonleft1, talonright0, talonright1);
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
rDrive.tankDrive(-0.4, -0.4);
}
public void teleopInit() {
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
}
/**
* This function is called periodically during test mode
*/
public void testPeriodic() {
}
}
|
RobotDrive by default inverts the command to your right side drive motors (the authors assumed you'd wire red to + on both sides), so calling tankDrive(-.4, -.4) actually sends -.4 and +.4 to your Talons.
tankDrive(-.4, .4) or visa versa should result in identical pulsewidths.