Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
|
Public Member Functions | |
sim_motor (robot::types::motorid_t motor, bool hasPosSensor, const std::string &name, const std::string &path) | |
Constructor for can motor. | |
void | setMotorPower (double power) override |
Set the PWM command of the motor. | |
void | setMotorPos (int32_t targetPos) override |
Set the target position of the motor. | |
types::DataPoint< int32_t > | getMotorPos () const override |
Get the last reported position of the specified motor. | |
Public Member Functions inherited from robot::base_motor | |
base_motor (robot::types::motorid_t motor, bool hasPosSensor) | |
Constructor for base motor. | |
bool | hasPositionSensor () const |
Returns the status of the motor position sensor. | |
virtual void | setMotorVel (int32_t targetVel) |
Sets the velocity of the motor. | |
base_motor (const base_motor &)=delete | |
Delete the copy constructor. | |
base_motor & | operator= (const base_motor &)=delete |
Delete the copy operator. | |
Additional Inherited Members | |
Protected Member Functions inherited from robot::base_motor | |
void | constructVelController () |
Constructs a Jacobian Vel Controller. | |
void | unscheduleVelocityEvent () |
Unschedules the velocity event if it exists. | |
Protected Attributes inherited from robot::base_motor | |
robot::types::motorid_t | motor_id |
bool | posSensor |
std::optional< util::PeriodicScheduler< std::chrono::steady_clock >::eventid_t > | velEventID |
std::optional< JacobianVelController< 1, 1 > > | velController |
Static Protected Attributes inherited from robot::base_motor | |
static std::optional< util::PeriodicScheduler< std::chrono::steady_clock > > | pSched |
static std::mutex | schedulerMutex |
robot::sim_motor::sim_motor | ( | robot::types::motorid_t | motor, |
bool | hasPosSensor, | ||
const std::string & | name, | ||
const std::string & | path ) |
Constructor for can motor.
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. |
|
overridevirtual |
Get the last reported position of the specified motor.
Implements robot::base_motor.
|
overridevirtual |
Set the target position of the motor.
This will have no effect if the motor does not support PID.
targetPos | The target position, in millidegrees. Refer to the specific motor for more information. |
Implements robot::base_motor.
|
overridevirtual |
Set the PWM command of the motor.
power | The power command, in the range [-1, 1] |
Implements robot::base_motor.