Java 类edu.wpi.first.wpilibj.drive.DifferentialDrive 实例源码
项目:Lib2585
文件:Drivetrain.java
/**
* @param inputDeadzone joystick deadzone
* @param ramping ramping acceleration constant
* @param primaryEx primary rotation exponent
* @param secondEx secondary rotation exponent
* @param invertRotation boolean for inverting the rotate value
* @param drivebase robot drive object
*/
public Drivetrain(double inputDeadzone, double ramping, double primaryEx, double secondEx, boolean invertRotation, DifferentialDrive drivebase){
deadzone = inputDeadzone;
ramp = ramping;
//halve the rotation exponents since WPILib squares rotation by default
primaryRotationExponent = primaryEx / 2;
secondaryRotationExponent = secondEx / 2;
drivetrain = drivebase;
invertToggler = new Toggler(inverted);
rotationExponentToggler = new Toggler(usePrimaryRotationExponent);
this.invertRotation = invertRotation;
}
项目:Lib2585
文件:Drivetrain.java
/**Drivetrain with a deadzone of 0, no ramp, 1 for the primary rotation exponent, 1 for the secondary rotation exponent, and no inverted rotation
* @param drivetrain the RobotDrive object
*/
public Drivetrain(DifferentialDrive drivetrain) {
this(0, 1, 1, 1, false, drivetrain);
}
项目:Lib2585
文件:Drivetrain.java
/**
* @return the drivetrain
*/
public DifferentialDrive getDrivetrain() {
return drivetrain;
}
项目:Lib2585
文件:Drivetrain.java
/**
* @param drivetrain the drivetrain to set
*/
public void setDrivetrain(DifferentialDrive drivetrain) {
this.drivetrain = drivetrain;
}
项目:Lib2585
文件:Drivetrain.java
/**Drivetrain with a deadzone of 0, no ramping, 1 for the primary rotation exponent, 1 for the secondary rotation exponent, and no inverted rotation
* @param frontLeft the left front motor controller
* @param rearLeft the back left motor controller
* @param frontRight the front right motor controller
* @param rearRight the back right motor controller
*/
public Drivetrain(SpeedController frontLeft, SpeedController rearLeft, SpeedController frontRight, SpeedController rearRight) {
this(0, 1, 1, 1, false, new DifferentialDrive(new SpeedControllerGroup(frontLeft, rearLeft), new SpeedControllerGroup(frontRight, rearRight)));
}
项目:Lib2585
文件:DrivetrainTest.java
/**
* @param inputDeadzone joystick deadzone
* @param ramping ramping acceleration constant
* @param primaryEx primary rotation exponent
* @param secondEx secondary rotation exponent
* @param invertRotation boolean for inverting the rotate value
* @param drivebase robot drive object
*/
public TestDrivetrain(double inputDeadzone, double ramping, double primaryEx, double secondEx, boolean invertRotation, DifferentialDrive drivebase) {
super(inputDeadzone, ramping, primaryEx, secondEx, invertRotation, drivebase);
}