ros2_control - foxy
Loading...
Searching...
No Matches
transmission_interface::DifferentialTransmission Class Reference

Implementation of a differential transmission. More...

#include <differential_transmission.hpp>

Inheritance diagram for transmission_interface::DifferentialTransmission:
Collaboration diagram for transmission_interface::DifferentialTransmission:

Public Member Functions

 DifferentialTransmission (const std::vector< double > &actuator_reduction, const std::vector< double > &joint_reduction, const std::vector< double > &joint_offset={0.0, 0.0})
void configure (const std::vector< JointHandle > &joint_handles, const std::vector< ActuatorHandle > &actuator_handles) override
void actuator_to_joint () override
 Transform variables from actuator to joint space.
void joint_to_actuator () override
 Transform variables from joint to actuator space.
std::size_t num_actuators () const override
std::size_t num_joints () const override
const std::vector< double > & get_actuator_reduction () const
const std::vector< double > & get_joint_reduction () const
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_

Detailed Description

Implementation of a differential transmission.

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

Effort
Velocity
Position
Actuator to joint

\begin{eqnarray*}\tau_{j_1} & = & n_{j_1} ( n_{a_1} \tau_{a_1} + n_{a_2} \tau_{a_2} ) \\‍[2.5em]
\tau_{j_2} & = & n_{j_2} ( n_{a_1} \tau_{a_1} + n_{a_2} \tau_{a_2} )
\end{eqnarray*}

\begin{eqnarray*}\dot{x}_{j_1} & = & \frac{ \dot{x}_{a_1} / n_{a_1} + \dot{x}_{a_2} / n_{a_2} }{2 n_{j_1}} \\‍[1em]
\dot{x}_{j_2} & = & \frac{ \dot{x}_{a_1} / n_{a_1} - \dot{x}_{a_2} / n_{a_2} }{2 n_{j_2}}
\end{eqnarray*}

\begin{eqnarray*}x_{j_1} & = & \frac{ x_{a_1} / n_{a_1} + x_{a_2} / n_{a_2} }{2 n_{j_1}}  + x_{off_1} \\‍[1em]
x_{j_2} & = & \frac{ x_{a_1} / n_{a_1} - x_{a_2} / n_{a_2} }{2 n_{j_1}}  + x_{off_2}
\end{eqnarray*}

Joint to actuator

\begin{eqnarray*}\tau_{a_1} & = & \frac{ \tau_{j_1} / n_{j_1} + \tau_{j_2} / n_{j_2} }{2 n_{a_1}} \\‍[1em]
\tau_{a_2} & = & \frac{ \tau_{j_1} / n_{j_1} - \tau_{j_2} / n_{j_2} }{2 n_{a_1}}
\end{eqnarray*}

\begin{eqnarray*}\dot{x}_{a_1} & = & n_{a_1} ( n_{j_1} \dot{x}_{j_1} + n_{j_2} \dot{x}_{j_2} ) \\‍[2.5em]
\dot{x}_{a_2} & = & n_{a_2} ( n_{j_1} \dot{x}_{j_1} - n_{j_2} \dot{x}_{j_2} )
\end{eqnarray*}

\begin{eqnarray*}x_{a_1} & = & n_{a_1} \left[ n_{j_1} (x_{j_1} - x_{off_1}) + n_{j_2} (x_{j_2} - x_{off_2}) \right] \\‍[2.5em]
x_{a_2} & = & n_{a_2} \left[ n_{j_1} (x_{j_1} - x_{off_1}) - n_{j_2} (x_{j_2} - x_{off_2}) \right]
\end{eqnarray*}

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.

Constructor & Destructor Documentation

◆ DifferentialTransmission()

transmission_interface::DifferentialTransmission::DifferentialTransmission ( const std::vector< double > & actuator_reduction,
const std::vector< double > & joint_reduction,
const std::vector< double > & joint_offset = {0.0, 0.0} )
inline
Parameters
[in]actuator_reductionReduction ratio of actuators.
[in]joint_reductionReduction ratio of joints.
[in]joint_offsetJoint position offset used in the position mappings.
Precondition
Nonzero actuator and joint reduction values.

Member Function Documentation

◆ actuator_to_joint()

void transmission_interface::DifferentialTransmission::actuator_to_joint ( )
inlineoverridevirtual

Transform variables from actuator to joint space.

Precondition
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.

Implements transmission_interface::Transmission.

◆ configure()

void transmission_interface::DifferentialTransmission::configure ( const std::vector< JointHandle > & joint_handles,
const std::vector< ActuatorHandle > & actuator_handles )
overridevirtual
Parameters
[in]joint_handlesHandles of joint values.
[in]actuator_handlesHandles of actuator values.
Precondition
Handles are valid and matching in size

Implements transmission_interface::Transmission.

◆ joint_to_actuator()

void transmission_interface::DifferentialTransmission::joint_to_actuator ( )
inlineoverridevirtual

Transform variables from joint to actuator space.

Precondition
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.

Implements transmission_interface::Transmission.

◆ num_actuators()

std::size_t transmission_interface::DifferentialTransmission::num_actuators ( ) const
inlineoverridevirtual
Returns
Number of actuators managed by transmission, ie. the dimension of the actuator space.

Implements transmission_interface::Transmission.

◆ num_joints()

std::size_t transmission_interface::DifferentialTransmission::num_joints ( ) const
inlineoverridevirtual
Returns
Number of joints managed by transmission, ie. the dimension of the joint space.

Implements transmission_interface::Transmission.


The documentation for this class was generated from the following file: