-
|
Hello all! I was playing around with the new(ish) mimic joint functionality and after a lot of searching and trial and error, I found:
model, _, _ = pin.buildModelsFromUrdf(
urdf_path, package_dirs=package_paths, mimic=True,
)
model.joints[-2].extract().scalingIn C++, what would be the equivalent of this Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hello @sea-bass,
To do the same in C++ you have to play with the
I will give you an untested snippet with auto* joint = boost::get<pinocchio::JointModelMimic>(&model.joints[model.joints().size() - 3]);
if (joint)
{
joint->scaling;
} |
Beta Was this translation helpful? Give feedback.
-
|
Thank you @jorisv -- that worked for me! I was trying I did find a bug in mimic joint parsing too, but I'll raise that one as an issue. |
Beta Was this translation helpful? Give feedback.
Hello @sea-bass,
ModelTpl::jointsstore a vector of genericJointModelTplthat inherit ofboost::variantthat can hold all joint types.The python
extractmethod allow to access the specific joint type inside theboost::variant.To do the same in C++ you have to play with the
boost::variantAPI by:boost::apply_visitorboost::getI will give you an untested snippet with
boost::get: