blmc_drivers
blmc_drivers::Leg Class Reference

The leg class is the implementation of the LegInterface. More...

#include <leg.hpp>

Inheritance diagram for blmc_drivers::Leg:
Collaboration diagram for blmc_drivers::Leg:

Public Member Functions

 Leg (std::shared_ptr< MotorInterface > hip_motor, std::shared_ptr< MotorInterface > knee_motor)
 Construct a new Leg object. More...
 
virtual ~Leg ()
 Destroy the Leg object.
 
virtual Ptr< const ScalarTimeseriesget_motor_measurement (const int &motor_index, const int &measurement_index) const
 Getters. More...
 
virtual Ptr< const ScalarTimeseriesget_current_target (const int &motor_index) const
 Get the actual target current. More...
 
virtual Ptr< const ScalarTimeseriesget_sent_current_target (const int &motor_index) const
 Get the last sent target current. More...
 
virtual void set_current_target (const double &current_target, const int &motor_index)
 setters ================================================================
 
virtual void send_if_input_changed ()
 sender =================================================================
 
- Public Member Functions inherited from blmc_drivers::LegInterface
virtual ~LegInterface ()
 Destroy the LegInterface object.
 

Private Attributes

std::array< std::shared_ptr< MotorInterface >, 2 > motors_
 ======================================================================== More...
 

Additional Inherited Members

- Public Types inherited from blmc_drivers::LegInterface
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...
 

Detailed Description

The leg class is the implementation of the LegInterface.

This is the decalartion and the definition of the class as it is very simple.

Constructor & Destructor Documentation

◆ Leg()

blmc_drivers::Leg::Leg ( std::shared_ptr< MotorInterface hip_motor,
std::shared_ptr< MotorInterface knee_motor 
)
inline

Construct a new Leg object.

Parameters
hip_motoris the pointer to the hip motor
knee_motoris the pointer to the knee motor

Member Function Documentation

◆ get_current_target()

virtual Ptr<const ScalarTimeseries> blmc_drivers::Leg::get_current_target ( const int &  motor_index) const
inlinevirtual

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.

Implements blmc_drivers::LegInterface.

◆ get_motor_measurement()

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

Getters.

Get the motor measurements.

Parameters
motor_index
measurement_index
Returns
Ptr<const ScalarTimeseries>

Implements blmc_drivers::LegInterface.

◆ get_sent_current_target()

virtual Ptr<const ScalarTimeseries> blmc_drivers::Leg::get_sent_current_target ( const int &  motor_index) const
inlinevirtual

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.

Implements blmc_drivers::LegInterface.

Member Data Documentation

◆ motors_

std::array<std::shared_ptr<MotorInterface>, 2> blmc_drivers::Leg::motors_
private

========================================================================

This list contains pointers to two motors. This motors are respectively the hip and the knee of the leg.


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