blmc_drivers
blmc_drivers::LegInterface Class Referenceabstract

This class defines an interface to control a leg. More...

#include <leg.hpp>

Inheritance diagram for blmc_drivers::LegInterface:
Collaboration diagram for blmc_drivers::LegInterface:

Public Types

enum  MotorMeasurementIndexing {
  current, position, velocity, encoder_index,
  motor_measurement_count
}
 MotorMeasurementIndexing this enum allow to access the different kind of sensor measurements in an understandable way in the code.
 
enum  MotorIndexing { hip, knee, motor_count }
 This enum list the motors in the leg.
 
typedef real_time_tools::ThreadsafeTimeseries< double > ScalarTimeseries
 ScalarTimeseries is a simple shortcut for more intelligible code.
 
template<typename Type >
using Ptr = std::shared_ptr< Type >
 This is a shortcut for creating shared pointer in a simpler writting expression. More...
 

Public Member Functions

virtual ~LegInterface ()
 Destroy the LegInterface object.
 
virtual Ptr< const ScalarTimeseriesget_motor_measurement (const int &motor_index, const int &measurement_index) const =0
 Getters. More...
 
virtual Ptr< const ScalarTimeseriesget_current_target (const int &motor_index) const =0
 Get the actual target current. More...
 
virtual Ptr< const ScalarTimeseriesget_sent_current_target (const int &motor_index) const =0
 Get the last sent target current. More...
 
virtual void set_current_target (const double &current_target, const int &motor_index)=0
 Setters. More...
 
virtual void send_if_input_changed ()=0
 Sender. More...
 

Detailed Description

This class defines an interface to control a leg.

This legg is composed of 2 motor, one for the hip and one for the knee.

Member Typedef Documentation

◆ Ptr

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

This is a shortcut for creating shared pointer in a simpler writting expression.

Template Parameters
Typeis the template paramer of the shared pointer.

Member Function Documentation

◆ get_current_target()

virtual Ptr<const ScalarTimeseries> blmc_drivers::LegInterface::get_current_target ( const int &  motor_index) const
pure virtual

Get the actual target current.

Parameters
[in]motor_indexdesignate the motor from which we want the data from.
Returns
Ptr<const ScalarTimeseries> is the list of the lasts time stamped acquiered.

Implemented in blmc_drivers::Leg.

◆ get_motor_measurement()

virtual Ptr<const ScalarTimeseries> blmc_drivers::LegInterface::get_motor_measurement ( const int &  motor_index,
const int &  measurement_index 
) const
pure virtual

Getters.

Get the device output

Parameters
[in]motor_indexdesignate the motor from which we want the data from.
[in]measurement_indexis teh kind of data we are looking for.
Returns
Ptr<const ScalarTimeseries> is the list of the lasts time stamped acquiered.

Implemented in blmc_drivers::Leg.

◆ get_sent_current_target()

virtual Ptr<const ScalarTimeseries> blmc_drivers::LegInterface::get_sent_current_target ( const int &  motor_index) const
pure virtual

Get the last sent target current.

Parameters
[in]motor_indexdesignate the motor from which we want the data from.
Returns
Ptr<const ScalarTimeseries> is the list of the lasts time stamped acquiered.

Implemented in blmc_drivers::Leg.

◆ send_if_input_changed()

virtual void blmc_drivers::LegInterface::send_if_input_changed ( )
pure virtual

Sender.

Actually send the target current to the motor cards.

Implemented in blmc_drivers::Leg.

◆ set_current_target()

virtual void blmc_drivers::LegInterface::set_current_target ( const double &  current_target,
const int &  motor_index 
)
pure virtual

Setters.

Set the current target saves internally the desired current. This data is not send to the motor yet. Please call send_if_input_changed in order to actually send the data to the card.

Parameters
current_targetis the current to achieve on the motor card.
motor_indexis the motor to control.

Implemented in blmc_drivers::Leg.


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