hpp-manipulation  6.0.0
Classes for manipulation planning.
device.hh
Go to the documentation of this file.
1 
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are
9 // met:
10 //
11 // 1. Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 //
14 // 2. Redistributions in binary form must reproduce the above copyright
15 // notice, this list of conditions and the following disclaimer in the
16 // documentation and/or other materials provided with the distribution.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
29 // DAMAGE.
30 
31 #ifndef HPP_MANIPULATION_DEVICE_HH
32 #define HPP_MANIPULATION_DEVICE_HH
33 
34 #include <hpp/core/container.hh>
36 #include <hpp/manipulation/fwd.hh>
37 #include <hpp/pinocchio/humanoid-robot.hh>
38 
39 namespace hpp {
40 namespace manipulation {
48 class HPP_MANIPULATION_DLLAPI Device : public pinocchio::HumanoidRobot {
49  public:
50  typedef pinocchio::HumanoidRobot Parent_t;
51 
54  static DevicePtr_t create(const std::string& name) {
55  Device* ptr = new Device(name);
56  DevicePtr_t shPtr(ptr);
57  ptr->init(shPtr);
58  return shPtr;
59  }
60 
61  DevicePtr_t self() const { return self_.lock(); }
62 
64  virtual std::ostream& print(std::ostream& os) const;
65 
66  void setRobotRootPosition(const std::string& robotName,
67  const Transform3s& positionWRTParentJoint);
68 
69  virtual pinocchio::DevicePtr_t clone() const;
70 
71  std::vector<std::string> robotNames() const;
72 
73  FrameIndices_t robotFrames(const std::string& robotName) const;
74 
75  void removeJoints(const std::vector<std::string>& jointNames,
76  Configuration_t referenceConfig);
77 
78  core::Container<HandlePtr_t> handles;
79  core::Container<GripperPtr_t> grippers;
80  core::Container<JointAndShapes_t> jointAndShapes;
81 
82  protected:
87  Device(const std::string& name) : Parent_t(name) {}
88 
89  void init(const DeviceWkPtr_t& self) {
90  Parent_t::init(self);
91  self_ = self;
92  }
93 
94  void initCopy(const DeviceWkPtr_t& self, const Device& other) {
95  Parent_t::initCopy(self, other);
96  self_ = self;
97  }
98 
100  Device() {}
101 
102  private:
103  DeviceWkPtr_t self_;
104 
105  HPP_SERIALIZABLE();
106 }; // class Device
107 } // namespace manipulation
108 } // namespace hpp
109 
110 BOOST_CLASS_EXPORT_KEY(hpp::manipulation::Device)
111 
112 #endif // HPP_MANIPULATION_DEVICE_HH
Definition: device.hh:48
void init(const DeviceWkPtr_t &self)
Definition: device.hh:89
static DevicePtr_t create(const std::string &name)
Definition: device.hh:54
void setRobotRootPosition(const std::string &robotName, const Transform3s &positionWRTParentJoint)
void removeJoints(const std::vector< std::string > &jointNames, Configuration_t referenceConfig)
pinocchio::HumanoidRobot Parent_t
Definition: device.hh:50
void initCopy(const DeviceWkPtr_t &self, const Device &other)
Definition: device.hh:94
core::Container< JointAndShapes_t > jointAndShapes
Definition: device.hh:80
core::Container< HandlePtr_t > handles
Definition: device.hh:78
virtual pinocchio::DevicePtr_t clone() const
FrameIndices_t robotFrames(const std::string &robotName) const
Device(const std::string &name)
Definition: device.hh:87
Device()
For serialization only.
Definition: device.hh:100
std::vector< std::string > robotNames() const
virtual std::ostream & print(std::ostream &os) const
Print object in a stream.
core::Container< GripperPtr_t > grippers
Definition: device.hh:79
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:88
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:48
std::vector< pinocchio::FrameIndex > FrameIndices_t
Definition: fwd.hh:47
core::Transform3s Transform3s
Definition: fwd.hh:91
shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:40
Definition: main.hh:1