|
Haptic Controller
|
Class that abstracts operations with the ODrive/. More...
Public Member Functions | |
| OdriveController ()=default | |
| ~OdriveController ()=default | |
| OdriveController (FlexCAN_T4< CAN, RX_SIZE_256, TX_SIZE_256 > &odrive_can, int CAN_ID, ODriveUserData &odrv_user_data) | |
| Constructor for the ODriveController. | |
| bool | set_params () |
| Set parameters on the ODrive. | |
| bool | full_calibration () |
| Run the full calibration sequence given by ODrive. | |
| bool | move_to_limits () |
| Move to the upper and lower limits of the joint. | |
| bool | enable_anticogging (bool doCalibration=false) |
| Set parameters for anticogging and enable it. | |
| bool | startup_odrive_checks () |
| Set parameters and set the motor to torque control. | |
| void | set_torque (float torque) |
| Function to set the torque values based on the joint limits recorded from the startup_calibration. | |
Public Attributes | |
| FlexCAN_T4< CAN, RX_SIZE_256, TX_SIZE_256 > & | odrive_can_ |
| Address of canline for this odrive. | |
| ODriveCAN | odrv_ |
| Odrive object to control. | |
| ODriveUserData & | odrv_user_data_ |
| struct to store user data in | |
| Limits< float > | motor_limits_ |
| : Limits on motor torques | |
| float | alpha_ = 0.95 |
Class that abstracts operations with the ODrive/.
| CAN | - CAN bus that the ODrive is connected to |
Definition at line 15 of file odrive_controller.hpp.
|
default |
|
default |
|
inline |
Constructor for the ODriveController.
| odrive_can | - CAN bus that the ODrive is connected to |
| CAN_ID | - CAN ID of the ODrive |
| odrv_user_data | Reference to the ODriveUserData object |
Definition at line 25 of file odrive_controller.hpp.
References ODriveUserData::node_id, OdriveController< CAN >::odrv_, OdriveController< CAN >::odrv_user_data_, onFeedback(), onHeartbeat(), and onTemperature().
|
inline |
Set parameters for anticogging and enable it.
| doCalibration | - If true, will run the anticogging calibration |
Definition at line 115 of file odrive_controller.hpp.
References Set_Reboot_msg_t::Action, banticogging_config_params(), benable_config_param, Set_Param_msg_t< T >::Endpoint_ID, fanticogging_config_params(), OdriveController< CAN >::odrive_can_, OdriveController< CAN >::odrv_, and Set_Param_msg_t< T >::Value.
|
inline |
Run the full calibration sequence given by ODrive.
Definition at line 84 of file odrive_controller.hpp.
References OdriveController< CAN >::odrv_.
|
inline |
Move to the upper and lower limits of the joint.
Definition at line 94 of file odrive_controller.hpp.
References Limits< T >::lower, OdriveController< CAN >::motor_limits_, OdriveController< CAN >::odrv_, and Limits< T >::upper.
|
inline |
Set parameters on the ODrive.
Definition at line 54 of file odrive_controller.hpp.
References bconfig_params(), Set_Param_msg_t< T >::Endpoint_ID, fconfig_params(), OdriveController< CAN >::odrive_can_, OdriveController< CAN >::odrv_, and Set_Param_msg_t< T >::Value.
Referenced by OdriveController< CAN >::startup_odrive_checks().
|
inline |
Function to set the torque values based on the joint limits recorded from the startup_calibration.
| torque | Requested torque in N/m |
Definition at line 190 of file odrive_controller.hpp.
References OdriveController< CAN >::alpha_, ODriveUserData::last_feedback, Limits< T >::lower, OdriveController< CAN >::motor_limits_, OdriveController< CAN >::odrv_, OdriveController< CAN >::odrv_user_data_, pos, and Limits< T >::upper.
|
inline |
Set parameters and set the motor to torque control.
Definition at line 170 of file odrive_controller.hpp.
References OdriveController< CAN >::odrv_, and OdriveController< CAN >::set_params().
Referenced by CommsController< ODRIVE_CAN0, ODRIVE_CAN1 >::Initialize().
| float OdriveController< CAN >::alpha_ = 0.95 |
Definition at line 51 of file odrive_controller.hpp.
Referenced by OdriveController< CAN >::set_torque().
| Limits<float> OdriveController< CAN >::motor_limits_ |
: Limits on motor torques
Definition at line 49 of file odrive_controller.hpp.
Referenced by OdriveController< CAN >::move_to_limits(), and OdriveController< CAN >::set_torque().
| FlexCAN_T4<CAN, RX_SIZE_256, TX_SIZE_256>& OdriveController< CAN >::odrive_can_ |
Address of canline for this odrive.
Definition at line 40 of file odrive_controller.hpp.
Referenced by OdriveController< CAN >::enable_anticogging(), and OdriveController< CAN >::set_params().
| ODriveCAN OdriveController< CAN >::odrv_ |
Odrive object to control.
Definition at line 43 of file odrive_controller.hpp.
Referenced by OdriveController< CAN >::enable_anticogging(), OdriveController< CAN >::full_calibration(), CommsController< ODRIVE_CAN0, ODRIVE_CAN1 >::get_odrv0(), CommsController< ODRIVE_CAN0, ODRIVE_CAN1 >::get_odrv1(), OdriveController< CAN >::move_to_limits(), OdriveController< CAN >::OdriveController(), onOdriveCanMessage(), OdriveController< CAN >::set_params(), OdriveController< CAN >::set_torque(), and OdriveController< CAN >::startup_odrive_checks().
| ODriveUserData& OdriveController< CAN >::odrv_user_data_ |
struct to store user data in
Definition at line 46 of file odrive_controller.hpp.
Referenced by CommsController< ODRIVE_CAN0, ODRIVE_CAN1 >::comms_timeout(), CommsController< ODRIVE_CAN0, ODRIVE_CAN1 >::get_odrv0_data(), CommsController< ODRIVE_CAN0, ODRIVE_CAN1 >::get_odrv1_data(), OdriveController< CAN >::OdriveController(), OdriveController< CAN >::set_torque(), and CommsController< ODRIVE_CAN0, ODRIVE_CAN1 >::Tick().