pinocchio  2.4.4
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
model.hpp
1 //
2 // Copyright (c) 2019 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_algorithm_model_hpp__
6 #define __pinocchio_algorithm_model_hpp__
7 
8 #include "pinocchio/multibody/model.hpp"
9 #include "pinocchio/multibody/geometry.hpp"
10 
11 namespace pinocchio
12 {
23  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
24  void
25  appendModel(const ModelTpl<Scalar,Options,JointCollectionTpl> & modelA,
26  const ModelTpl<Scalar,Options,JointCollectionTpl> & modelB,
27  const FrameIndex frameInModelA,
28  const SE3Tpl<Scalar,Options> & aMb,
29  ModelTpl<Scalar,Options,JointCollectionTpl> & model);
30 
42  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
43  ModelTpl<Scalar,Options,JointCollectionTpl>
46  const FrameIndex frameInModelA,
47  const SE3Tpl<Scalar,Options> & aMb)
48  {
50  Model model;
51 
52  appendModel(modelA,modelB,frameInModelA,aMb,model);
53 
54  return model;
55  }
56 
64  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
65  void
68  const GeometryModel & geomModelA,
69  const GeometryModel & geomModelB,
70  const FrameIndex frameInModelA,
71  const SE3Tpl<Scalar,Options> & aMb,
73  GeometryModel & geomModel);
74 
87  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType>
88  void
90  std::vector<JointIndex> list_of_joints_to_lock,
91  const Eigen::MatrixBase<ConfigVectorType> & reference_configuration,
93 
107  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType>
110  const std::vector<JointIndex> & list_of_joints_to_lock,
111  const Eigen::MatrixBase<ConfigVectorType> & reference_configuration)
112  {
114  Model reduced_model;
115 
116  buildReducedModel(model,list_of_joints_to_lock,reference_configuration,reduced_model);
117 
118  return reduced_model;
119  }
120 
135  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType>
136  void
138  const GeometryModel & geom_model,
139  const std::vector<JointIndex> & list_of_joints_to_lock,
140  const Eigen::MatrixBase<ConfigVectorType> & reference_configuration,
142  GeometryModel & reduced_geom_model);
143 
144 } // namespace pinocchio
145 
146 #include "pinocchio/algorithm/model.hxx"
147 
148 #endif // ifndef __pinocchio_algorithm_model_hpp__
void appendModel(const ModelTpl< Scalar, Options, JointCollectionTpl > &modelA, const ModelTpl< Scalar, Options, JointCollectionTpl > &modelB, const FrameIndex frameInModelA, const SE3Tpl< Scalar, Options > &aMb, ModelTpl< Scalar, Options, JointCollectionTpl > &model)
Append a child model into a parent model, after a specific frame given by its index.
Main pinocchio namespace.
Definition: treeview.dox:24
void buildReducedModel(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, std::vector< JointIndex > list_of_joints_to_lock, const Eigen::MatrixBase< ConfigVectorType > &reference_configuration, ModelTpl< Scalar, Options, JointCollectionTpl > &reduced_model)
Build a reduced model from a given input model and a list of joint to lock.