model-generator.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2020 CNRS INRIA
3 //
4 
6 
7 namespace pinocchio
8 {
9 
10  template<typename D>
12  Model & model,
13  const JointModelBase<D> & jmodel,
15  const SE3 & joint_placement,
16  const std::string & name,
17  const Inertia & Y)
18  {
20  typedef typename D::TangentVector_t TV;
21  typedef typename D::ConfigVector_t CV;
22 
23  idx = model.addJoint(
24  parent_id, jmodel, joint_placement, name + "_joint", TV::Zero(),
25  1e3 * (TV::Random() + TV::Constant(1)), 1e3 * (CV::Random() - CV::Constant(1)),
26  1e3 * (CV::Random() + CV::Constant(1)));
27 
28  model.appendBodyToJoint(idx, Y, SE3::Identity());
29  }
30 
32  {
34  model, JointModelFreeFlyer(), model.getJointId("universe"), SE3::Identity(), "freeflyer",
35  Inertia::Random());
37  model, JointModelSpherical(), model.getJointId("freeflyer_joint"), SE3::Identity(),
38  "spherical", Inertia::Random());
40  model, JointModelPlanar(), model.getJointId("spherical_joint"), SE3::Identity(), "planar",
41  Inertia::Random());
43  model, JointModelRX(), model.getJointId("planar_joint"), SE3::Identity(), "rx",
44  Inertia::Random());
46  model, JointModelPX(), model.getJointId("rx_joint"), SE3::Identity(), "px",
47  Inertia::Random());
49  model, JointModelHX(1.0), model.getJointId("px_joint"), SE3::Identity(), "hx",
50  Inertia::Random());
52  model, JointModelPrismaticUnaligned(SE3::Vector3(1, 0, 0)), model.getJointId("hx_joint"),
53  SE3::Identity(), "pu", Inertia::Random());
55  model, JointModelRevoluteUnaligned(SE3::Vector3(0, 0, 1)), model.getJointId("pu_joint"),
56  SE3::Identity(), "ru", Inertia::Random());
58  model, JointModelHelicalUnaligned(SE3::Vector3(0, 0, 1), 1.0), model.getJointId("ru_joint"),
59  SE3::Identity(), "hu", Inertia::Random());
61  model, JointModelSphericalZYX(), model.getJointId("hu_joint"), SE3::Identity(),
62  "sphericalZYX", Inertia::Random());
64  model, JointModelTranslation(), model.getJointId("sphericalZYX_joint"), SE3::Identity(),
65  "translation", Inertia::Random());
66  }
67 
68 } // namespace pinocchio
pinocchio::InertiaTpl< context::Scalar, context::Options >
pinocchio::addJointAndBody
void addJointAndBody(Model &model, const JointModelBase< D > &jmodel, const Model::JointIndex parent_id, const SE3 &joint_placement, const std::string &name, const Inertia &Y)
Definition: model-generator.hpp:11
pinocchio::SE3Tpl< context::Scalar, context::Options >::Vector3
traits< SE3Tpl >::Vector3 Vector3
Definition: spatial/se3-tpl.hpp:55
pinocchio::JointModelFreeFlyer
JointModelFreeFlyerTpl< context::Scalar > JointModelFreeFlyer
Definition: multibody/joint/fwd.hpp:110
pinocchio::JointModelTranslation
JointModelTranslationTpl< context::Scalar > JointModelTranslation
Definition: multibody/joint/fwd.hpp:126
pinocchio::JointModelHX
JointModelHelicalTpl< context::Scalar, context::Options, 0 > JointModelHX
Definition: joint-helical.hpp:960
pinocchio::JointModelBase
Definition: joint-model-base.hpp:75
pinocchio::SE3Tpl< context::Scalar, context::Options >
pinocchio::name
std::string name(const LieGroupGenericTpl< LieGroupCollection > &lg)
Visit a LieGroupVariant to get the name of it.
model.hpp
pinocchio::JointModelRX
JointModelRevoluteTpl< context::Scalar, context::Options, 0 > JointModelRX
Definition: joint-revolute.hpp:873
pinocchio::JointModelSpherical
JointModelSphericalTpl< context::Scalar > JointModelSpherical
Definition: multibody/joint/fwd.hpp:73
pinocchio::JointModelPlanar
JointModelPlanarTpl< context::Scalar > JointModelPlanar
Definition: multibody/joint/fwd.hpp:118
pinocchio::ModelTpl::JointIndex
pinocchio::JointIndex JointIndex
Definition: multibody/model.hpp:67
append-urdf-model-with-another-model.parent_id
int parent_id
Definition: append-urdf-model-with-another-model.py:28
pinocchio::InertiaTpl< context::Scalar, context::Options >::Random
static InertiaTpl Random()
Definition: spatial/inertia.hpp:361
pinocchio::buildAllJointsModel
void buildAllJointsModel(Model &model)
Definition: model-generator.hpp:31
pinocchio::JointModelHelicalUnaligned
JointModelHelicalUnalignedTpl< context::Scalar > JointModelHelicalUnaligned
Definition: multibody/joint/fwd.hpp:65
append-urdf-model-with-another-model.joint_placement
joint_placement
Definition: append-urdf-model-with-another-model.py:29
pinocchio::SE3Tpl::Identity
static SE3Tpl Identity()
Definition: spatial/se3-tpl.hpp:136
Y
Y
pinocchio::JointModelPX
JointModelPrismaticTpl< context::Scalar, context::Options, 0 > JointModelPX
Definition: joint-prismatic.hpp:777
pinocchio::JointModelSphericalZYX
JointModelSphericalZYXTpl< context::Scalar > JointModelSphericalZYX
Definition: multibody/joint/fwd.hpp:81
pinocchio::JointModelRevoluteUnaligned
JointModelRevoluteUnalignedTpl< context::Scalar > JointModelRevoluteUnaligned
Definition: multibody/joint/fwd.hpp:38
pinocchio::JointModelPrismaticUnaligned
JointModelPrismaticUnalignedTpl< context::Scalar > JointModelPrismaticUnaligned
Definition: multibody/joint/fwd.hpp:94
pinocchio::ModelTpl
Definition: context/generic.hpp:20
pinocchio::model
JointCollectionTpl & model
Definition: joint-configuration.hpp:1082
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Mon Dec 16 2024 03:41:04