Re: Problem with Euler Angles
"fransklip" <[email protected]>
| Newsgroups | gmane.comp.cybernetics.webot.contest |
|---|---|
| Message-ID | <[email protected]> |
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) ------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511 http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/pU_rlB/TM ---------------------------------------------------------------------~-> 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/