本文整理汇总了Java中com.ctre.CANTalon.reverseOutput方法的典型用法代码示例。如果您正苦于以下问题:Java CANTalon.reverseOutput方法的具体用法?Java CANTalon.reverseOutput怎么用?Java CANTalon.reverseOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ctre.CANTalon
的用法示例。
在下文中一共展示了CANTalon.reverseOutput方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTalon
import com.ctre.CANTalon; //导入方法依赖的package包/类
/**
* Create a wrapped {@link CANTalon} with appropriate default values.
*
* @param id the device ID of the CANTalon to create
* @return the wrapped CANTalon
* @see Wrapper
*/
@NotNull
private CANTalon createTalon(int id) {
CANTalon talon = wrapperFactory.createWrapper(id, CONTROL_FRAME_MS);
StatusFrameRate.DEFAULT.configure(talon);
talon.changeControlMode(TalonControlMode.Voltage);
talon.clearIAccum();
talon.ClearIaccum();
talon.clearMotionProfileHasUnderrun();
talon.clearMotionProfileTrajectories();
talon.clearStickyFaults();
talon.enableZeroSensorPositionOnForwardLimit(false);
talon.enableZeroSensorPositionOnIndex(false, false);
talon.enableZeroSensorPositionOnReverseLimit(false);
talon.reverseOutput(false);
talon.reverseSensor(false);
talon.setAnalogPosition(0);
talon.setPosition(0);
talon.setProfile(0);
talon.setPulseWidthPosition(0);
if (!seen.add(talon)) {
throw new IllegalStateException("creating an already-existing talon");
}
logger.info("added {} to seen Set", talon);
return talon;
}
示例2: init
import com.ctre.CANTalon; //导入方法依赖的package包/类
public static void init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
compressor = new Compressor();
driveTrainLeftFront = new CANTalon(1);
LiveWindow.addActuator("DriveTrain", "LeftFront", driveTrainLeftFront);
driveTrainRightFront = new CANTalon(3);
LiveWindow.addActuator("DriveTrain", "RightFront", driveTrainRightFront);
driveTrainLeftRear = new CANTalon(2);
driveTrainLeftRear.changeControlMode(TalonControlMode.Follower);
driveTrainLeftRear.set(driveTrainLeftFront.getDeviceID());
LiveWindow.addActuator("DriveTrain", "LeftRear", driveTrainLeftRear);
driveTrainRightRear = new CANTalon(4);
driveTrainRightRear.changeControlMode(TalonControlMode.Follower);
driveTrainRightRear.set(driveTrainRightFront.getDeviceID());
driveTrainRightRear.reverseOutput(false);
LiveWindow.addActuator("DriveTrain", "RightRear", driveTrainRightRear);
driveTrainLeftFront.setInverted(true);
driveTrainRightFront.setInverted(true);
driveTrainLeftRear.setInverted(true);
driveTrainRightRear.setInverted(true);
driveTrainRobotDrive41 = new RobotDrive(driveTrainRightFront, driveTrainLeftFront);
driveTrainRobotDrive41.setSafetyEnabled(true);
driveTrainRobotDrive41.setExpiration(0.1);
driveTrainRobotDrive41.setSensitivity(0.5);
driveTrainRobotDrive41.setMaxOutput(1.0);
climbMotor = new CANTalon(5);
LiveWindow.addActuator("Climbing", "Motor", climbMotor);
lightsLightEnable = new Relay(0);
LiveWindow.addActuator("Lights", "LightEnable", lightsLightEnable);
gearIntakeRamp = new DoubleSolenoid(1, 0);
LiveWindow.addActuator("GearIntake", "IntakeRamp", gearIntakeRamp);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例3: config
import com.ctre.CANTalon; //导入方法依赖的package包/类
@Override
protected void config(CANTalon talon, boolean value) {
talon.reverseOutput(value);
}
示例4: configure
import com.ctre.CANTalon; //导入方法依赖的package包/类
/**
* Configure a Talon with stored parameters.
*
* @param talon the Talon to registerWith
*/
public void configure(@NotNull CANTalon talon) {
talon.setSafetyEnabled(false);
talon.setProfile(0);
talon.setExpiration(MotorSafety.DEFAULT_SAFETY_EXPIRATION);
Encoder enc = encoder != null ? encoder : Encoder.DEFAULT;
enc.configure(talon);
talon.enableBrakeMode(brakeInNeutral != null ? brakeInNeutral : true);
talon.reverseOutput(outputReversed != null ? outputReversed : false);
if (velocityMeasurementPeriod != null) {
talon.SetVelocityMeasurementPeriod(velocityMeasurementPeriod);
} else {
talon.SetVelocityMeasurementPeriod(VelocityMeasurementPeriod.Period_100Ms);
}
if (velocityMeasurementWindow != null) {
talon.SetVelocityMeasurementWindow(velocityMeasurementWindow);
} else {
talon.SetVelocityMeasurementWindow(64);
}
LimitSwitch fls = forwardLimitSwitch != null ? forwardLimitSwitch : LimitSwitch.DEFAULT;
LimitSwitch rls = reverseLimitSwitch != null ? reverseLimitSwitch : LimitSwitch.DEFAULT;
talon.enableLimitSwitch(fls.isEnabled(), rls.isEnabled());
if (fls.isEnabled()) {
talon.ConfigFwdLimitSwitchNormallyOpen(fls.isNormallyOpen());
}
if (rls.isEnabled()) {
talon.ConfigRevLimitSwitchNormallyOpen(rls.isNormallyOpen());
}
SoftLimit sl = forwardSoftLimit != null ? forwardSoftLimit : SoftLimit.DEFAULT;
talon.enableForwardSoftLimit(sl.isEnabled());
if (sl.isEnabled()) {
talon.setForwardSoftLimit(sl.getPosition());
}
sl = reverseSoftLimit != null ? reverseSoftLimit : SoftLimit.DEFAULT;
talon.enableReverseSoftLimit(sl.isEnabled());
if (sl.isEnabled()) {
talon.setReverseSoftLimit(sl.getPosition());
}
if (currentLimit != null && currentLimit > 0) {
talon.setCurrentLimit(currentLimit);
talon.EnableCurrentLimit(true);
} else {
talon.EnableCurrentLimit(false);
}
talon.setVoltageRampRate(voltageRampRate != null ? voltageRampRate : 0);
addTalonId(talon.getDeviceID());
}