Class solo::SpiJointModules

template<int COUNT>
class SpiJointModules

This class defines an interface to a collection of BLMC joints.

It creates a BLMCJointModule for every blmc_driver::MotorInterface provided.

Public Types

typedef Eigen::Matrix<double, COUNT, 1> Vector

Defines a static Eigen vector type in order to define the interface.

typedef Eigen::Matrix<double, COUNT, 1> Vector

Defines a static Eigen vector type in order to define the interface.

Public Functions

inline SpiJointModules(std::shared_ptr<MasterBoardInterface> robot_if, std::array<int, COUNT> &motor_to_card_index, std::array<int, COUNT> &motor_to_card_port_index, const Vector &motor_constants, const Vector &gear_ratios, const Vector &zero_angles, const Vector &max_currents, std::array<bool, COUNT> reverse_polarities)

Construct a new SpiJointModules object.

inline void enable()

Enable all motors and motor drivers used by the joint module.

inline bool is_ready()

Checks if all motors report ready.

Returns:

True if all motors are ready, false otherwise.

inline std::array<bool, COUNT> get_motor_enabled()
inline std::array<bool, COUNT> get_motor_ready()
inline void send_torques()

Send the registered torques to all modules.

inline void acquire_sensors()

Updates the measurements based on the lastest package from the master board.

inline void set_torques(const Vector &desired_torques)

Register the joint torques to be sent for all modules.

Parameters:

desired_torques – (Nm)

inline Vector get_max_torques()

Get the maximum admissible joint torque that can be applied.

Returns:

Vector (N/m)

inline Vector get_sent_torques() const

Get the previously sent torques.

Returns:

Vector (Nm)

inline Vector get_measured_torques() const

Get the measured joint torques.

Returns:

Vector (Nm)

inline Vector get_measured_angles() const

Get the measured joint angles.

Returns:

Vector (rad)

inline Vector get_measured_velocities() const

Get the measured joint velocities.

Returns:

Vector (rad/s)

inline void set_zero_angles(const Vector &zero_angles)

Set the zero_angles.

These are the joint angles between the starting pose and the zero theoretical pose of the urdf.

Parameters:

zero_angles – (rad)

inline Vector get_zero_angles() const

Get the zero_angles.

These are the joint angles between the starting pose and the zero theoretical pose of the urdf.

Returns:

Vector (rad)

inline Vector get_measured_index_angles() const

Get the index_angles.

There is one index per motor rotation so there are gear_ratio indexes per joint rotation.

Returns:

Vector (rad)

inline SpiJointModules(std::shared_ptr<MasterBoardInterface> robot_if, std::array<int, COUNT> &motor_to_card_index, std::array<int, COUNT> &motor_to_card_port_index, const Vector &motor_constants, const Vector &gear_ratios, const Vector &zero_angles, const Vector &max_currents, std::array<bool, COUNT> reverse_polarities)

Construct a new SpiJointModules object.

inline void enable()

Enable all motors and motor drivers used by the joint module.

inline bool is_ready()

Checks if all motors report ready.

Returns:

True if all motors are ready, false otherwise.

inline std::array<bool, COUNT> get_motor_enabled()
inline std::array<bool, COUNT> get_motor_ready()
inline void send_torques()

Send the registered torques to all modules.

inline void acquire_sensors()

Updates the measurements based on the lastest package from the master board.

inline void set_torques(const Vector &desired_torques)

Register the joint torques to be sent for all modules.

Parameters:

desired_torques – (Nm)

inline Vector get_max_torques()

Get the maximum admissible joint torque that can be applied.

Returns:

Vector (N/m)

inline Vector get_sent_torques() const

Get the previously sent torques.

Returns:

Vector (Nm)

inline Vector get_measured_torques() const

Get the measured joint torques.

Returns:

Vector (Nm)

inline Vector get_measured_angles() const

Get the measured joint angles.

Returns:

Vector (rad)

inline Vector get_measured_velocities() const

Get the measured joint velocities.

Returns:

Vector (rad/s)

inline void set_zero_angles(const Vector &zero_angles)

Set the zero_angles.

These are the joint angles between the starting pose and the zero theoretical pose of the urdf.

Parameters:

zero_angles – (rad)

inline Vector get_zero_angles() const

Get the zero_angles.

These are the joint angles between the starting pose and the zero theoretical pose of the urdf.

Returns:

Vector (rad)

inline Vector get_measured_index_angles() const

Get the index_angles.

There is one index per motor rotation so there are gear_ratio indexes per joint rotation.

Returns:

Vector (rad)