|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <dji_m2006_old.hpp>


Classes | |
| struct | Config |
Public Member Functions | |
| DjiM2006Old (Drivers &drivers, const Config &config) | |
| DjiM2006Old (Drivers &drivers, tap::motor::MotorId motorId, tap::can::CanBus canBus, const char *name, bool inverted, double gearRatio, const DjiSpeedPid::Config &speedConfig) | |
| mockable | ~DjiM2006Old ()=default |
| mockable void | initialize () override |
| mockable void | update () override |
| mockable void | setTargetSpeed (const RPM &targetSpeed) override |
| mockable RPM | getSpeed () const |
| mockable void | setDesiredOutput (DjiMotorOutput desiredOutput) |
| mockable bool | isMotorOnline () const |
| mockable Celsius | getTemperature () const |
| mockable tap::can::CanBus | getCanBus () const |
| mockable const char * | getName () const |
Static Public Attributes | |
| static constexpr DjiMotorOutput | k_maxOutput {tap::motor::DjiMotor::MAX_OUTPUT_C610} |
| Maximum output for C610 controller. | |
| static constexpr double | k_factoryGearboxRatio {tap::motor::DjiMotorEncoder::GEAR_RATIO_M2006} |
| gear ratio of the gearbox that usually ships with the motor. | |
Wrapper for DJI motor for the DJI M3508 on a CAN bus
| trap::motor::DjiM2006Old::DjiM2006Old | ( | Drivers & | drivers, |
| tap::motor::MotorId | motorId, | ||
| tap::can::CanBus | canBus, | ||
| const char * | name, | ||
| bool | inverted, | ||
| double | gearRatio, | ||
| const DjiSpeedPid::Config & | speedConfig | ||
| ) |
drivers - the drivers struct motorId - the motor controller id canBus - the can bus the motor controller is on name - the name of the motor for the controller menu gearRatio - the ratio of input revolutions per output revolution pid config: make sure the maxOutput does not exceed DjiM3508 k_maxOutput. This would lead to undefined behavior. An assertion has been placed to prevent the code from continuing.
|
default |
| tap::can::CanBus trap::motor::DjiM2006Old::getCanBus | ( | ) | const |
| const char * trap::motor::DjiM2006Old::getName | ( | ) | const |
| RPM trap::motor::DjiM2006Old::getSpeed | ( | ) | const |
Returns the last reported RPM from CAN
| Celsius trap::motor::DjiM2006Old::getTemperature | ( | ) | const |
Returns the reported temperature in celsius. The temperature was provided in an int8_t
|
override |
It must be called for the motor to properly function.
| bool trap::motor::DjiM2006Old::isMotorOnline | ( | ) | const |
true if a can message has been received within the last MOTOR_DISCONNECT_TIME.
| void trap::motor::DjiM2006Old::setDesiredOutput | ( | DjiMotorOutput | desiredOutput | ) |
The desired motor output. It must be limited to a 16 bit int.
|
override |
Sets the desired speed for the pid to target
|
override |
Must be called regularly to update the motor pid and set the motor output
|
staticconstexpr |
gear ratio of the gearbox that usually ships with the motor.
|
staticconstexpr |
Maximum output for C610 controller.