hpp-pinocchio  4.9.1
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>
26 # include <hpp/pinocchio/deprecated.hh>
27 
28 namespace hpp {
29  namespace pinocchio {
31  class HPP_PINOCCHIO_DLLAPI Frame {
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 () const
88  {
89  return children_;
90  }
91 
93  const Transform3f& positionInParentJoint () const;
94 
96  Transform3f positionInParentFrame () const;
97 
99  void positionInParentFrame (const Transform3f& p);
101 
102  public:
103 
104  // -----------------------------------------------------------------------
105 
107  DeviceConstPtr_t robot () const { selfAssert(); return devicePtr_.lock();}
109  DevicePtr_t robot () { selfAssert(); return devicePtr_.lock();}
110 
112  virtual std::ostream& display (std::ostream& os) const;
113 
116 
117  const FrameIndex& index () const
118  {
119  return frameIndex_;
120  }
121 
122  const ::pinocchio::Frame& pinocchio() const;
123 
125 
126  private:
127  DeviceWkPtr_t devicePtr_;
128  FrameIndex frameIndex_;
129  std::vector<FrameIndex> children_;
130 
131  ::pinocchio::Frame& pinocchio();
132 
134  void setChildList();
135  Model& model() ;
136  const Model& model() const ;
137  DeviceData& data() const;
138 
140  void selfAssert() const;
141  }; // class Frame
142 
143  inline std::ostream& operator<< (std::ostream& os, const Frame& frame) { return frame.display(os); }
144 
145  } // namespace pinocchio
146 } // namespace hpp
147 
148 #endif // HPP_PINOCCHIO_FRAME_HH
boost::shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:104
Utility functions.
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:109
Robot frame.
Definition: frame.hh:31
JointJacobian_t jacobian() const
Definition: frame.hh:65
std::ostream & operator<<(std::ostream &os, const hpp::pinocchio::Device &device)
Definition: device.hh:344
virtual std::ostream & display(std::ostream &os) const
Display frame.
const FrameIndex & index() const
Definition: frame.hh:117
::pinocchio::FrameIndex FrameIndex
Definition: fwd.hh:63
DeviceConstPtr_t robot() const
Access robot owning the object.
Definition: frame.hh:107
const std::vector< FrameIndex > & children() const
Definition: frame.hh:87
::pinocchio::SE3 Transform3f
Definition: fwd.hh:69
boost::shared_ptr< const Device > DeviceConstPtr_t
Definition: fwd.hh:105
~Frame()
Definition: frame.hh:41
std::ostream & display(std::ostream &os, const SE3 &m)
Write a SE3 taking into account the indentation.
boost::shared_ptr< Joint > JointPtr_t
Definition: fwd.hh:109