blmc_drivers
|
This class is a safe implementation of the Motor class. More...
#include <motor.hpp>
Public Member Functions | |
SafeMotor (Ptr< MotorBoardInterface > board, bool motor_id, const double &max_current_target=2.0, const size_t &history_length=1000, const double &max_velocity=std::numeric_limits< double >::quiet_NaN()) | |
Construct a new SafeMotor object. More... | |
virtual Ptr< const ScalarTimeseries > | get_current_target () const |
Getters. More... | |
virtual void | set_current_target (const double ¤t_target) |
Setters. More... | |
void | set_max_current (double max_current_target) |
Set the max_current_target_ object. More... | |
void | set_max_velocity (double max_velocity) |
Set the max_velocity_ constant. More... | |
![]() | |
Motor (Ptr< MotorBoardInterface > board, bool motor_id) | |
Construct a new Motor object. More... | |
virtual | ~Motor () |
Destroy the Motor object. More... | |
virtual void | send_if_input_changed () |
Actually send the command and controls via the network, See MotorInterface for more information. | |
virtual Ptr< const ScalarTimeseries > | get_measurement (const int &index=0) const |
Getters. More... | |
virtual Ptr< const ScalarTimeseries > | get_sent_current_target () const |
Get the already sent current target values. More... | |
virtual void | set_command (const MotorBoardCommand &command) |
Set the command. More... | |
virtual void | print () const |
Print the motor status and state. More... | |
![]() | |
virtual | ~MotorInterface () |
Destroy the MotorInterface object. | |
Private Attributes | |
double | max_current_target_ |
max_current_target_ is the limit of the current. | |
double | max_velocity_ |
max_velocity_ limits the motor velocity. | |
Ptr< ScalarTimeseries > | current_target_ |
History of the target current sent. | |
Additional Inherited Members | |
![]() | |
enum | MeasurementIndex { current, position, velocity, encoder_index, measurement_count } |
Here is a list of the different measurement available on the blmc card. | |
typedef real_time_tools::ThreadsafeTimeseries< double > | ScalarTimeseries |
This is a useful alias. | |
template<typename Type > | |
using | Ptr = std::shared_ptr< Type > |
This a useful alias for the shared Pointer creation. More... | |
![]() | |
Ptr< MotorBoardInterface > | board_ |
The MotorBoard to be used for the communication. | |
bool | motor_id_ |
The id of the motor on the MotorBoard. | |
This class is a safe implementation of the Motor class.
It contains utilities to bound the control input. It could also contains some velocity limits at the motor level and why not some temperature management.
blmc_drivers::SafeMotor::SafeMotor | ( | Motor::Ptr< MotorBoardInterface > | board, |
bool | motor_id, | ||
const double & | max_current_target = 2.0 , |
||
const size_t & | history_length = 1000 , |
||
const double & | max_velocity = std::numeric_limits< double>::quiet_NaN() |
||
) |
Construct a new SafeMotor object.
board | |
motor_id | |
max_current_target | |
history_length |
|
inlinevirtual |
Getters.
Get the _current_target object
Reimplemented from blmc_drivers::Motor.
|
virtual |
Setters.
Set the current target (Ampere)
current_target |
Reimplemented from blmc_drivers::Motor.
|
inline |
Set the max_current_target_ object.
max_current_target |
|
inline |
Set the max_velocity_ constant.
max_velocity |