-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mimic constraint feature #431
Changes from 25 commits
5080bed
6584c4c
0cf04bd
e862d37
89baee9
845c076
ab64ba4
efe14ff
44848b7
1bb3239
5f53cb7
4ce9d72
1317a6d
943740c
87e8de3
4dd1b21
3e123fb
4f19f38
e6b6b6e
c845bfb
1a3d345
1fbeed2
5d3ec50
6a0294b
0b4f490
484abc4
6878701
d7f552f
a7e4513
df5fd98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,8 @@ | |
#include <gz/physics/FrameSemantics.hh> | ||
#include <gz/physics/Geometry.hh> | ||
|
||
#include <string> | ||
|
||
namespace gz | ||
{ | ||
namespace physics | ||
|
@@ -584,6 +586,46 @@ namespace gz | |
}; | ||
}; | ||
|
||
///////////////////////////////////////////////// | ||
/// \brief This feature sets the mimic constraint for this Joint. | ||
class GZ_PHYSICS_VISIBLE SetMimicConstraintFeature | ||
: public virtual Feature | ||
{ | ||
/// \brief The Joint API for setting the mimic joint constraint. | ||
/// \param[in] _joint | ||
/// name of the joint to be mimicked, i.e. the leader joint. | ||
/// \param[in] _multiplier | ||
/// The multiplier to be applied to poistion of leader joint. | ||
/// \param[in] _offset | ||
/// The offset to be applied to position of leader joint after | ||
/// the multiplier is applied. | ||
public: template <typename PolicyT, typename FeaturesT> | ||
class Joint : public virtual Feature::Joint<PolicyT, FeaturesT> | ||
{ | ||
public: using Scalar = typename PolicyT::Scalar; | ||
|
||
public: void SetMimicConstraint( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
const std::string _joint, | ||
const std::string _axis, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use const references for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
Scalar _multiplier, | ||
Scalar _offset, | ||
Scalar _reference); | ||
}; | ||
|
||
/// \private The implementation API for setting the mimic constraint. | ||
public: template <typename PolicyT> | ||
class Implementation : public virtual Feature::Implementation<PolicyT> | ||
{ | ||
public: using Scalar = typename PolicyT::Scalar; | ||
|
||
// See Joint::MimicConstraint above | ||
public: virtual void SetJointMimicConstraint( | ||
const Identity &_id, | ||
const std::string _joint, | ||
const std::string _axis, | ||
Scalar _multiplier, Scalar _offset, Scalar _reference) = 0; | ||
}; | ||
}; | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6878701