Re: eurler angles
Marton Laszlo <[email protected]> Wed, 4 Aug 2004 02:51:50 -0700 (PDT)
| Newsgroups | gmane.comp.cybernetics.webot.contest |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I think you did forgot to initialize the gps matrix.
On webost you need to initialize (swich on) every
device what you use.
You need to put an initialization code somewhere
before your infinite loop.
gps_enable(gps,32);
in case of the gps martix.
public static void main() {
...
gps_enable(gps,32);
...
for(;;)
{ // The robot never dies!
.....
matrix=gps_get_matrix(gps); // OpenGL 4x4 matrix
eul = gps_euler(matrix);
szog[0] = (int) (eul[0]*180/Math.PI);
szog[1] = (int) (eul[1]*180/Math.PI);
szog[2] = (int) (eul[2]*180/Math.PI);
.... // I use the angels in grades not radians
}
}
Regards,
RoboMarci, Márton Lászó
--- Gerald Iakobinyi Pich <[email protected]> wrote:
> A snapshot from my code....
>
> regards
> nutrina
>
>
> --- joseoomartin <[email protected]> schrieb:
>
> ---------------------------------
> Hi all, can anybody help ?
>
> The euler angles does not work for me...
>
> i am using it in this manner :
>
> matrix = gps_get_matrix(gps);
> euler_vector= eulerAngles(matrix);
> phiX =euler_vector[0];
> phiY =euler_vector[1];
> phiZ =euler_vector[2];
> tilt = (float)Math.sqrt(Math.pow(phiX,2) +
> Math.pow(phiZ,2));
> System.out.println("Inclinacion "+tilt+ " Valor X:
> "+
> phiX + " Valor
> Z: "+phiZ);
>
> But always including the robot on the floor, Tilt =
> 0
> , phiX -0 ,
> phiZ =0 , ... Why ???
>
> Thanks....
> Gladiator...
>
>
>
>
> Yahoo! Groups Sponsor ADVERTISEMENT
>
>
> ---------------------------------
> 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 the
> Yahoo!
> Terms of Service.
>
>
>
>
>
>
>
>
___________________________________________________________
> Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher
> kostenlos - Hier anmelden: http://mail.yahoo.de
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> Make a clean sweep of pop-up ads. Yahoo! Companion
> Toolbar.
> Now with Pop-Up Blocker. Get it for free!
>
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/pU_rlB/TM
>
--------------------------------------------------------------------~->
>
>
>
> Yahoo! Groups Links
>
>
> [email protected]
>
>
> >
> nutrina.openGLMatrix =
> Controller.gps_get_matrix(nutrina.gps);
> nutrina.argASin = -1D *
> (double)nutrina.openGLMatrix[9];
> nutrina.eul =
> Controller.gps_euler(nutrina.openGLMatrix);
> nutrina.angles[0] = (float)((double)(nutrina.eul[0]
> * 180F) / 3.1415926535897931D);
> nutrina.angles[1] = (float)((double)(nutrina.eul[1]
> * 180F) / 3.1415926535897931D);
> nutrina.angles[2] = (float)((double)(nutrina.eul[2]
> * 180F) / 3.1415926535897931D);
> if(nutrina.angle[2] < -40F || nutrina.angles[2] >
> 40F)
> {
> nutrina.RoboDown = true;
> nutrina.RoboDownOnSide = true;
> } else
> if(nutrina.angles[0] < -40F || nutrina.angles[0] >
> 40F)
> {
> nutrina.RoboDown = true;
> nutrina.RoboDownBckd = !(nutrina.RoboDownFwd =
> nutrina.angles[0] > 0.0F);
> if(nutrina.RoboDownFwd)
> System.out.println("robo down forward");
> else
> System.out.println("robo down backward");
> } else
> {
> nutrina.RoboDown = nutrina.RoboDownFwd =
> nutrina.RoboDownBckd = false;
> }
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/pU_rlB/TM
--------------------------------------------------------------------~->
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/