-
Notifications
You must be signed in to change notification settings - Fork 146
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
Allowing WORLD and LOCAL_WORLD_ALIGNED in ContactModel1D #1054
Changes from 3 commits
a7e87c8
31acf4a
fd58261
1fecfb4
44b65f3
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -15,24 +15,32 @@ namespace python { | |||||||||
void exposeContact1D() { | ||||||||||
bp::register_ptr_to_python<boost::shared_ptr<ContactModel1D> >(); | ||||||||||
|
||||||||||
bp::enum_<Contact1DMaskType>("Contact1DMaskType") | ||||||||||
.value("X_MASK", X_MASK) | ||||||||||
.value("Y_MASK", Y_MASK) | ||||||||||
.value("Z_MASK", Z_MASK) | ||||||||||
.export_values(); | ||||||||||
|
||||||||||
bp::class_<ContactModel1D, bp::bases<ContactModelAbstract> >( | ||||||||||
"ContactModel1D", | ||||||||||
"Rigid 1D contact model.\n\n" | ||||||||||
"It defines a rigid 1D contact model (point contact) based on acceleration-based holonomic constraints, in the " | ||||||||||
"z " | ||||||||||
"direction.\n" | ||||||||||
"x, y or z direction.\n" | ||||||||||
"The calc and calcDiff functions compute the contact Jacobian and drift (holonomic constraint) or\n" | ||||||||||
"the derivatives of the holonomic constraint, respectively.", | ||||||||||
bp::init<boost::shared_ptr<StateMultibody>, pinocchio::FrameIndex, double, std::size_t, | ||||||||||
bp::optional<Eigen::Vector2d> >( | ||||||||||
bp::args("self", "state", "id", "xref", "nu", "gains"), | ||||||||||
bp::optional<Eigen::Vector2d, Contact1DMaskType, pinocchio::ReferenceFrame> >( | ||||||||||
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. You will need to adapt the code as now the class is 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. You will need to adapt the code as now the class is |
||||||||||
bp::args("self", "state", "id", "xref", "nu", "gains", "mask", "type"), | ||||||||||
"Initialize the contact model.\n\n" | ||||||||||
":param state: state of the multibody system\n" | ||||||||||
":param id: reference frame id of the contact\n" | ||||||||||
":param xref: contact position used for the Baumgarte stabilization\n" | ||||||||||
":param nu: dimension of control vector\n" | ||||||||||
":param gains: gains of the contact model (default np.matrix([0.,0.]))")) | ||||||||||
.def(bp::init<boost::shared_ptr<StateMultibody>, pinocchio::FrameIndex, double, bp::optional<Eigen::Vector2d> >( | ||||||||||
":param gains: gains of the contact model (default np.matrix([0.,0.]))\n" | ||||||||||
":param mask: axis of the contact constraint (0=x, 1=y or 2=z)\n" | ||||||||||
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.
Suggested change
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.
Suggested change
|
||||||||||
":param type: reference type of contact")) | ||||||||||
.def(bp::init<boost::shared_ptr<StateMultibody>, pinocchio::FrameIndex, double, | ||||||||||
bp::optional<Eigen::Vector2d, pinocchio::ReferenceFrame> >( | ||||||||||
bp::args("self", "state", "id", "xref", "gains"), | ||||||||||
"Initialize the contact model.\n\n" | ||||||||||
":param state: state of the multibody system\n" | ||||||||||
|
@@ -68,7 +76,13 @@ void exposeContact1D() { | |||||||||
&ContactModel1D::set_reference, "reference contact translation") | ||||||||||
.add_property("gains", | ||||||||||
bp::make_function(&ContactModel1D::get_gains, bp::return_value_policy<bp::return_by_value>()), | ||||||||||
"contact gains"); | ||||||||||
"contact gains") | ||||||||||
.add_property("mask", | ||||||||||
bp::make_function(&ContactModel1D::get_mask, bp::return_value_policy<bp::return_by_value>()), | ||||||||||
&ContactModel1D::set_mask, "mask") | ||||||||||
.add_property("type", | ||||||||||
bp::make_function(&ContactModel1D::get_type, bp::return_value_policy<bp::return_by_value>()), | ||||||||||
&ContactModel1D::set_type, "type"); | ||||||||||
|
||||||||||
bp::register_ptr_to_python<boost::shared_ptr<ContactData1D> >(); | ||||||||||
|
||||||||||
|
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.
Let's make this class a bit more generic.