◆ sim_motor()
Constructor for can motor.
- Parameters
-
motor | The motor id to manipulate. |
hasPosSensor | Boolean to indicate if the motor has a position sensor. |
name | The name of the motor. |
protocol_path | Websocket protocol path. |
◆ 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::sim_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::sim_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.
◆ setServoPos()
void robot::sim_motor::setServoPos |
( |
uint8_t | servo, |
|
|
int32_t | position ) |
|
overridevirtual |
◆ setStepperTurnAngle()
void robot::sim_motor::setStepperTurnAngle |
( |
uint8_t | stepper, |
|
|
int16_t | angle ) |
|
overridevirtual |
The documentation for this class was generated from the following files:
- src/world_interface/motor/sim_motor.h
- src/world_interface/motor/sim_motor.cpp