hpp-manipulation  4.11.0
Classes for manipulation planning.
device.hh
Go to the documentation of this file.
1 // This file is part of hpp-manipulation.
7 // hpp-manipulation 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-manipulation 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-manipulation. If not, see
18 // <http://www.gnu.org/licenses/>.
19 
20 #ifndef HPP_MANIPULATION_DEVICE_HH
21 # define HPP_MANIPULATION_DEVICE_HH
22 
23 # include <hpp/pinocchio/humanoid-robot.hh>
24 
25 # include <hpp/core/container.hh>
26 
27 # include <hpp/manipulation/fwd.hh>
29 
30 namespace hpp {
31  namespace manipulation {
38  class HPP_MANIPULATION_DLLAPI Device : public pinocchio::HumanoidRobot
39  {
40  public:
41  typedef pinocchio::HumanoidRobot Parent_t;
42 
45  static DevicePtr_t create (const std::string& name)
46  {
47  Device* ptr = new Device (name);
48  DevicePtr_t shPtr (ptr);
49  ptr->init (shPtr);
50  return shPtr;
51  }
52 
53  DevicePtr_t self () const { return self_.lock(); }
54 
56  virtual std::ostream& print (std::ostream& os) const;
57 
58  void setRobotRootPosition (const std::string& robotName,
59  const Transform3f& positionWRTParentJoint);
60 
61  virtual pinocchio::DevicePtr_t clone () const;
62 
63  std::vector<std::string> robotNames () const;
64 
65  FrameIndices_t robotFrames (const std::string& robotName) const;
66 
67  void removeJoints(const std::vector<std::string>& jointNames,
68  Configuration_t referenceConfig);
69 
70  core::Container <HandlePtr_t> handles;
71  core::Container <GripperPtr_t> grippers;
72  core::Container <JointAndShapes_t> jointAndShapes;
73 
74  protected:
79  Device (const std::string& name) :
80  Parent_t (name)
81  {}
82 
83  void init (const DeviceWkPtr_t& self)
84  {
85  Parent_t::init (self);
86  self_ = self;
87  }
88 
89  void initCopy (const DeviceWkPtr_t& self, const Device& other)
90  {
91  Parent_t::initCopy (self, other);
92  self_ = self;
93  }
94 
96  Device() {}
97 
98  private:
99  DeviceWkPtr_t self_;
100 
101  HPP_SERIALIZABLE();
102  }; // class Device
103  } // namespace manipulation
104 } // namespace hpp
105 
106 BOOST_CLASS_EXPORT_KEY(hpp::manipulation::Device)
107 
108 #endif // HPP_MANIPULATION_DEVICE_HH
void init(const DeviceWkPtr_t &self)
Definition: device.hh:83
Device(const std::string &name)
Definition: device.hh:79
Device()
For serialization only.
Definition: device.hh:96
Definition: main.hh:1
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:37
std::vector< pinocchio::FrameIndex > FrameIndices_t
Definition: fwd.hh:36
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:64
Definition: device.hh:38
void initCopy(const DeviceWkPtr_t &self, const Device &other)
Definition: device.hh:89
core::Container< JointAndShapes_t > jointAndShapes
Definition: device.hh:72
pinocchio::HumanoidRobot Parent_t
Definition: device.hh:41
core::Container< HandlePtr_t > handles
Definition: device.hh:70
shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:29
core::Transform3f Transform3f
Definition: fwd.hh:84
static DevicePtr_t create(const std::string &name)
Definition: device.hh:45
core::Container< GripperPtr_t > grippers
Definition: device.hh:71