NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gait_common_pose.h
1 // Gait utility class that provides common pose representation functionality
2 // File: gait_common_pose.h
3 // Author: Philipp Allgeuer <pallgeuer@ais.uni-bonn.de>
4 
5 // Ensure header is only included once
6 #ifndef GAIT_COMMON_POSE_H
7 #define GAIT_COMMON_POSE_H
8 
9 // Gait namespace
10 namespace gait
11 {
21  {
22  //
23  // Constructor
24  //
25 
27  explicit CommonLegData(bool left = true) { reset(left); }
28 
30  inline void reset(bool left = true)
31  {
32  setEffort(0.0);
33  setSupportCoeff(0.0);
34  setLegSign(left);
35  setLinkLength(1.0);
36  }
37 
38  //
39  // Set functions
40  //
41 
43  inline void setEffort(double eff)
44  {
45  effortHipYaw = eff;
46  effortHipRoll = eff;
47  effortHipPitch = eff;
48  effortKneePitch = eff;
49  effortAnklePitch = eff;
50  effortAnkleRoll = eff;
51  }
52 
54  inline void setEffort(double effYaw, double effPitch, double effRoll)
55  {
56  effortHipYaw = effYaw;
57  effortHipRoll = effRoll;
58  effortHipPitch = effPitch;
59  effortKneePitch = effPitch;
60  effortAnklePitch = effPitch;
61  effortAnkleRoll = effRoll;
62  }
63 
65  inline void setEffort(double effHipYaw, double effHipRoll, double effHipPitch, double effKneePitch, double effAnklePitch, double effAnkleRoll)
66  {
67  effortHipYaw = effHipYaw;
68  effortHipRoll = effHipRoll;
69  effortHipPitch = effHipPitch;
70  effortKneePitch = effKneePitch;
71  effortAnklePitch = effAnklePitch;
72  effortAnkleRoll = effAnkleRoll;
73  }
74 
76  inline void setSupportCoeff(double coeff)
77  {
78  supportCoeff = coeff;
79  }
80 
82  inline void setLegSign(bool left)
83  {
84  isLeft = left;
85  limbSign = (left ? 1 : -1);
86  }
87 
89  inline void setLinkLength(double length)
90  {
91  linkLength = length;
92  }
93 
94  //
95  // Data members
96  //
97 
98  // Joint efforts
99  double effortHipYaw;
100  double effortHipRoll;
101  double effortHipPitch;
105 
106  // Support coefficient
107  double supportCoeff;
108 
109  // Leg sign
110  bool isLeft;
111  int limbSign;
112 
113  // Link length
114  double linkLength;
115  };
116 
126  {
127  //
128  // Constructor
129  //
130 
132  explicit CommonArmData(bool left = true) { reset(left); }
133 
135  inline void reset(bool left = true)
136  {
137  setEffort(0.0);
138  setArmSign(left);
139  setLinkLength(1.0);
140  }
141 
142  //
143  // Set functions
144  //
145 
147  inline void setEffort(double eff)
148  {
149  effortShoulderPitch = eff;
150  effortShoulderRoll = eff;
151  effortElbowPitch = eff;
152  }
153 
155  inline void setEffort(double effPitch, double effRoll)
156  {
157  effortShoulderPitch = effPitch;
158  effortShoulderRoll = effRoll;
159  effortElbowPitch = effPitch;
160  }
161 
163  inline void setEffort(double effShoulderPitch, double effShoulderRoll, double effElbowPitch)
164  {
165  effortShoulderPitch = effShoulderPitch;
166  effortShoulderRoll = effShoulderRoll;
167  effortElbowPitch = effElbowPitch;
168  }
169 
171  inline void setArmSign(bool left)
172  {
173  isLeft = left;
174  limbSign = (left ? 1 : -1);
175  }
176 
178  inline void setLinkLength(double length)
179  {
180  linkLength = length;
181  }
182 
183  //
184  // Data members
185  //
186 
187  // Joint efforts
191 
192  // Arm sign
193  bool isLeft;
194  int limbSign;
195 
196  // Link length
197  double linkLength;
198  };
199 }
200 
201 #endif /* GAIT_COMMON_POSE_H */
202 // EOF
void setLinkLength(double length)
Set the link length used for pose conversions.
Definition: gait_common_pose.h:178
void setEffort(double eff)
Set the effort of the leg (equal for all joints)
Definition: gait_common_pose.h:43
double effortKneePitch
Dimensionless effort value associated with the knee pitch (in the range [0,1], 0 = No effort...
Definition: gait_common_pose.h:102
double effortShoulderRoll
Dimensionless effort value associated with the shoulder roll (in the range [0,1], 0 = No effort...
Definition: gait_common_pose.h:189
double effortShoulderPitch
Dimensionless effort value associated with the shoulder pitch (in the range [0,1], 0 = No effort, 1 = Full effort)
Definition: gait_common_pose.h:188
void setEffort(double effPitch, double effRoll)
Set the effort of the arm (equal for all pitch and roll joints)
Definition: gait_common_pose.h:155
void reset(bool left=true)
Reset function.
Definition: gait_common_pose.h:135
Data struct that contains the information pertaining to an arm pose that should be common amongst all...
Definition: gait_common_pose.h:125
void setEffort(double effHipYaw, double effHipRoll, double effHipPitch, double effKneePitch, double effAnklePitch, double effAnkleRoll)
Set the effort of the leg (independent for each joint)
Definition: gait_common_pose.h:65
double effortHipYaw
Dimensionless effort value associated with the hip yaw (in the range [0,1], 0 = No effort...
Definition: gait_common_pose.h:99
CommonLegData(bool left=true)
Default constructor.
Definition: gait_common_pose.h:27
double effortElbowPitch
Dimensionless effort value associated with the elbow pitch (in the range [0,1], 0 = No effort...
Definition: gait_common_pose.h:190
void setEffort(double effYaw, double effPitch, double effRoll)
Set the effort of the leg (equal for all yaw, pitch and roll joints)
Definition: gait_common_pose.h:54
void reset(bool left=true)
Reset function.
Definition: gait_common_pose.h:30
int limbSign
Integral value that is +1 if this is a left arm and -1 if this is a right arm.
Definition: gait_common_pose.h:194
double effortAnkleRoll
Dimensionless effort value associated with the ankle roll (in the range [0,1], 0 = No effort...
Definition: gait_common_pose.h:104
double linkLength
The assumed (equal) length of the upper and lower leg links (used for joint pose conversions) ...
Definition: gait_common_pose.h:114
double linkLength
The assumed (equal) length of the upper and lower arm links (used for joint pose conversions) ...
Definition: gait_common_pose.h:197
double supportCoeff
Dimensionless support coefficient representing how much of the robot's weight is on this leg (in the ...
Definition: gait_common_pose.h:107
void setEffort(double effShoulderPitch, double effShoulderRoll, double effElbowPitch)
Set the effort of the arm (independent for each joint)
Definition: gait_common_pose.h:163
double effortHipPitch
Dimensionless effort value associated with the hip pitch (in the range [0,1], 0 = No effort...
Definition: gait_common_pose.h:101
void setArmSign(bool left)
Set the sign of the arm.
Definition: gait_common_pose.h:171
double effortHipRoll
Dimensionless effort value associated with the hip roll (in the range [0,1], 0 = No effort...
Definition: gait_common_pose.h:100
int limbSign
Integral value that is +1 if this is a left leg and -1 if this is a right leg.
Definition: gait_common_pose.h:111
bool isLeft
Boolean flag that is true if this is a left leg and false if this is a right leg. ...
Definition: gait_common_pose.h:110
bool isLeft
Boolean flag that is true if this is a left arm and false if this is a right arm. ...
Definition: gait_common_pose.h:193
CommonArmData(bool left=true)
Default constructor.
Definition: gait_common_pose.h:132
void setEffort(double eff)
Set the effort of the arm (equal for all joints)
Definition: gait_common_pose.h:147
double effortAnklePitch
Dimensionless effort value associated with the ankle pitch (in the range [0,1], 0 = No effort...
Definition: gait_common_pose.h:103
Data struct that contains the information pertaining to a leg pose that should be common amongst all ...
Definition: gait_common_pose.h:20
void setSupportCoeff(double coeff)
Set the support coefficient of the leg.
Definition: gait_common_pose.h:76
void setLegSign(bool left)
Set the sign of the leg.
Definition: gait_common_pose.h:82
void setLinkLength(double length)
Set the link length used for pose conversions.
Definition: gait_common_pose.h:89