Class blmc_drivers::MotorBoardInterface

class MotorBoardInterface : public blmc_drivers::DeviceInterface, public blmc_drivers::DeviceInterface

MotorBoardInterface declares an API to inacte with a MotorBoard.

Subclassed by blmc_drivers::CanBusMotorBoard, blmc_drivers::CanBusMotorBoard

Public Types

enum MeasurementIndex

This is the list of the measurement we can access.

Values:

enumerator current_0
enumerator current_1
enumerator position_0
enumerator position_1
enumerator velocity_0
enumerator velocity_1
enumerator analog_0
enumerator analog_1
enumerator encoder_index_0
enumerator encoder_index_1
enumerator measurement_count
enumerator current_0
enumerator current_1
enumerator position_0
enumerator position_1
enumerator velocity_0
enumerator velocity_1
enumerator analog_0
enumerator analog_1
enumerator encoder_index_0
enumerator encoder_index_1
enumerator measurement_count
enum ControlIndex

This is the list of the controls we can send.

Values:

enumerator current_target_0
enumerator current_target_1
enumerator control_count
enumerator current_target_0
enumerator current_target_1
enumerator control_count
enum MeasurementIndex

This is the list of the measurement we can access.

Values:

enumerator current_0
enumerator current_1
enumerator position_0
enumerator position_1
enumerator velocity_0
enumerator velocity_1
enumerator analog_0
enumerator analog_1
enumerator encoder_index_0
enumerator encoder_index_1
enumerator measurement_count
enumerator current_0
enumerator current_1
enumerator position_0
enumerator position_1
enumerator velocity_0
enumerator velocity_1
enumerator analog_0
enumerator analog_1
enumerator encoder_index_0
enumerator encoder_index_1
enumerator measurement_count
enum ControlIndex

This is the list of the controls we can send.

Values:

enumerator current_target_0
enumerator current_target_1
enumerator control_count
enumerator current_target_0
enumerator current_target_1
enumerator control_count
typedef time_series::TimeSeries<double> ScalarTimeseries

A useful shortcut.

typedef time_series::Index Index

A useful shortcut.

typedef time_series::TimeSeries<Index> IndexTimeseries

A useful shortcut.

typedef time_series::TimeSeries<MotorBoardStatus> StatusTimeseries

A useful shortcut.

typedef time_series::TimeSeries<MotorBoardCommand> CommandTimeseries

A useful shortcut.

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

A useful shortcut.

template<typename Type>
using Vector = std::vector<Type>

A useful shortcut.

typedef time_series::TimeSeries<double> ScalarTimeseries

A useful shortcut.

typedef time_series::Index Index

A useful shortcut.

typedef time_series::TimeSeries<Index> IndexTimeseries

A useful shortcut.

typedef time_series::TimeSeries<MotorBoardStatus> StatusTimeseries

A useful shortcut.

typedef time_series::TimeSeries<MotorBoardCommand> CommandTimeseries

A useful shortcut.

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

A useful shortcut.

template<typename Type>
using Vector = std::vector<Type>

A useful shortcut.

Public Functions

inline virtual ~MotorBoardInterface()

Destroy the MotorBoardInterface object.

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

Getters.

Get the measurements

Parameters:

index – is the kind of measurement we are looking for.

Returns:

Ptr<const ScalarTimeseries> is the list of the last time stamped measurement acquiered.

virtual Ptr<const StatusTimeseries> get_status() const = 0

Get the status of the motor board.

Returns:

Ptr<const StatusTimeseries> is the list of the last status of the card.

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

input logs

Get the controls to be send.

Parameters:

index – define the kind of control we are looking for.

Returns:

Ptr<const ScalarTimeseries> is the list of the controls to be send.

virtual Ptr<const CommandTimeseries> get_command() const = 0

Get the commands to be send.

Returns:

Ptr<const CommandTimeseries> is the list of the commands to be send.

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

Get the sent controls.

Parameters:

index – define the kind of control we are looking for.

Returns:

Ptr<const ScalarTimeseries> is the list of the controls sent recently.

virtual Ptr<const CommandTimeseries> get_sent_command() const = 0

Get the sent commands.

Returns:

Ptr<const CommandTimeseries> is the list of the commands sent recently.

virtual void set_control(const double &control, const int &index) = 0

Setters.

set_control save the control internally. In order to actaully send the controls to the network please call “send_if_input_changed”

Parameters:
  • control – is the value of the control.

  • index – define the kind of control we want to send.

virtual void set_command(const MotorBoardCommand &command) = 0

set_command save the command internally.

In order to actaully send the controls to the network please call “send_if_input_changed”

Parameters:

command – is the command to be sent.

virtual void send_if_input_changed() = 0

Actually send the commands and the controls.

inline virtual ~MotorBoardInterface()

Destroy the MotorBoardInterface object.

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

Getters.

Get the measurements

Parameters:

index – is the kind of measurement we are looking for.

Returns:

Ptr<const ScalarTimeseries> is the list of the last time stamped measurement acquiered.

virtual Ptr<const StatusTimeseries> get_status() const = 0

Get the status of the motor board.

Returns:

Ptr<const StatusTimeseries> is the list of the last status of the card.

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

input logs

Get the controls to be send.

Parameters:

index – define the kind of control we are looking for.

Returns:

Ptr<const ScalarTimeseries> is the list of the controls to be send.

virtual Ptr<const CommandTimeseries> get_command() const = 0

Get the commands to be send.

Returns:

Ptr<const CommandTimeseries> is the list of the commands to be send.

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

Get the sent controls.

Parameters:

index – define the kind of control we are looking for.

Returns:

Ptr<const ScalarTimeseries> is the list of the controls sent recently.

virtual Ptr<const CommandTimeseries> get_sent_command() const = 0

Get the sent commands.

Returns:

Ptr<const CommandTimeseries> is the list of the commands sent recently.

virtual void set_control(const double &control, const int &index) = 0

Setters.

set_control save the control internally. In order to actaully send the controls to the network please call “send_if_input_changed”

Parameters:
  • control – is the value of the control.

  • index – define the kind of control we want to send.

virtual void set_command(const MotorBoardCommand &command) = 0

set_command save the command internally.

In order to actaully send the controls to the network please call “send_if_input_changed”

Parameters:

command – is the command to be sent.

virtual void send_if_input_changed() = 0

Actually send the commands and the controls.