hpp-pinocchio 6.0.0
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
Loading...
Searching...
No Matches
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
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_PINOCCHIO_HUMANOID_ROBOT_HH
32#define HPP_PINOCCHIO_HUMANOID_ROBOT_HH
33
36#include <hpp/pinocchio/fwd.hh>
37#include <iostream>
38#include <vector>
39
40namespace hpp {
41namespace pinocchio {
43
45 public:
48 virtual ~HumanoidRobot();
49
51 virtual DevicePtr_t clone() const;
52
53 HumanoidRobotPtr_t self() const { return weakPtr_.lock(); }
54
58
62 static HumanoidRobotPtr_t create(const std::string& name);
63
66
68 void waist(const JointPtr_t& joint);
69
72
74 void chest(const JointPtr_t& joint);
75
78
80 void leftWrist(const JointPtr_t& joint);
81
84
86 void rightWrist(const JointPtr_t& joint);
87
90
92 void leftAnkle(const JointPtr_t& joint);
93
96
98 void rightAnkle(const JointPtr_t& joint);
99
102
104 void gazeJoint(const JointPtr_t& joint);
105
107 void gaze(const vector3_t& origin, const vector3_t& dir) {
108 gazeOrigin_ = origin;
109 gazeDirection_ = dir;
110 }
111
112 protected:
114 HumanoidRobot(const std::string& name);
115
117
121 void init(const HumanoidRobotWkPtr_t& weakPtr);
122
123 void initCopy(const HumanoidRobotWkPtr_t& weakPtr,
124 const HumanoidRobot& other);
125
128
129 private:
130 HumanoidRobotWkPtr_t weakPtr_;
131 JointPtr_t waist_;
132 JointPtr_t chest_;
133 JointPtr_t leftWrist_;
134 JointPtr_t rightWrist_;
135 JointPtr_t leftAnkle_;
136 JointPtr_t rightAnkle_;
137 JointPtr_t gazeJoint_;
138 vector3_t gazeOrigin_;
139 vector3_t gazeDirection_;
140
141 HPP_SERIALIZABLE();
142}; // class HumanoidRobot
143} // namespace pinocchio
144} // namespace hpp
145
146BOOST_CLASS_EXPORT_KEY(hpp::pinocchio::HumanoidRobot)
147
148#endif // HPP_PINOCCHIO_HUMANOID_ROBOT_HH
Robot with geometric and dynamic pinocchio.
Definition device.hh:60
Humanoid robot.
Definition humanoid-robot.hh:44
void waist(const JointPtr_t &joint)
Set waist joint.
JointPtr_t gazeJoint() const
Get gaze joint.
JointPtr_t chest() const
Get Joint corresponding to the chest.
JointPtr_t leftAnkle() const
Get Joint corresponding to the left ankle.
void leftAnkle(const JointPtr_t &joint)
Set letf ankle.
void init(const HumanoidRobotWkPtr_t &weakPtr)
Initialization.
void initCopy(const HumanoidRobotWkPtr_t &weakPtr, const HumanoidRobot &other)
void rightWrist(const JointPtr_t &joint)
Set right wrist.
virtual DevicePtr_t clone() const
Clone as a HumanoidRobot.
void gaze(const vector3_t &origin, const vector3_t &dir)
Set gaze parameters.
Definition humanoid-robot.hh:107
JointPtr_t leftWrist() const
Get Joint corresponding to the left wrist.
JointPtr_t rightAnkle() const
Get Joint corresponding to the right ankle.
void leftWrist(const JointPtr_t &joint)
Set left wrist.
void gazeJoint(const JointPtr_t &joint)
Set gaze joint.
JointPtr_t rightWrist() const
Get Joint corresponding to the right wrist.
HumanoidRobot(const HumanoidRobot &other)
HumanoidRobot()
For serialization only.
Definition humanoid-robot.hh:127
void rightAnkle(const JointPtr_t &joint)
Set right ankle.
JointPtr_t waist() const
Get Joint corresponding to the waist.
static HumanoidRobotPtr_t create(const std::string &name)
Creation of a new device.
HumanoidRobot(const std::string &name)
Constructor.
HumanoidRobotPtr_t self() const
Definition humanoid-robot.hh:53
void chest(const JointPtr_t &joint)
Set chest joint.
#define HPP_PINOCCHIO_DLLAPI
Definition config.hh:88
shared_ptr< Device > DevicePtr_t
Definition fwd.hh:118
shared_ptr< Joint > JointPtr_t
Definition fwd.hh:123
shared_ptr< HumanoidRobot > HumanoidRobotPtr_t
Definition fwd.hh:121
Eigen::Matrix< value_type, 3, 1 > vector3_t
Definition fwd.hh:99
Utility functions.
Definition body.hh:39
Definition collision-object.hh:40