pinocchio  3.3.1
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
model-item.hpp
1 //
2 // Copyright (c) 2021-2022 INRIA
3 //
4 
5 #ifndef __pinocchio_multibody_model_item_hpp__
6 #define __pinocchio_multibody_model_item_hpp__
7 
8 #include "pinocchio/multibody/fwd.hpp"
9 
10 namespace pinocchio
11 {
12  template<typename Derived>
13  struct ModelItem : NumericalBase<Derived>
14  {
15  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
16 
17  typedef typename traits<Derived>::Scalar Scalar;
18  enum
19  {
20  Options = traits<Derived>::Options
21  };
23 
25  std::string name;
26 
28  JointIndex parentJoint;
29 
36  FrameIndex parentFrame;
37 
40 
45  : name()
46  , parentJoint()
47  , parentFrame()
48  , placement()
49  {
50  }
51 
62  const std::string & name,
63  const JointIndex parent_joint,
64  const FrameIndex parent_frame,
65  const SE3 & frame_placement)
66  : name(name)
67  , parentJoint(parent_joint)
68  , parentFrame(parent_frame)
69  , placement(frame_placement)
70  {
71  }
72 
73  bool operator==(const ModelItem & other) const
74  {
75  return name == other.name && parentJoint == other.parentJoint
76  && parentFrame == other.parentFrame && placement == other.placement;
77  }
78  };
79 } // namespace pinocchio
80 
81 #endif // ifndef __pinocchio_multibody_model_item_hpp__
Main pinocchio namespace.
Definition: treeview.dox:11
ModelItem(const std::string &name, const JointIndex parent_joint, const FrameIndex parent_frame, const SE3 &frame_placement)
Builds a kinematic element defined by its name, its joint parent id, its parent frame id and its plac...
Definition: model-item.hpp:61
FrameIndex parentFrame
Index of the parent frame.
Definition: model-item.hpp:36
ModelItem()
Default constructor of ModelItem.
Definition: model-item.hpp:44
JointIndex parentJoint
Index of the parent joint.
Definition: model-item.hpp:28
std::string name
Name of the kinematic element.
Definition: model-item.hpp:25
SE3 placement
Position of kinematic element in parent joint frame.
Definition: model-item.hpp:39
Common traits structure to fully define base classes for CRTP.
Definition: fwd.hpp:72