Skip to content

Commit

Permalink
[pinocchio] Do not expose model anymore.
Browse files Browse the repository at this point in the history
  Model is now exposed by pinocchio python module.
  • Loading branch information
florent-lamiraux committed Jan 17, 2025
1 parent 4494764 commit a6e634a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 85 deletions.
1 change: 0 additions & 1 deletion src/pyhpp/pinocchio/bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ BOOST_PYTHON_MODULE(bindings) {

boost::python::import("pinocchio");

pyhpp::pinocchio::exposeModel();
pyhpp::pinocchio::exposeDevice();
pyhpp::pinocchio::exposeLiegroup();
}
84 changes: 0 additions & 84 deletions src/pyhpp/pinocchio/device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,90 +53,6 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(existFrame_overload, Model::existFrame,
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(addJointFrame_overload,
Model::addJointFrame, 1, 2)

void exposeModel() {
class_<Model, ModelPtr_t, boost::noncopyable>("Model", no_init)
.add_property("nq", &Model::nq)
.add_property("nv", &Model::nv)
.add_property("njoints", &Model::njoints)
.add_property("nbodies", &Model::nbodies)
.add_property("nframes", &Model::nframes)
.add_property("inertias", &Model::inertias)
.add_property("jointPlacements", &Model::jointPlacements)
.add_property("joints", &Model::joints)
.add_property("idx_qs", &Model::idx_qs)
.add_property("nqs", &Model::nqs)
.add_property("idx_vs", &Model::idx_vs)
.add_property("nvs", &Model::nvs)
.add_property("parents", &Model::parents)
.add_property("names", &Model::names)
.def_readwrite("name", &Model::name)
.def_readwrite("referenceConfigurations", &Model::referenceConfigurations)

.def_readwrite("rotorInertia", &Model::rotorInertia,
"Vector of rotor inertia parameters.")
.def_readwrite("rotorGearRatio", &Model::rotorGearRatio,
"Vector of rotor gear ratio parameters.")
.def_readwrite("friction", &Model::friction,
"Vector of joint friction parameters.")
.def_readwrite("damping", &Model::damping,
"Vector of joint damping parameters.")
.def_readwrite("effortLimit", &Model::effortLimit, "Joint max effort.")
.def_readwrite("velocityLimit", &Model::velocityLimit,
"Joint max velocity.")
.def_readwrite("lowerPositionLimit", &Model::lowerPositionLimit,
"Limit for joint lower position.")
.def_readwrite("upperPositionLimit", &Model::upperPositionLimit,
"Limit for joint upper position.")
.def_readwrite("frames", &Model::frames,
"Vector of frames contained in the model.")
.def_readwrite("supports", &Model::supports,
"Vector of supports. supports[j] corresponds to the list "
"of joints on the path between\n"
"the current *j* to the root of the kinematic tree.")
.def_readwrite("subtrees", &Model::subtrees,
"Vector of subtrees. subtree[j] corresponds to the "
"subtree supported by the joint j.")
.def_readwrite("gravity", &Model::gravity,
"Motion vector corresponding to the gravity field "
"expressed in the world Frame.")
.def("appendBodyToJoint", &Model::appendBodyToJoint,
bp::args("self", "joint_id", "body_inertia", "body_placement"),
"Appends a body to the joint given by its index. The body is "
"defined by its inertia, its relative placement regarding to the "
"joint and its name.")
.def("addBodyFrame", &Model::addBodyFrame,
bp::args("self", "body_name", "parentJoint", "body_placement",
"previous_frame"),
"add a body to the frame tree")
.def("getBodyId", &Model::getBodyId, bp::args("self", "name"),
"Return the index of a frame of type BODY given by its name")
.def("existBodyName", &Model::existBodyName, bp::args("self", "name"),
"Check if a frame of type BODY exists, given its name")
.def("getJointId", &Model::getJointId, bp::args("self", "name"),
"Return the index of a joint given by its name")
.def("existJointName", &Model::existJointName, bp::args("self", "name"),
"Check if a joint given by its name exists")
.def("getFrameId", &Model::getFrameId,
getFrameId_overload(
bp::args("self", "name", "type"),
"Returns the index of the frame given by its name and its type. "
"If the frame is not in the frames vector, it returns the "
"current size of the frames vector."))
.def("existFrame", &Model::existFrame,
existFrame_overload(bp::args("self", "name", "type"),
"Returns true if the frame given by its name "
"exists inside the Model with the given type."))
.def("hasConfigurationLimit", &Model::hasConfigurationLimit,
bp::args("self"),
"Returns list of boolean if joints have configuration limit.")
.def("hasConfigurationLimitInTangent",
&Model::hasConfigurationLimitInTangent, bp::args("self"),
"Returns list of boolean if joints have configuration limit in "
"tangent space .")
.def(bp::self == bp::self)
.def(bp::self != bp::self);
}

bool Device_currentConfiguration(Device& d, const Configuration_t& c) {
return d.currentConfiguration(c);
}
Expand Down

0 comments on commit a6e634a

Please sign in to comment.