Re: Problem with Euler Angles
"fransklip" <[email protected]>
| Newsgroups | gmane.comp.cybernetics.webot.contest |
|---|---|
| Message-ID | <[email protected]> |
Thanks Mike, Great! This routine works perfectly on my test walk. (I will have to check a few values formatted as "?") I have seen another question about the inclinometer yesterday, and have not seen yet any such routines from Webots. Do you care to publish the routine on the Wiki pages? I can make the page if you don't have time. Frans --- In [email protected], "Mike Jost" <webotsContest@m...> wrote: > Frans, > > The problem with the mixing of the X and Z angles is probably because you > are using one of my older getAngles( ) functions. The most current > getAngles( ) function is at > http://www.mikejost.com/cyberbotics/RotationMatrix/Judoka0_AngleTest.zip > The function will return X=0 and Z=0 when the robot is standing vertical. > > The previous functions were based on the two rotation matrix compositions: > R = Rx * Rz * Ry and > R = Rx * Ry * Rz > Both of these compositions mix the X and Z angles, since they are not the > way the controller actually calculates the composition. > The lastest getAngles( ) function uses a composition based on the heirarchy > of the robot from the judo.wbt VRML file(see previous post Nov. 30, 2003). > This composition is > R = Ry * Rx * Rz > This function returns correct X and Z angles with no mixing for -90 < X < > 90. For X angles beyond +/-90 the Z angle is locked at +/- PI. The Y angle > is not correct. > This function will work as an inclinometer, but cannot be used to determine > the correct X,Y, and Z angles all the time. There is a problem with using > Euler angles for rotation composition because the order of the composition > determines the final matrix and is not unique. This has the effect of > mapping a rototion axis onto another axis (the mixing problem) and for > intermediate elementary rotations of +/-Pi/2 it will be impossible to rotate > around the final elementary axis (the locking problem). > > Mike Jost > > > ----- Original Message ----- > From: "fransklip" <frans@v...> > To: <[email protected]> > Sent: Monday, December 15, 2003 18:20 PM > Subject: [webots-contest] Re: Problem with Euler Angles > > > > Hi Mike, > > > > I tried your angle calculation routines in my Kimaita robot for fall > > detection. That seemed to work at first, with the initial dive-attack. > > But later on in the match it went wrong: falls were detected when > > there was none. > > > > This weekend I logged sensor data every 64 msec while the robot was > > walking a small circle, and doing some body rotations after every > > (about) 90 degrees: tilt forward/back, tilt left/right and rotate , > > each + and -10 degrees. > > > > Near the Z-axis, the angles routines return values that can be related > > to the actual robot posture. But when moving away from the Z-axis, I > > cannot relate the returned angles to the robot anymore. > > > > I have made a summary of the test rotation values (angletest 01 > > summaray.txt). You can donwload this file from > > www.van-der-klip.demon.nl/webots/angletest01.zip. It also contains the > > sensor data for each of the 4 test movements in the walk (set 1, 2, > > 3, 4.txt) and the complete sensor and action log files). > > > > You can download the webview file of the test walk from: > > www.van-der-klip.demon.nl/webots/angletest01.wva > > > > Are the calculated angles something else then a rotation of the robot > > body around its center? If so, could you please axplain what they are? > > > > Regards, Frans / Kimaita > > > > --- In [email protected], "Mike Jost" > > <webotsContest@m...> wrote: > > > Olivier, > > > > > > I found some problems with the Euler angle calculations this > > weekend. I tested the previous equations by rotating the robot with > > the mouse, since I did not have a robot controller capable of turning > > on its own. Apparently the rotation composition used by the mouse in > > the Webots program is different than the rotation composition used > > when a robot actually moves itself. The current gps_euler( ) function > > in Webots 4.0.17 also returns wrong X and Z angles for some Y > > orientations of a robot. > > > > > > Solution: > > > I looked at the VRML file and used a rotation composition based on > > the heirarchy of the robot. > > > Judoka_Robot { > > > rotation 0 1 0 0 (rot about Y) > > > children { > > > back_1 servo { > > > rotation 1 0 0 0 (rot about X) > > > children { > > > back_2 servo { > > > rotation 0 0 1 0 (rot about Z) > > > } > > > } > > > } > > > gps_device > > > } > > > } > > > > > > The resulting composition should be Rgeneral = Ry * Rx * Rz instead > > of the previous Rx * Ry * Rz. > > > > > > The routine to compute the euler angles based on this composition is: > > > public static float[] getAngles(float matrix[]) { > > > > > > float[] angles = new float[3]; > > > double cosX; > > > > > > angles[0] = (float)Math.asin(-1*matrix[9]); // find X angle > > > > > > cosX = Math.cos(angles[0]); > > > angles[1] = (float)Math.atan2( -1*matrix[8]/cosX, > > matrix[10]/cosX ); // find Y angle > > > angles[2] = (float)Math.atan2( matrix[1]/cosX, matrix[5]/cosX > > ); // find Z angle > > > > > > return angles; > > > } // end of getAngles() > > > > > > > > > I have generated a Judoka0 test robot that will rotate itself about > > Y and stop at 45 Degree intervals and bend forward,backward, left, and > > right, and display the computed angles from this new routine. > > > The back_1 and back_2 servos are set to a rotation of +/- 0.5 rad at > > each test point. > > > Hopefully, this routine will work in all cases, such as after Coyote > > does a summersalt and rotates X around a full 2*pi radians. > > > > > > > > > Judoka0 Test Robot: > > > > > http://www.mikejost.com/cyberbotics/RotationMatrix/Judoka0_AngleTest.zip > > > > > > HTML version of Maple worksheet of General Rotation Matrix for > > R=Ry*Rx*Rz: > > > > > http://www.mikejost.com/cyberbotics/RotationMatrix/RotationMatrix.html > > > > > > > > > Mike Jost (FreeTIme) > > > > > > > > To unsubscribe from this group, send an email to: > > [email protected] > > > > > > > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ > > > > > > To unsubscribe from this group, send an email to: [email protected] Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/webots-contest/ To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/