◆ can_motor()
Constructor for can motor.
- Parameters
-
motor | The motor id to manipulate. |
hasPosSensor | Boolean to indicate if the motor has a position sensor. |
serial | The serial number of the motor board. |
pos_pwm_scale | The positive pwm scale for the motor power. |
neg_pwm_scale | The positive pwm scale for the motor power. |
◆ getMotorPos()
Get the last reported position of the specified motor.
- Returns
- types::DataPoint<int32_t> The last reported position of the motor, if it exists. If the motor has not reported a position (because it hasn't been received yet or if it doesn't have an encoder) then an empty data point is returned.
Implements robot::base_motor.
◆ setMotorPos()
void robot::can_motor::setMotorPos |
( |
int32_t | targetPos | ) |
|
|
overridevirtual |
Set the target position of the motor.
This will have no effect if the motor does not support PID.
- Parameters
-
targetPos | The target position, in millidegrees. Refer to the specific motor for more information. |
Implements robot::base_motor.
◆ setMotorPower()
void robot::can_motor::setMotorPower |
( |
double | power | ) |
|
|
overridevirtual |
Set the PWM command of the motor.
- Parameters
-
power | The power command, in the range [-1, 1] |
Implements robot::base_motor.
◆ setMotorVel()
void robot::can_motor::setMotorVel |
( |
int32_t | targetVel | ) |
|
|
overridevirtual |
Sets the velocity of the motor.
- Parameters
-
targetVel | The target velocity, in millidegrees per second. |
Reimplemented from robot::base_motor.
◆ setServoPos()
void robot::can_motor::setServoPos |
( |
uint8_t | servo, |
|
|
int32_t | position ) |
|
overridevirtual |
◆ setStepperTurnAngle()
void robot::can_motor::setStepperTurnAngle |
( |
uint8_t | stepper, |
|
|
int16_t | angle ) |
|
overridevirtual |
The documentation for this class was generated from the following files:
- src/world_interface/motor/can_motor.h
- src/world_interface/motor/can_motor.cpp