blmc_drivers
blmc_drivers::Motor Class Reference

This class implements the MotorInterface. More...

#include <motor.hpp>

Inheritance diagram for blmc_drivers::Motor:
Collaboration diagram for blmc_drivers::Motor:

Public Member Functions

 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 ScalarTimeseriesget_measurement (const int &index=0) const
 Getters. More...
 
virtual Ptr< const ScalarTimeseriesget_current_target () const
 Get the current target to be sent. More...
 
virtual Ptr< const ScalarTimeseriesget_sent_current_target () const
 Get the already sent current target values. More...
 
virtual void set_current_target (const double &current_target)
 Setters. More...
 
virtual void set_command (const MotorBoardCommand &command)
 Set the command. More...
 
virtual void print () const
 Print the motor status and state. More...
 
- Public Member Functions inherited from blmc_drivers::MotorInterface
virtual ~MotorInterface ()
 Destroy the MotorInterface object.
 

Protected Attributes

Ptr< MotorBoardInterfaceboard_
 The MotorBoard to be used for the communication.
 
bool motor_id_
 The id of the motor on the MotorBoard.
 

Additional Inherited Members

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

Detailed Description

This class implements the MotorInterface.

Constructor & Destructor Documentation

◆ Motor()

blmc_drivers::Motor::Motor ( Ptr< MotorBoardInterface board,
bool  motor_id 
)

Construct a new Motor object.

Parameters
boardis the MotorBoard to be used.
motor_idis the id of the motor on the on-board card

◆ ~Motor()

virtual blmc_drivers::Motor::~Motor ( )
inlinevirtual

Destroy the Motor object.

Member Function Documentation

◆ get_current_target()

Motor::Ptr< const Motor::ScalarTimeseries > blmc_drivers::Motor::get_current_target ( ) const
virtual

Get the current target to be sent.

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

Implements blmc_drivers::MotorInterface.

Reimplemented in blmc_drivers::SafeMotor.

◆ get_measurement()

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

Getters.

Get the measurements

Parameters
indexis the kind of measurement we are instersted in. see MotorInterface::MeasurementIndex.
Returns
Ptr<const ScalarTimeseries> The history of the measurement

Implements blmc_drivers::MotorInterface.

◆ get_sent_current_target()

Motor::Ptr< const Motor::ScalarTimeseries > blmc_drivers::Motor::get_sent_current_target ( ) const
virtual

Get the already sent current target values.

Returns
Ptr<const ScalarTimeseries>

Implements blmc_drivers::MotorInterface.

◆ print()

void blmc_drivers::Motor::print ( ) const
virtual

Print the motor status and state.

◆ set_command()

virtual void blmc_drivers::Motor::set_command ( const MotorBoardCommand command)
inlinevirtual

Set the command.

See MotorInterface for more information.

Parameters
command

Implements blmc_drivers::MotorInterface.

◆ set_current_target()

void blmc_drivers::Motor::set_current_target ( const double &  current_target)
virtual

Setters.

Set the current (Ampere) target. See MotorInterface for more information.

Parameters
current_targetin Ampere

Implements blmc_drivers::MotorInterface.

Reimplemented in blmc_drivers::SafeMotor.


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