public class MatrixDcMotorController
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static double |
apiPowerMax |
protected static double |
apiPowerMin |
protected MatrixMasterController |
master |
static byte |
POWER_MAX |
static byte |
POWER_MIN |
Constructor and Description |
---|
MatrixDcMotorController(MatrixMasterController master) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected DcMotor.RunMode |
flagMatrixToRunMode(byte flag) |
int |
getBattery() |
java.lang.String |
getConnectionInfo() |
java.lang.String |
getDeviceName() |
Manufacturer |
getManufacturer() |
int |
getMotorCurrentPosition(int motor) |
DcMotor.RunMode |
getMotorMode(int motor) |
double |
getMotorPower(int motor) |
boolean |
getMotorPowerFloat(int motor) |
int |
getMotorTargetPosition(int motor) |
MotorConfigurationType |
getMotorType(int motor) |
DcMotor.ZeroPowerBehavior |
getMotorZeroPowerBehavior(int motor) |
int |
getVersion() |
void |
handleReadBattery(byte[] buffer) |
void |
handleReadMode(MatrixI2cTransaction transaction,
byte[] buffer) |
void |
handleReadPosition(MatrixI2cTransaction transaction,
byte[] buffer) |
void |
handleReadTargetPosition(MatrixI2cTransaction transaction,
byte[] buffer) |
boolean |
isBusy(int motor) |
void |
resetDeviceConfigurationForOpMode() |
void |
resetDeviceConfigurationForOpMode(int motor) |
protected byte |
runModeToFlagMatrix(DcMotor.RunMode mode) |
void |
setMotorMode(int motor,
DcMotor.RunMode mode) |
void |
setMotorPower(int motor,
double power) |
void |
setMotorPower(java.util.Set<DcMotor> motors,
double power)
Sets the power for a group of motors.
|
protected void |
setMotorPowerFloat(int motor) |
void |
setMotorTargetPosition(int motor,
int position) |
void |
setMotorType(int motor,
MotorConfigurationType motorType) |
void |
setMotorZeroPowerBehavior(int motor,
DcMotor.ZeroPowerBehavior zeroPowerBehavior) |
public static final byte POWER_MAX
public static final byte POWER_MIN
protected static final double apiPowerMin
protected static final double apiPowerMax
protected MatrixMasterController master
public MatrixDcMotorController(MatrixMasterController master)
protected byte runModeToFlagMatrix(DcMotor.RunMode mode)
protected DcMotor.RunMode flagMatrixToRunMode(byte flag)
public boolean isBusy(int motor)
public void resetDeviceConfigurationForOpMode(int motor)
public void setMotorType(int motor, MotorConfigurationType motorType)
public MotorConfigurationType getMotorType(int motor)
public void setMotorMode(int motor, DcMotor.RunMode mode)
public DcMotor.RunMode getMotorMode(int motor)
public void setMotorZeroPowerBehavior(int motor, DcMotor.ZeroPowerBehavior zeroPowerBehavior)
public DcMotor.ZeroPowerBehavior getMotorZeroPowerBehavior(int motor)
protected void setMotorPowerFloat(int motor)
public boolean getMotorPowerFloat(int motor)
public void setMotorPower(java.util.Set<DcMotor> motors, double power)
motors
- This provides an optimization specific to the Matrix controller
by using the controller's pending bit to tell all of the motors
to start at the same time.power
- The motor power to apply to all motors in the set.public void setMotorPower(int motor, double power)
public double getMotorPower(int motor)
public void setMotorTargetPosition(int motor, int position)
public int getMotorTargetPosition(int motor)
public int getMotorCurrentPosition(int motor)
public int getBattery()
public Manufacturer getManufacturer()
public java.lang.String getDeviceName()
public java.lang.String getConnectionInfo()
public int getVersion()
public void resetDeviceConfigurationForOpMode()
public void close()
public void handleReadBattery(byte[] buffer)
public void handleReadPosition(MatrixI2cTransaction transaction, byte[] buffer)
public void handleReadTargetPosition(MatrixI2cTransaction transaction, byte[] buffer)
public void handleReadMode(MatrixI2cTransaction transaction, byte[] buffer)