blmc_drivers
blmc_drivers::MotorInterface Class Referenceabstract

This class declares an interface to the motor. More...

#include <motor.hpp>

Inheritance diagram for blmc_drivers::MotorInterface:
Collaboration diagram for blmc_drivers::MotorInterface:

Public Types

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...
 

Public Member Functions

virtual ~MotorInterface ()
 Destroy the MotorInterface object.
 
virtual void send_if_input_changed ()=0
 Actually send the commands and controls.
 
virtual Ptr< const ScalarTimeseriesget_measurement (const int &index=0) const =0
 Getters. More...
 
virtual Ptr< const ScalarTimeseriesget_current_target () const =0
 Get the current target object. More...
 
virtual Ptr< const ScalarTimeseriesget_sent_current_target () const =0
 Get the history of the sent current targets. More...
 
virtual void set_current_target (const double &current_target)=0
 Setters. More...
 
virtual void set_command (const MotorBoardCommand &command)=0
 Set the command. More...
 

Detailed Description

This class declares an interface to the motor.

It allows the user to access the sensors data as well as sending controls. The only control supported for now is the current.

Member Typedef Documentation

◆ Ptr

template<typename Type >
using blmc_drivers::MotorInterface::Ptr = std::shared_ptr<Type>

This a useful alias for the shared Pointer creation.

Template Parameters
Typeis the Class to crate the pointer from.

Member Function Documentation

◆ get_current_target()

virtual Ptr<const ScalarTimeseries> blmc_drivers::MotorInterface::get_current_target ( ) const
pure virtual

Get the current target object.

Returns
Ptr<const ScalarTimeseries> the list of the current values to be sent.

Implemented in blmc_drivers::SafeMotor, and blmc_drivers::Motor.

◆ get_measurement()

virtual Ptr<const ScalarTimeseries> blmc_drivers::MotorInterface::get_measurement ( const int &  index = 0) const
pure virtual

Getters.

Get the measurements.

Parameters
index
Returns
Ptr<const ScalarTimeseries> the pointer to the desired measurement history.

Implemented in blmc_drivers::Motor.

◆ get_sent_current_target()

virtual Ptr<const ScalarTimeseries> blmc_drivers::MotorInterface::get_sent_current_target ( ) const
pure virtual

Get the history of the sent current targets.

Returns
Ptr<const ScalarTimeseries>

Implemented in blmc_drivers::Motor.

◆ set_command()

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

Set the command.

Save internally a command to be apply by the motor board. This function save the command internally. Please call send_if_input_changed() to actually send the data.

Parameters
command

Implemented in blmc_drivers::Motor.

◆ set_current_target()

virtual void blmc_drivers::MotorInterface::set_current_target ( const double &  current_target)
pure virtual

Setters.

Set the current target. This function saves the data internally. Please call send_if_input_changed() to actually send the data.

Parameters
current_target

Implemented in blmc_drivers::SafeMotor, and blmc_drivers::Motor.


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