Quantcast

p2dProxy.GetYaw() problem

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

p2dProxy.GetYaw() problem

light86
hi every body
this my code
y=p2dProxy.GetYaw  (); the value of y is 1.570796x

when i test the value of y(
if y=1.570796x printf ("sucess");
it don't work please help me

Thank you
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: p2dProxy.GetYaw() problem

Fred Labrosse
On Friday 10 May 2013 09:11:32 light86 wrote:
> hi every body
> this my code
> y=p2dProxy.GetYaw  (); the value of y is 1.570796x
>
> when i test the value of y(
> if y=1.570796x printf ("sucess");
> it don't work please help me
>
> Thank you

This is not a player issue but a programming one.  You need to look at how
numbers are represented and the fact that they are (almost) always
approximations (for example, a computer, using "normal" math libraries cannot
represent 2/3).

In your case it is likely that the value in fact needs many more digits to get
its actual value (unless otherwise specified, displaying a float only displays
a few of the digits).

Testing for equality is rarely the correct thing to do as equality is rather
unusual when one talks about robotics.

Hope this helps.

Fred

>
>
>
> --
> View this message in context:
> http://player-stage-gazebo.10965.n7.nabble.com/p2dProxy-GetYaw-problem-tp18
> 784.html Sent from the playerstage-developers mailing list archive at
> Nabble.com.
>
> ----------------------------------------------------------------------------
> -- Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and
> their applications. This 200-page book is written by three acclaimed
> leaders in the field. The early access version is available now.
> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
> _______________________________________________
> Playerstage-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-developers

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Playerstage-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-developers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: p2dProxy.GetYaw() problem

light86
please how i can get the complete value of yaw speed
Thank you
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: p2dProxy.GetYaw() problem

Richard Vaughan-5
In reply to this post by light86
You are assigning to y rather than testing equality with that single =
sign. That's in addition to the problem mentioned in the other reply.

Please take some basic C programming training so that you are prepared
to use Player.

Sent from a mobile gadget

On 2013-05-10, at 18:11, light86 <[hidden email]> wrote:

> hi every body
> this my code
> y=p2dProxy.GetYaw  (); the value of y is 1.570796x
>
> when i test the value of y(
> if y=1.570796x printf ("sucess");
> it don't work please help me
>
> Thank you
>
>
>
> --
> View this message in context: http://player-stage-gazebo.10965.n7.nabble.com/p2dProxy-GetYaw-problem-tp18784.html
> Sent from the playerstage-developers mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and
> their applications. This 200-page book is written by three acclaimed
> leaders in the field. The early access version is available now.
> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
> _______________________________________________
> Playerstage-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-developers

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Playerstage-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-developers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: p2dProxy.GetYaw() problem

Fred Labrosse
In reply to this post by light86
On Friday 10 May 2013 09:36:19 light86 wrote:
> please how i can get the complete value of yaw speed
> Thank you
>

In fact, my explanation was incomplete.

It is very unlikely that you will get the same value again.  Certainly I would
not rely on that happening again in my programs.  What you should do is

if ((yaw > 1.54 - epsilon) && (yaw < 1.54 + epsilon))
   Do whatever you need to do

where 1.54 is the value you want (I don't have the original message any more)
and epsilon is the error you are prepared to accept.

Hope this helps.

Fred


>
>
> --
> View this message in context:
> http://player-stage-gazebo.10965.n7.nabble.com/p2dProxy-GetYaw-problem-tp18
> 784p18786.html Sent from the playerstage-developers mailing list archive at
> Nabble.com.
>
> ----------------------------------------------------------------------------
> -- Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and
> their applications. This 200-page book is written by three acclaimed
> leaders in the field. The early access version is available now.
> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
> _______________________________________________
> Playerstage-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-developers

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Playerstage-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-developers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: p2dProxy.GetYaw() problem

Fred Labrosse
In reply to this post by Richard Vaughan-5
On Friday 10 May 2013 18:43:22 Richard Vaughan wrote:
> You are assigning to y rather than testing equality with that single =
> sign. That's in addition to the problem mentioned in the other reply.
>

Oops, I missed that one!

Fred


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Playerstage-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-developers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: p2dProxy.GetYaw() problem

light86
In reply to this post by Fred Labrosse
Thank you.
Loading...