pinocchio  2.1.3
copy.hpp
1 //
2 // Copyright (c) 2016-2018 CNRS
3 //
4 
5 #ifndef __pinocchio_copy_hpp__
6 #define __pinocchio_copy_hpp__
7 
8 #include "pinocchio/multibody/model.hpp"
9 #include "pinocchio/multibody/data.hpp"
10 #include "pinocchio/algorithm/check.hpp"
11 
12 namespace pinocchio
13 {
25  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
26  inline void
27  copy(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
28  const DataTpl<Scalar,Options,JointCollectionTpl> & origin,
29  DataTpl<Scalar,Options,JointCollectionTpl> & dest,
30  int LEVEL);
31 
32 } // namespace pinocchio
33 
34 /* --- Details -------------------------------------------------------------------- */
35 //#include "pinocchio/algorithm/copy.hxx"
36 
37 
38 namespace pinocchio
39 {
40  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
41  inline void
45  int LEVEL)
46  {
48  typedef typename Model::JointIndex JointIndex;
49 
50  for(JointIndex jid=1; jid<(JointIndex)model.njoints; ++jid)
51  {
52  assert(LEVEL>=0);
53 
54  dest.oMi[jid] = origin.oMi [jid];
55  if(LEVEL>=1)
56  {
57  dest.v[jid] = origin.v [jid];
58  }
59  if(LEVEL>=2)
60  {
61  dest.a[jid] = origin.a [jid];
62  dest.a_gf[jid] = origin.a_gf[jid];
63  dest.f[jid] = origin.f [jid];
64  }
65  }
66  }
67 
68 
69 } // namespace pinocchio
70 
71 #endif // ifndef __pinocchio_copy_hpp__
container::aligned_vector< Motion > a_gf
Vector of joint accelerations due to the gravity field.
Definition: data.hpp:85
container::aligned_vector< Motion > a
Vector of joint accelerations expressed at the centers of the joints frames.
Definition: data.hpp:79
void copy(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &origin, DataTpl< Scalar, Options, JointCollectionTpl > &dest, int LEVEL)
Copy part of the data from <orig> to <dest>. Template parameter can be used to select at which differ...
Definition: copy.hpp:42
int njoints
Number of joints.
container::aligned_vector< SE3 > oMi
Vector of absolute joint placements (wrt the world).
Definition: data.hpp:111
container::aligned_vector< Motion > v
Vector of joint velocities expressed at the centers of the joints.
Definition: data.hpp:91
container::aligned_vector< Force > f
Vector of body forces expressed in the local frame of the joint. For each body, the force represents ...
Definition: data.hpp:98
Main pinocchio namespace.
Definition: treeview.dox:24