hpp-pinocchio  4.12.0
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
frame.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS
3 // Author: Joseph Mirabel
4 //
5 //
6 // This file is part of hpp-pinocchio
7 // hpp-pinocchio is free software: you can redistribute it
8 // and/or modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation, either version
10 // 3 of the License, or (at your option) any later version.
11 //
12 // hpp-pinocchio is distributed in the hope that it will be
13 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Lesser Public License for more details. You should have
16 // received a copy of the GNU Lesser General Public License along with
17 // hpp-pinocchio If not, see
18 // <http://www.gnu.org/licenses/>.
19 
20 #ifndef HPP_PINOCCHIO_FRAME_HH
21 # define HPP_PINOCCHIO_FRAME_HH
22 
23 # include <cstddef>
24 # include <hpp/pinocchio/fwd.hh>
25 # include <hpp/pinocchio/config.hh>
27 
28 namespace hpp {
29  namespace pinocchio {
32  public:
35 
39  Frame (DeviceWkPtr_t device, FrameIndex indexInFrameList );
40 
41  ~Frame() {}
43  // -----------------------------------------------------------------------
46 
48  const std::string& name() const;
49 
51  // -----------------------------------------------------------------------
54 
56  Transform3f currentTransformation () const;
57 
59  Transform3f currentTransformation (const DeviceData& data) const;
60 
65  JointJacobian_t jacobian () const { return jacobian (data()); }
66 
67  JointJacobian_t jacobian (const DeviceData& data) const;
68 
70  // -----------------------------------------------------------------------
73 
75  bool isFixed () const;
76 
78  JointPtr_t joint () const;
79 
82  Frame parentFrame () const;
83 
85  bool isRootFrame () const;
86 
87  const std::vector<FrameIndex>& children ()
88  {
89  setChildList();
90  return children_;
91  }
92 
94  const Transform3f& positionInParentJoint () const;
95 
97  Transform3f positionInParentFrame () const;
98 
100  void positionInParentFrame (const Transform3f& p);
102 
103  public:
104 
105  // -----------------------------------------------------------------------
106 
108  DeviceConstPtr_t robot () const { selfAssert(); return devicePtr_.lock();}
110  DevicePtr_t robot () { selfAssert(); return devicePtr_.lock();}
111 
113  virtual std::ostream& display (std::ostream& os) const;
114 
117 
118  const FrameIndex& index () const
119  {
120  return frameIndex_;
121  }
122 
123  const ::pinocchio::Frame& pinocchio() const;
124 
126 
127  private:
128  DeviceWkPtr_t devicePtr_;
129  FrameIndex frameIndex_;
130  std::vector<FrameIndex> children_;
131 
132  ::pinocchio::Frame& pinocchio();
133 
135  void setChildList();
136  Model& model() ;
137  const Model& model() const ;
138  DeviceData& data() const;
139 
141  void selfAssert() const;
142  }; // class Frame
143 
144  inline std::ostream& operator<< (std::ostream& os, const Frame& frame) { return frame.display(os); }
145 
146  } // namespace pinocchio
147 } // namespace hpp
148 
149 #endif // HPP_PINOCCHIO_FRAME_HH
Utility functions.
Definition: body.hh:30
Eigen::Matrix< value_type, 6, Eigen::Dynamic > JointJacobian_t
Definition: fwd.hh:88
Definition: device-data.hh:41
DevicePtr_t robot()
Access robot owning the object.
Definition: frame.hh:110
::pinocchio::ModelTpl< value_type, 0, JointCollectionTpl > Model
Definition: fwd.hh:65
Robot frame.
Definition: frame.hh:31
shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:106
JointJacobian_t jacobian() const
Definition: frame.hh:65
std::ostream & operator<<(std::ostream &os, const hpp::pinocchio::Device &device)
Definition: device.hh:359
virtual std::ostream & display(std::ostream &os) const
Display frame.
#define HPP_PINOCCHIO_DLLAPI
Definition: config.hh:64
const FrameIndex & index() const
Definition: frame.hh:118
::pinocchio::FrameIndex FrameIndex
Definition: fwd.hh:63
shared_ptr< Joint > JointPtr_t
Definition: fwd.hh:111
shared_ptr< const Device > DeviceConstPtr_t
Definition: fwd.hh:107
DeviceConstPtr_t robot() const
Access robot owning the object.
Definition: frame.hh:108
Definition: collision-object.hh:31
::pinocchio::SE3 Transform3f
Definition: fwd.hh:69
~Frame()
Definition: frame.hh:41
const std::vector< FrameIndex > & children()
Definition: frame.hh:87
std::ostream & display(std::ostream &os, const SE3 &m)
Write a SE3 taking into account the indentation.