本文整理汇总了Java中edu.wpi.first.wpilibj.CANJaguar.configMaxOutputVoltage方法的典型用法代码示例。如果您正苦于以下问题:Java CANJaguar.configMaxOutputVoltage方法的具体用法?Java CANJaguar.configMaxOutputVoltage怎么用?Java CANJaguar.configMaxOutputVoltage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.CANJaguar
的用法示例。
在下文中一共展示了CANJaguar.configMaxOutputVoltage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configSpeedControl
import edu.wpi.first.wpilibj.CANJaguar; //导入方法依赖的package包/类
private void configSpeedControl(CANJaguar jag) throws CANTimeoutException {
final int CPR = 360;
final double ENCODER_FINAL_POS = 0;
final double VOLTAGE_RAMP = 40;
jag.changeControlMode(CANJaguar.ControlMode.kPercentVbus);
jag.setSpeedReference(CANJaguar.SpeedReference.kNone);
jag.enableControl();
jag.configMaxOutputVoltage(10);//ToDo:
// PIDs may be required. Values here:
// http://www.chiefdelphi.com/forums/showthread.php?t=91384
// and here:
// http://www.chiefdelphi.com/forums/showthread.php?t=89721
// neither seem correct.
// jag.setPID(0.4, .005, 0);
/*jag.setPID(1, 0, 0);
jag.changeControlMode(CANJaguar.ControlMode.kSpeed);
jag.setSpeedReference(CANJaguar.SpeedReference.kQuadEncoder);
jag.configEncoderCodesPerRev(CPR);
// jag.setVoltageRampRate(VOLTAGE_RAMP);
jag.enableControl();*/
// System.out.println("Control Mode = " + jag.getControlMode());
}
示例2: SteeringUnit
import edu.wpi.first.wpilibj.CANJaguar; //导入方法依赖的package包/类
SteeringUnit(int steeringCanID, int leftCanID, int rightCanID) throws CANTimeoutException {
middle = new CANJaguar(steeringCanID, CANJaguar.ControlMode.kPosition);
//middle = new CANJaguar(steeringCanID, CANJaguar.ControlMode.kPercentVbus);
middle.configMaxOutputVoltage(ReboundRumble.MAX_MOTOR_VOLTAGE);
middle.configPotentiometerTurns(1);
middle.setPositionReference(CANJaguar.PositionReference.kPotentiometer);
middle.configNeutralMode(CANJaguar.NeutralMode.kBrake);
middle.setPID(kProportional, kIntegral, kDifferential);
left = new Wheel(leftCanID);
right = new Wheel(rightCanID);
setpoint = 0.0;
}
示例3: Shooter
import edu.wpi.first.wpilibj.CANJaguar; //导入方法依赖的package包/类
public Shooter() throws CANTimeoutException {
motor = new CANJaguar(Parameters.WheelOneCANJaguarCANID, CANJaguar.ControlMode.kPercentVbus);
motor.configMaxOutputVoltage(Parameters.MaxMotorOutputVoltage);
motor.configNeutralMode(CANJaguar.NeutralMode.kBrake);
discSensor = new DigitalInput(Parameters.DiscInShooterGPIOChannel);
shooterCockedSensor = new DigitalInput(Parameters.ShooterIsCockedGPIOChannel);
shooterRetractedSensor = new DigitalInput(Parameters.ShooterIsRetractedGPIOChannel);
}
示例4: Arm
import edu.wpi.first.wpilibj.CANJaguar; //导入方法依赖的package包/类
public Arm(int armCANID) {
// latchSwitch = new DigitalInput(1,
// Parameters.latchLimitSwitchGPIOChannel);
// handOffSwitch = new DigitalInput(1
// , Parameters.handOffLimitSwitchGPIOChannel);
try {
motor = new CANJaguar(armCANID);
motor.configMaxOutputVoltage(Parameters.MaxMotorOutputVoltage);
motor.changeControlMode(CANJaguar.ControlMode.kPercentVbus);
motor.configNeutralMode(CANJaguar.NeutralMode.kBrake);
} catch (CANTimeoutException ex) {
ex.printStackTrace();
}
}
示例5: ClimbingSystem
import edu.wpi.first.wpilibj.CANJaguar; //导入方法依赖的package包/类
public ClimbingSystem(RobotTemplate robo)
{
try
{
up = new Solenoid(Wiring.CLIMB_SOLENOID_UP);
down = new Solenoid(Wiring.CLIMB_SOLENOID_DOWN);
forward = new Solenoid(Wiring.CLIMBING_SOLENOID_FORWARD);
back = new Solenoid(Wiring.CLIMBING_SOLENOID_BACKWARD);
home = new DigitalInput(Wiring.CYLINDER_HOME);
part = new DigitalInput(Wiring.CYLINDER_PART);
max = new DigitalInput(Wiring.CYLINDER_MAX);
winch = new CANJaguar(Wiring.WINCH_MOTOR);
countPart = new Counter(part);
countPart.setUpSourceEdge(true, false);
countPart.reset();
countPart.start();
winch.configMaxOutputVoltage(6.0);
forward.set(true);
back.set(false);
this.robo = robo;
time.start();
typicalCurrent = 0;
}
catch (CANTimeoutException ex)
{
ex.printStackTrace();
}
}
示例6: Wheel
import edu.wpi.first.wpilibj.CANJaguar; //导入方法依赖的package包/类
Wheel(int canId) throws CANTimeoutException {
motorController = new CANJaguar(canId);
motorController.configMaxOutputVoltage(ReboundRumble.MAX_MOTOR_VOLTAGE);
motorController.changeControlMode(CANJaguar.ControlMode.kVoltage);
motorController.configNeutralMode(CANJaguar.NeutralMode.kBrake);
}
示例7: Tread
import edu.wpi.first.wpilibj.CANJaguar; //导入方法依赖的package包/类
/**
* Tread
*
* Constructor
*
* @param parent - TankDrive that this Tread is part of
* @param canID - The channel number for the CANJaguar
* @param gearChannel - The solenoid channel for the gear selector
* @throws CANTimeoutException - when communication with the jaguar fails over the CAN bus
*/
public Tread(TankDrive parent, int canID, int gearChannel) throws CANTimeoutException
{
motor = new CANJaguar(canID, CANJaguar.ControlMode.kPercentVbus);
motor.configMaxOutputVoltage(Parameters.MaxMotorOutputVoltage);
motor.configNeutralMode(CANJaguar.NeutralMode.kBrake);
drive = parent;
gearShifter = new Solenoid(Parameters.crioRelayModule, gearChannel);
setGear(Gear.kLow);
}