pinocchio  2.3.1-dirty
algorithm/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 {
24  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
25  void
26  appendModel(const ModelTpl<Scalar,Options,JointCollectionTpl> & modelA,
27  const ModelTpl<Scalar,Options,JointCollectionTpl> & modelB,
28  const FrameIndex frameInModelA,
29  const SE3Tpl<Scalar,Options> & aMb,
30  ModelTpl<Scalar,Options,JointCollectionTpl> & model);
31 
43  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
44  ModelTpl<Scalar,Options,JointCollectionTpl>
47  const FrameIndex frameInModelA,
48  const SE3Tpl<Scalar,Options> & aMb)
49  {
51  Model model;
52 
53  appendModel(modelA,modelB,frameInModelA,aMb,model);
54 
55  return model;
56  }
57 
65  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
66  void
69  const GeometryModel & geomModelA,
70  const GeometryModel & geomModelB,
71  const FrameIndex frameInModelA,
72  const SE3Tpl<Scalar,Options> & aMb,
74  GeometryModel & geomModel);
75 
88  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType>
89  void
91  std::vector<JointIndex> list_of_joints_to_lock,
92  const Eigen::MatrixBase<ConfigVectorType> & reference_configuration,
94 
108  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType>
111  const std::vector<JointIndex> & list_of_joints_to_lock,
112  const Eigen::MatrixBase<ConfigVectorType> & reference_configuration)
113  {
115  Model reduced_model;
116 
117  buildReducedModel(model,list_of_joints_to_lock,reference_configuration,reduced_model);
118 
119  return reduced_model;
120  }
121 
136  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename ConfigVectorType>
137  void
139  const GeometryModel & geom_model,
140  const std::vector<JointIndex> & list_of_joints_to_lock,
141  const Eigen::MatrixBase<ConfigVectorType> & reference_configuration,
143  GeometryModel & reduced_geom_model);
144 
145 } // namespace pinocchio
146 
147 #include "pinocchio/algorithm/model.hxx"
148 
149 #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. the model given as reference argument.
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.