Re: z-value in eulerAngles
"Mike Jost" <[email protected]> Thu, 18 Mar 2004 23:49:45 -0600
| Newsgroups | gmane.comp.cybernetics.webot.contest |
|---|---|
| Message-ID | <004f01c40d75$fb8b94a0$0700a8c0@MJLAP> |
Anders,
Here is the routine I use to determine the fall type.
The maxAngleX and maxAngleZ are the absolute tilt angles that would result in the robot falling. These are the threshold values for detecting a fall. The values should be in the range from 0 to (pi / 2).
The angleX and angleZ values are the values returned from the method eulerAngles().
if (Math.abs(angleX) < maxAngleX) {
if (angleZ > maxAngleZ) { // Fall on Right Side detected. }
if (angleZ < -1*maxAngleZ) { // Fall on Left Side detected. }
}
else {
if (angleX > maxAngleX) { // Fall on Back detected. }
if (angleX < -1*maxAngleX) { // Fall on Front detected.}
}
Mike Jost
Hi,
I don't quite understand what the inclinometer method eulerAngles return. The x-value seems to be the inclinometer value in the direction of back_1 (no matter the orientation of the robot), but the z value seems a bit wierd though. For example, a robot standing up straight has z = 0 (as expected), but when lying on its belly the z value is pi, thus z cannot be the tilt value.(?) I would like to find an exclusive criteria telling whether the robot is lying on its side. Any Suggestions?
Best,
Anders.L