Class DifferentialTransmission

Inheritance Relationships

Base Type

Class Documentation

class DifferentialTransmission : public transmission_interface::Transmission

Implementation of a differential transmission.

This transmission relates two actuators and two joints through a differential mechanism, as illustrated below.

../_images/differential_transmission.png

where:

  • \( x \), \( \dot{x} \) and \( \tau \) are position, velocity and effort variables, respectively.

  • Subindices \( _a \) and \( _j \) are used to represent actuator-space and joint-space variables, respectively.

  • \( x_{off}\) represents the offset between motor and joint zeros, expressed in joint position coordinates (cf. SimpleTransmission class documentation for a more detailed description of this variable).

  • \( n \) represents a transmission ratio. Reducers/amplifiers are allowed on both the actuator and joint sides (depicted as timing belts in the figure). A transmission ratio can take any real value except zero. In particular:

    • If its absolute value is greater than one, it’s a velocity reducer / effort amplifier, while if its absolute value lies in \( (0, 1) \) it’s a velocity amplifier / effort reducer.

    • Negative values represent a direction flip, ie. input and output move in opposite directions.

    • Important: Use transmission ratio signs to match this class’ convention of positive actuator/joint directions with a given mechanical design, as they will in general not match.

Note

This implementation currently assumes a specific layout for location of the actuators and joint axes which is common in robotic mechanisms. Please file an enhancement ticket if your use case does not adhere to this layout.

Public Functions

inline DifferentialTransmission(const std::vector<double> &actuator_reduction, const std::vector<double> &joint_reduction, const std::vector<double> &joint_offset = {0.0, 0.0})
Parameters:
  • actuator_reduction[in] Reduction ratio of actuators.

  • joint_reduction[in] Reduction ratio of joints.

  • joint_offset[in] Joint position offset used in the position mappings.

Pre:

Nonzero actuator and joint reduction values.

virtual void configure(const std::vector<JointHandle> &joint_handles, const std::vector<ActuatorHandle> &actuator_handles) override
Parameters:
  • joint_handles[in] Handles of joint values.

  • actuator_handles[in] Handles of actuator values.

Pre:

Handles are valid and matching in size

inline virtual void actuator_to_joint() override

Transform variables from actuator to joint space.

Pre:

Actuator and joint vectors must have size 2 and point to valid data. To call this method it is not required that all other data vectors contain valid data, and can even remain empty.

inline virtual void joint_to_actuator() override

Transform variables from joint to actuator space.

Pre:

Actuator and joint vectors must have size 2 and point to valid data. To call this method it is not required that all other data vectors contain valid data, and can even remain empty.

inline virtual std::size_t num_actuators() const override
Returns:

Number of actuators managed by transmission, ie. the dimension of the actuator space.

inline virtual std::size_t num_joints() const override
Returns:

Number of joints managed by transmission, ie. the dimension of the joint space.

inline const std::vector<double> &get_actuator_reduction() const
inline const std::vector<double> &get_joint_reduction() const
inline const std::vector<double> &get_joint_offset() const
std::string get_handles_info() const

Get human-friendly report of handles.

Protected Attributes

std::vector<double> actuator_reduction_
std::vector<double> joint_reduction_
std::vector<double> joint_offset_
std::vector<JointHandle> joint_position_
std::vector<JointHandle> joint_velocity_
std::vector<JointHandle> joint_effort_
std::vector<ActuatorHandle> actuator_position_
std::vector<ActuatorHandle> actuator_velocity_
std::vector<ActuatorHandle> actuator_effort_