Class blmc_drivers::MotorInterface

class MotorInterface : public blmc_drivers::DeviceInterface, public blmc_drivers::DeviceInterface

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.

Subclassed by blmc_drivers::Motor, blmc_drivers::Motor

Public Types

enum MeasurementIndex

Here is a list of the different measurement available on the blmc card.

Values:

enumerator current
enumerator position
enumerator velocity
enumerator encoder_index
enumerator measurement_count
enumerator current
enumerator position
enumerator velocity
enumerator encoder_index
enumerator measurement_count
enum MeasurementIndex

Here is a list of the different measurement available on the blmc card.

Values:

enumerator current
enumerator position
enumerator velocity
enumerator encoder_index
enumerator measurement_count
enumerator current
enumerator position
enumerator velocity
enumerator encoder_index
enumerator measurement_count
typedef time_series::TimeSeries<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.

Template Parameters:

Type – is the Class to crate the pointer from.

typedef time_series::TimeSeries<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.

Template Parameters:

Type – is the Class to crate the pointer from.

Public Functions

inline virtual ~MotorInterface()

Destroy the MotorInterface object.

virtual void send_if_input_changed() = 0

Actually send the commands and controls.

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

Getters.

Get the measurements.

Parameters:

index

Returns:

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

virtual Ptr<const ScalarTimeseries> get_current_target() const = 0

Get the current target object.

Returns:

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

virtual Ptr<const ScalarTimeseries> get_sent_current_target() const = 0

Get the history of the sent current targets.

Returns:

Ptr<const ScalarTimeseries>

virtual void set_current_target(const double &current_target) = 0

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

virtual void set_command(const MotorBoardCommand &command) = 0

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

inline virtual ~MotorInterface()

Destroy the MotorInterface object.

virtual void send_if_input_changed() = 0

Actually send the commands and controls.

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

Getters.

Get the measurements.

Parameters:

index

Returns:

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

virtual Ptr<const ScalarTimeseries> get_current_target() const = 0

Get the current target object.

Returns:

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

virtual Ptr<const ScalarTimeseries> get_sent_current_target() const = 0

Get the history of the sent current targets.

Returns:

Ptr<const ScalarTimeseries>

virtual void set_current_target(const double &current_target) = 0

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

virtual void set_command(const MotorBoardCommand &command) = 0

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