Class blmc_drivers::CanBusMotorBoard

class CanBusMotorBoard : public blmc_drivers::MotorBoardInterface, public blmc_drivers::MotorBoardInterface

This class CanBusMotorBoard implements a MotorBoardInterface specific to CAN networks.

Public Functions

CanBusMotorBoard(std::shared_ptr<CanBusInterface> can_bus, const size_t &history_length = 1000, const int &control_timeout_ms = 100)

Construct a new CanBusMotorBoard object.

Parameters:
  • can_bus

  • history_length

~CanBusMotorBoard()

Destroy the CanBusMotorBoard object.

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

Getters.

Get the measurement data.

Parameters:

index – is the kind of measurement we are insterested in.

Returns:

Ptr<const ScalarTimeseries> is the list of the last measurements acquiered from the CAN card.

inline virtual Ptr<const StatusTimeseries> get_status() const

Get the status of the CAN card.

Returns:

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

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

Get the controls to be sent.

Parameters:

index – the kind of control we are interested in.

Returns:

Ptr<const ScalarTimeseries> is the list of the control to be sent.

inline virtual Ptr<const CommandTimeseries> get_command() const

Get the commands to be sent.

Returns:

Ptr<const CommandTimeseries> is the list of the command to be sent.

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

Get the already sent controls.

Parameters:

index – the kind of control we are interested in.

Returns:

Ptr<const ScalarTimeseries> is the list of the sent cotnrols.

inline virtual Ptr<const CommandTimeseries> get_sent_command() const

Get the already sent commands.

Returns:

Ptr<const CommandTimeseries> is the list of the sent cotnrols.

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

Setters.

Set the controls, see MotorBoardInterface::set_control

Parameters:
  • control

  • index

inline virtual void set_command(const MotorBoardCommand &command)

Set the commands, see MotorBoardInterface::set_command.

Parameters:

command

virtual void send_if_input_changed()

Send the actual command and controls.

void wait_until_ready()

returns only once board and motors are ready.

bool is_ready()
void pause_motors()

Todo:

: this function should go away, and we should add somewhere a warning in case there is a timeout

void disable_can_recv_timeout()

Disable the can reciever timeout.

CanBusMotorBoard(std::shared_ptr<CanBusInterface> can_bus, const size_t &history_length = 1000, const int &control_timeout_ms = 100)

Construct a new CanBusMotorBoard object.

Parameters:
  • can_bus

  • history_length

~CanBusMotorBoard()

Destroy the CanBusMotorBoard object.

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

Getters.

Get the measurement data.

Parameters:

index – is the kind of measurement we are insterested in.

Returns:

Ptr<const ScalarTimeseries> is the list of the last measurements acquiered from the CAN card.

inline virtual Ptr<const StatusTimeseries> get_status() const

Get the status of the CAN card.

Returns:

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

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

Get the controls to be sent.

Parameters:

index – the kind of control we are interested in.

Returns:

Ptr<const ScalarTimeseries> is the list of the control to be sent.

inline virtual Ptr<const CommandTimeseries> get_command() const

Get the commands to be sent.

Returns:

Ptr<const CommandTimeseries> is the list of the command to be sent.

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

Get the already sent controls.

Parameters:

index – the kind of control we are interested in.

Returns:

Ptr<const ScalarTimeseries> is the list of the sent cotnrols.

inline virtual Ptr<const CommandTimeseries> get_sent_command() const

Get the already sent commands.

Returns:

Ptr<const CommandTimeseries> is the list of the sent cotnrols.

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

Setters.

Set the controls, see MotorBoardInterface::set_control

Parameters:
  • control

  • index

inline virtual void set_command(const MotorBoardCommand &command)

Set the commands, see MotorBoardInterface::set_command.

Parameters:

command

virtual void send_if_input_changed()

Send the actual command and controls.

void wait_until_ready()

returns only once board and motors are ready.

bool is_ready()
void pause_motors()

Todo:

: this function should go away, and we should add somewhere a warning in case there is a timeout

void disable_can_recv_timeout()

Disable the can reciever timeout.