Loading...
Searching...
No Matches
Public Member Functions | List of all members
sdf::SDF_VERSION_NAMESPACE::MimicConstraint Class Reference

Helper class to hold contents of a joint axis mimic tag, which define a Mimic constraint. More...

#include <JointAxis.hh>

Public Member Functions

 MimicConstraint (const std::string &_joint="", const std::string &_axis="axis", double _multiplier=0.0, double _offset=0.0, double _reference=0.0)
 Constructor with arguments.
 
const std::string & Axis () const
 Retrieve the name of the leader axis, either "axis" or "axis2".
 
const std::string & Joint () const
 Retrieve the name of the leader joint.
 
double Multiplier () const
 Retrieve the multiplier parameter, which represents the ratio between changes in the follower position relative to changes in the leader position.
 
double Offset () const
 Retrieve the offset to the follower position in the linear constraint.
 
double Reference () const
 Retrieve the reference for the leader position before applying the multiplier in the linear constraint.
 
void SetAxis (const std::string &_axis)
 Set the leader axis name, either "axis" or "axis2".
 
void SetJoint (const std::string &_joint)
 Set the leader joint name.
 
void SetMultiplier (double _multiplier)
 Set the multiplier parameter, which represents the ratio between changes in the follower position relative to changes in the leader position.
 
void SetOffset (double _offset)
 Set the offset to the follower position in the linear constraint.
 
void SetReference (double _reference)
 Set the reference for the leader position before applying the multiplier in the linear constraint.
 

Detailed Description

Helper class to hold contents of a joint axis mimic tag, which define a Mimic constraint.

A Mimic constraint encodes a linear relationship between the position of two joint axes. One joint axis is labelled as the leader and the other as the follower. The multiplier, offset, and reference parameters determine the linear relationship according to the following equation:

follower_position = multiplier * (leader_position - reference) + offset

Constructor & Destructor Documentation

◆ MimicConstraint()

sdf::SDF_VERSION_NAMESPACE::MimicConstraint::MimicConstraint ( const std::string &  _joint = "",
const std::string &  _axis = "axis",
double  _multiplier = 0.0,
double  _offset = 0.0,
double  _reference = 0.0 
)

Constructor with arguments.

Parameters
[in]_jointName of Joint containing the leader axis.
[in]_axisName of the leader axis, either "axis" or "axis2".
[in]_multiplierMultiplier parameter, which represents the ratio between changes in the follower position relative to changes in the leader position.
[in]_offsetOffset to the follower position in the linear constraint.
[in]_referenceReference for the leader position before applying the multiplier in the linear constraint.

Member Function Documentation

◆ Axis()

const std::string & sdf::SDF_VERSION_NAMESPACE::MimicConstraint::Axis ( ) const

Retrieve the name of the leader axis, either "axis" or "axis2".

Returns
Name of the leader axis.

◆ Joint()

const std::string & sdf::SDF_VERSION_NAMESPACE::MimicConstraint::Joint ( ) const

Retrieve the name of the leader joint.

Returns
Name of the joint containing the leader axis.

◆ Multiplier()

double sdf::SDF_VERSION_NAMESPACE::MimicConstraint::Multiplier ( ) const

Retrieve the multiplier parameter, which represents the ratio between changes in the follower position relative to changes in the leader position.

Returns
Multiplier for the Mimic constraint.

◆ Offset()

double sdf::SDF_VERSION_NAMESPACE::MimicConstraint::Offset ( ) const

Retrieve the offset to the follower position in the linear constraint.

Returns
Offset for the Mimic constraint.

◆ Reference()

double sdf::SDF_VERSION_NAMESPACE::MimicConstraint::Reference ( ) const

Retrieve the reference for the leader position before applying the multiplier in the linear constraint.

Parameters
[in]_referenceReference for the Mimic constraint.

◆ SetAxis()

void sdf::SDF_VERSION_NAMESPACE::MimicConstraint::SetAxis ( const std::string &  _axis)

Set the leader axis name, either "axis" or "axis2".

Parameters
[in]_axisName of the leader axis.

◆ SetJoint()

void sdf::SDF_VERSION_NAMESPACE::MimicConstraint::SetJoint ( const std::string &  _joint)

Set the leader joint name.

Parameters
[in]_jointName of the the joint containing the leader axis.

◆ SetMultiplier()

void sdf::SDF_VERSION_NAMESPACE::MimicConstraint::SetMultiplier ( double  _multiplier)

Set the multiplier parameter, which represents the ratio between changes in the follower position relative to changes in the leader position.

Parameters
[in]_multiplierMultiplier for the Mimic constraint.

◆ SetOffset()

void sdf::SDF_VERSION_NAMESPACE::MimicConstraint::SetOffset ( double  _offset)

Set the offset to the follower position in the linear constraint.

Parameters
[in]_offsetOffset for the Mimic constraint.

◆ SetReference()

void sdf::SDF_VERSION_NAMESPACE::MimicConstraint::SetReference ( double  _reference)

Set the reference for the leader position before applying the multiplier in the linear constraint.

Parameters
[in]_referenceReference for the Mimic constraint.

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