hpp-pinocchio  4.12.0
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
humanoid-robot.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016 CNRS
3 // Author: Joseph Mirabel from Florent Lamiraux
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_HUMANOID_ROBOT_HH
21 #define HPP_PINOCCHIO_HUMANOID_ROBOT_HH
22 
23 # include <iostream>
24 # include <vector>
25 
26 # include <hpp/pinocchio/device.hh>
27 # include <hpp/pinocchio/fwd.hh>
28 # include <hpp/pinocchio/config.hh>
29 
30 namespace hpp {
31  namespace pinocchio {
33 
35  {
36  public:
39  virtual ~HumanoidRobot ();
40 
42  virtual DevicePtr_t clone () const;
43 
44  HumanoidRobotPtr_t self() const { return weakPtr_.lock(); }
45 
49 
53  static HumanoidRobotPtr_t create (const std::string& name);
54 
56  JointPtr_t waist() const;
57 
59  void waist (const JointPtr_t& joint);
60 
62  JointPtr_t chest() const;
63 
65  void chest (const JointPtr_t& joint);
66 
68  JointPtr_t leftWrist() const;
69 
71  void leftWrist (const JointPtr_t& joint);
72 
74  JointPtr_t rightWrist() const;
75 
77  void rightWrist (const JointPtr_t& joint);
78 
80  JointPtr_t leftAnkle() const;
81 
83  void leftAnkle (const JointPtr_t& joint);
84 
86  JointPtr_t rightAnkle() const;
87 
89  void rightAnkle (const JointPtr_t& joint);
90 
92  JointPtr_t gazeJoint() const;
93 
95  void gazeJoint (const JointPtr_t& joint);
96 
98  void gaze (const vector3_t& origin, const vector3_t& dir)
99  {
100  gazeOrigin_ = origin;
101  gazeDirection_ = dir;
102  }
103  protected:
105  HumanoidRobot (const std::string& name);
106 
107  HumanoidRobot (const HumanoidRobot& other);
108 
112  void init (const HumanoidRobotWkPtr_t& weakPtr);
113 
114  void initCopy (const HumanoidRobotWkPtr_t& weakPtr, const HumanoidRobot& other);
115 
118  private:
119  HumanoidRobotWkPtr_t weakPtr_;
120  JointPtr_t waist_;
121  JointPtr_t chest_;
122  JointPtr_t leftWrist_;
123  JointPtr_t rightWrist_;
124  JointPtr_t leftAnkle_;
125  JointPtr_t rightAnkle_;
126  JointPtr_t gazeJoint_;
127  vector3_t gazeOrigin_;
128  vector3_t gazeDirection_;
129 
130  HPP_SERIALIZABLE();
131  }; // class HumanoidRobot
132  } // namespace pinocchio
133 } // namespace hpp
134 
135 BOOST_CLASS_EXPORT_KEY(hpp::pinocchio::HumanoidRobot)
136 
137 #endif // HPP_PINOCCHIO_HUMANOID_ROBOT_HH
Humanoid robot.
Definition: humanoid-robot.hh:34
Utility functions.
Definition: body.hh:30
void gaze(const vector3_t &origin, const vector3_t &dir)
Set gaze parameters.
Definition: humanoid-robot.hh:98
shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:106
#define HPP_PINOCCHIO_DLLAPI
Definition: config.hh:64
HumanoidRobot()
For serialization only.
Definition: humanoid-robot.hh:117
shared_ptr< HumanoidRobot > HumanoidRobotPtr_t
Definition: fwd.hh:109
Robot with geometric and dynamic pinocchio.
Definition: device.hh:52
shared_ptr< Joint > JointPtr_t
Definition: fwd.hh:111
Definition: collision-object.hh:31
Eigen::Matrix< value_type, 3, 1 > vector3_t
Definition: fwd.hh:86