Re: p2dProxy.GetYaw() problem
Fred Labrosse <[email protected]>
| Newsgroups | gmane.science.robotics.playerstage |
|---|---|
| Organization | Aberystwyth University |
| Message-ID | <1935968.ckq7dUvqcW@pcp2ffl> |
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
> [email protected]
> 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