blmc_drivers
blmc_drivers::MotorBoardInterface Class Referenceabstract

MotorBoardInterface declares an API to inacte with a MotorBoard. More...

#include <motor_board.hpp>

Inheritance diagram for blmc_drivers::MotorBoardInterface:
Collaboration diagram for blmc_drivers::MotorBoardInterface:

Public Types

enum  MeasurementIndex {
  current_0, current_1, position_0, position_1,
  velocity_0, velocity_1, analog_0, analog_1,
  encoder_index_0, encoder_index_1, measurement_count
}
 This is the list of the measurement we can access.
 
enum  ControlIndex { current_target_0, current_target_1, control_count }
 This is the list of the controls we can send.
 
typedef real_time_tools::ThreadsafeTimeseries< double > ScalarTimeseries
 A useful shortcut.
 
typedef ScalarTimeseries::Index Index
 A useful shortcut.
 
typedef real_time_tools::ThreadsafeTimeseries< IndexIndexTimeseries
 A useful shortcut.
 
typedef real_time_tools::ThreadsafeTimeseries< MotorBoardStatusStatusTimeseries
 A useful shortcut.
 
typedef real_time_tools::ThreadsafeTimeseries< MotorBoardCommandCommandTimeseries
 A useful shortcut.
 
template<typename Type >
using Ptr = std::shared_ptr< Type >
 A useful shortcut.
 
template<typename Type >
using Vector = std::vector< Type >
 A useful shortcut.
 

Public Member Functions

virtual ~MotorBoardInterface ()
 Destroy the MotorBoardInterface object.
 
virtual Ptr< const ScalarTimeseriesget_measurement (const int &index) const =0
 Getters. More...
 
virtual Ptr< const StatusTimeseriesget_status () const =0
 Get the status of the motor board. More...
 
virtual Ptr< const ScalarTimeseriesget_control (const int &index) const =0
 input logs More...
 
virtual Ptr< const CommandTimeseriesget_command () const =0
 Get the commands to be send. More...
 
virtual Ptr< const ScalarTimeseriesget_sent_control (const int &index) const =0
 Get the sent controls. More...
 
virtual Ptr< const CommandTimeseriesget_sent_command () const =0
 Get the sent commands. More...
 
virtual void set_control (const double &control, const int &index)=0
 Setters. More...
 
virtual void set_command (const MotorBoardCommand &command)=0
 set_command save the command internally. More...
 
virtual void send_if_input_changed ()=0
 Actually send the commands and the controls.
 

Detailed Description

MotorBoardInterface declares an API to inacte with a MotorBoard.

Member Function Documentation

◆ get_command()

virtual Ptr<const CommandTimeseries> blmc_drivers::MotorBoardInterface::get_command ( ) const
pure virtual

Get the commands to be send.

Returns
Ptr<const CommandTimeseries> is the list of the commands to be send.

Implemented in blmc_drivers::CanBusMotorBoard, and blmc_drivers::SpiMotorBoard.

◆ get_control()

virtual Ptr<const ScalarTimeseries> blmc_drivers::MotorBoardInterface::get_control ( const int &  index) const
pure virtual

input logs

Get the controls to be send.

Parameters
indexdefine the kind of control we are looking for.
Returns
Ptr<const ScalarTimeseries> is the list of the controls to be send.

Implemented in blmc_drivers::CanBusMotorBoard, and blmc_drivers::SpiMotorBoard.

◆ get_measurement()

virtual Ptr<const ScalarTimeseries> blmc_drivers::MotorBoardInterface::get_measurement ( const int &  index) const
pure virtual

Getters.

Get the measurements

Parameters
indexis the kind of measurement we are looking for.
Returns
Ptr<const ScalarTimeseries> is the list of the last time stamped measurement acquiered.

Implemented in blmc_drivers::CanBusMotorBoard, and blmc_drivers::SpiMotorBoard.

◆ get_sent_command()

virtual Ptr<const CommandTimeseries> blmc_drivers::MotorBoardInterface::get_sent_command ( ) const
pure virtual

Get the sent commands.

Returns
Ptr<const CommandTimeseries> is the list of the commands sent recently.

Implemented in blmc_drivers::CanBusMotorBoard, and blmc_drivers::SpiMotorBoard.

◆ get_sent_control()

virtual Ptr<const ScalarTimeseries> blmc_drivers::MotorBoardInterface::get_sent_control ( const int &  index) const
pure virtual

Get the sent controls.

Parameters
indexdefine the kind of control we are looking for.
Returns
Ptr<const ScalarTimeseries> is the list of the controls sent recently.

Implemented in blmc_drivers::CanBusMotorBoard, and blmc_drivers::SpiMotorBoard.

◆ get_status()

virtual Ptr<const StatusTimeseries> blmc_drivers::MotorBoardInterface::get_status ( ) const
pure virtual

Get the status of the motor board.

Returns
Ptr<const StatusTimeseries> is the list of the last status of the card.

Implemented in blmc_drivers::CanBusMotorBoard, and blmc_drivers::SpiMotorBoard.

◆ set_command()

virtual void blmc_drivers::MotorBoardInterface::set_command ( const MotorBoardCommand command)
pure virtual

set_command save the command internally.

In order to actaully send the controls to the network please call "send_if_input_changed"

Parameters
commandis the command to be sent.

Implemented in blmc_drivers::CanBusMotorBoard, and blmc_drivers::SpiMotorBoard.

◆ set_control()

virtual void blmc_drivers::MotorBoardInterface::set_control ( const double &  control,
const int &  index 
)
pure virtual

Setters.

set_control save the control internally. In order to actaully send the controls to the network please call "send_if_input_changed"

Parameters
controlis the value of the control.
indexdefine the kind of control we want to send.

Implemented in blmc_drivers::CanBusMotorBoard, and blmc_drivers::SpiMotorBoard.


The documentation for this class was generated from the following file: