![]() |
Open FFBoard
Open source force feedback firmware
|
#include <MotorDriver.h>
Public Member Functions | |
MotorDriver () | |
virtual | ~MotorDriver () |
const ClassIdentifier | getInfo () |
const ClassType | getClassType () override |
returns the used classchooser selection id of this instance More... | |
virtual void | turn (int16_t power) |
virtual void | stopMotor () |
virtual void | startMotor () |
virtual void | emergencyStop (bool reset=false) |
virtual bool | motorReady () |
virtual Encoder * | getEncoder () |
virtual void | setEncoder (std::shared_ptr< Encoder > &encoder) |
virtual bool | hasIntegratedEncoder () |
![]() | |
virtual | ~ChoosableClass () |
uint16_t | getSelectionID () |
Static Public Attributes | |
static ClassIdentifier | info ={.name = "None" , .id=CLSID_MOT_NONE, .visibility = ClassVisibility::visible} |
static const std::vector< class_entry< MotorDriver > > | all_drivers |
![]() | |
static ClassIdentifier | info |
Protected Attributes | |
std::shared_ptr< Encoder > | drvEncoder = std::make_shared<Encoder>() |
![]() | |
uint16_t | selectionId |
Should only be written by ClassChooser during creation. More... | |
Additional Inherited Members | |
![]() | |
static bool | isCreatable () |
Definition at line 18 of file MotorDriver.h.
|
inline |
Definition at line 20 of file MotorDriver.h.
|
inlinevirtual |
Definition at line 21 of file MotorDriver.h.
|
virtual |
Request an emergency stop if something critical happened or the emergency button is triggered Should stop the motor immediately in a safe way.
Reimplemented in TMC4671.
Definition at line 60 of file MotorDriver.cpp.
|
inlineoverridevirtual |
returns the used classchooser selection id of this instance
Type of this class. Mainclass, motordriver... Should be implemented by the parent class so it is not in the info struct
Reimplemented from ChoosableClass.
Reimplemented in TMC4671.
Definition at line 25 of file MotorDriver.h.
|
virtual |
Returns the encoder of this motor driver. Either the integrated encoder or an external encoder assigned to this motor driver passed externally
Reimplemented in MotorSimplemotion, ODriveCAN, RmdMotorCAN, TMC4671, and VescCAN.
Definition at line 111 of file MotorDriver.cpp.
|
virtual |
Implements ChoosableClass.
Reimplemented in MotorPWM, MotorSimplemotion1, MotorSimplemotion2, ODriveCAN1, ODriveCAN2, RmdMotorCAN1, RmdMotorCAN2, TMC4671, VESC_1, VESC_2, MotorSimplemotion, ODriveCAN, and RmdMotorCAN.
Definition at line 80 of file MotorDriver.cpp.
|
virtual |
If returned true it signals that this motor driver contains its own encoder and does not require an external encoder
Reimplemented in MotorSimplemotion, ODriveCAN, RmdMotorCAN, TMC4671, and VescCAN.
Definition at line 75 of file MotorDriver.cpp.
|
virtual |
Reimplemented in MotorSimplemotion, RmdMotorCAN, TMC4671, ODriveCAN, and VescCAN.
Definition at line 68 of file MotorDriver.cpp.
|
inlinevirtual |
Can pass an external encoder if driver has no integrated encoder This allows a driver to get an external encoder assigned if it requires one and has the capability of using external encoders
Reimplemented in TMC4671.
Definition at line 41 of file MotorDriver.h.
|
virtual |
Enable the motor driver
Reimplemented in MotorPWM, TMC4671, MotorSimplemotion, ODriveCAN, RmdMotorCAN, and VescCAN.
Definition at line 97 of file MotorDriver.cpp.
|
virtual |
Disable the motor driver
Reimplemented in MotorPWM, TMC4671, MotorSimplemotion, ODriveCAN, RmdMotorCAN, and VescCAN.
Definition at line 103 of file MotorDriver.cpp.
|
virtual |
Turn the motor with positive/negative power. Range should be full signed 16 bit A value of 0 should have no torque. The sign is the direction.
Reimplemented in MotorPWM, TMC4671, MotorSimplemotion, ODriveCAN, RmdMotorCAN, and VescCAN.
Definition at line 90 of file MotorDriver.cpp.
|
static |
Add available motor drivers here. ID must be unique to a motor driver. 0-63
Definition at line 26 of file MotorDriver.h.
Definition at line 46 of file MotorDriver.h.
|
static |
Definition at line 23 of file MotorDriver.h.