public GRTCANJaguar(int channel, int controlMode) {
listeners = new Vector();
try {
switch (controlMode) {
case PERCENT_CONTROL:
jaguar = new CANJaguar(channel,
CANJaguar.ControlMode.kPercentVbus);
break;
case SPEED_CONTROL:
jaguar = new CANJaguar(channel, CANJaguar.ControlMode.kSpeed);
break;
case POSITION_CONTROL:
jaguar = new CANJaguar(channel, CANJaguar.ControlMode.kPosition);
break;
case CURRENT_CONTROL:
jaguar = new CANJaguar(channel, CANJaguar.ControlMode.kCurrent);
break;
case VOLTAGE_CONTROL:
jaguar = new CANJaguar(channel, CANJaguar.ControlMode.kVoltage);
default:
jaguar = new CANJaguar(channel);
}
} catch (CANTimeoutException e) {
notifyCANTimeout();
}
}