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. More... | |
const std::string & | Axis () const |
Retrieve the name of the leader axis, either "axis" or "axis2". More... | |
const std::string & | Joint () const |
Retrieve the name of the leader joint. More... | |
double | Multiplier () const |
Retrieve the multiplier parameter, which represents the ratio between changes in the follower position relative to changes in the leader position. More... | |
double | Offset () const |
Retrieve the offset to the follower position in the linear constraint. More... | |
double | Reference () const |
Retrieve the reference for the leader position before applying the multiplier in the linear constraint. More... | |
void | SetAxis (const std::string &_axis) |
Set the leader axis name, either "axis" or "axis2". More... | |
void | SetJoint (const std::string &_joint) |
Set the leader joint name. More... | |
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. More... | |
void | SetOffset (double _offset) |
Set the offset to the follower position in the linear constraint. More... | |
void | SetReference (double _reference) |
Set the reference for the leader position before applying the multiplier in the linear constraint. More... | |
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
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.
[in] | _joint | Name of Joint containing the leader axis. |
[in] | _axis | Name of the leader axis, either "axis" or "axis2". |
[in] | _multiplier | Multiplier parameter, which represents the ratio between changes in the follower position relative to changes in the leader position. |
[in] | _offset | Offset to the follower position in the linear constraint. |
[in] | _reference | Reference for the leader position before applying the multiplier in the linear constraint. |
const std::string & sdf::SDF_VERSION_NAMESPACE::MimicConstraint::Axis | ( | ) | const |
Retrieve the name of the leader axis, either "axis" or "axis2".
const std::string & sdf::SDF_VERSION_NAMESPACE::MimicConstraint::Joint | ( | ) | const |
Retrieve the name of the leader joint.
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.
double sdf::SDF_VERSION_NAMESPACE::MimicConstraint::Offset | ( | ) | const |
Retrieve the offset to the follower position in the linear constraint.
double sdf::SDF_VERSION_NAMESPACE::MimicConstraint::Reference | ( | ) | const |
Retrieve the reference for the leader position before applying the multiplier in the linear constraint.
[in] | _reference | Reference for the Mimic constraint. |
void sdf::SDF_VERSION_NAMESPACE::MimicConstraint::SetAxis | ( | const std::string & | _axis | ) |
Set the leader axis name, either "axis" or "axis2".
[in] | _axis | Name of the leader axis. |
void sdf::SDF_VERSION_NAMESPACE::MimicConstraint::SetJoint | ( | const std::string & | _joint | ) |
Set the leader joint name.
[in] | _joint | Name of the the joint containing the leader axis. |
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.
[in] | _multiplier | Multiplier for the Mimic constraint. |
void sdf::SDF_VERSION_NAMESPACE::MimicConstraint::SetOffset | ( | double | _offset | ) |
Set the offset to the follower position in the linear constraint.
[in] | _offset | Offset for the Mimic constraint. |
void sdf::SDF_VERSION_NAMESPACE::MimicConstraint::SetReference | ( | double | _reference | ) |
Set the reference for the leader position before applying the multiplier in the linear constraint.
[in] | _reference | Reference for the Mimic constraint. |