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 
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
hpp::pinocchio::DevicePtr_t
shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:106
hpp::pinocchio::Model
::pinocchio::ModelTpl< value_type, 0, JointCollectionTpl > Model
Definition: fwd.hh:65
hpp::pinocchio::Transform3f
::pinocchio::SE3 Transform3f
Definition: fwd.hh:69
hpp::pinocchio::JointPtr_t
shared_ptr< Joint > JointPtr_t
Definition: fwd.hh:111
HPP_PINOCCHIO_DLLAPI
#define HPP_PINOCCHIO_DLLAPI
Definition: config.hh:64
hpp::pinocchio::DeviceConstPtr_t
shared_ptr< const Device > DeviceConstPtr_t
Definition: fwd.hh:107
fwd.hh
deprecated.hh
hpp::pinocchio::DeviceData
Definition: device-data.hh:41
hpp::pinocchio::Frame::jacobian
JointJacobian_t jacobian() const
Definition: frame.hh:65
hpp::pinocchio::Frame::display
virtual std::ostream & display(std::ostream &os) const
Display frame.
hpp
Utility functions.
Definition: body.hh:30
hpp::pinocchio::display
std::ostream & display(std::ostream &os, const SE3 &m)
Write a SE3 taking into account the indentation.
hpp::pinocchio::Frame::robot
DevicePtr_t robot()
Access robot owning the object.
Definition: frame.hh:110
hpp::pinocchio::Frame::index
const FrameIndex & index() const
Definition: frame.hh:118
hpp::pinocchio::Frame
Robot frame.
Definition: frame.hh:31
hpp::pinocchio::operator<<
std::ostream & operator<<(std::ostream &os, const hpp::pinocchio::Device &device)
Definition: device.hh:359
hpp::pinocchio::Frame::~Frame
~Frame()
Definition: frame.hh:41
hpp::pinocchio::Frame::children
const std::vector< FrameIndex > & children()
Definition: frame.hh:87
hpp::pinocchio::JointJacobian_t
Eigen::Matrix< value_type, 6, Eigen::Dynamic > JointJacobian_t
Definition: fwd.hh:88
config.hh
hpp::pinocchio::Frame::robot
DeviceConstPtr_t robot() const
Access robot owning the object.
Definition: frame.hh:108
hpp::pinocchio::FrameIndex
::pinocchio::FrameIndex FrameIndex
Definition: fwd.hh:63
pinocchio
Definition: collision-object.hh:31