#207 Fix struct player_pose_t

closed
player (137)
5
2007-07-16
2007-04-27
oscgg22
No

Hi,
in the file "~/libplayercore/player.h" the struct player_pose_t is:
/** @brief A pose in the plane */
typedef struct player_pose{
/** X [m] */
float px;
/** Y [m] */
float py;
/** yaw [rad] */
float pa;
} player_pose_t;

This should be instead:
/** @brief A pose in the plane */
typedef struct player_pose{
/** X [m] */
double px;
/** Y [m] */
double py;
/** yaw [rad] */
double pa;
} player_pose_t;

This has to be defined in this way because in the position2d proxy (~/client_libs/libplayerc/playerc.h) the poses are defined as doubles but in the player core (struct player_pose_t) are floats then, when internally assignments are made, truncations can happen. For example, when you work with GPS in UTM and in millimeters.

Discussion

  • Brian Gerkey

    Brian Gerkey - 2007-04-30

    Logged In: YES
    user_id=211013
    Originator: NO

    Are you saying that floats don't provide enough precision to represent GPS poses in meters?

     
  • Nobody/Anonymous

    Logged In: NO

    No, a float to meters is enough but it isn't enough to decimeters or centimeters. The problem is when you have a system GPS (base + rover) with centimetric precision (precision less or equal to 2 cm). This give you coordinates like, for example, 261539.47 easting and 4677965.25 northing (both are in meters). If you make the next test:

    int main(){
    double ed, nd;
    float ef, nf;

    ed = 261539.47;
    nd = 4677965.25;

    ef = ed;
    nf = nd;

    fprintf(stderr,"Easting: double=%f\t float=%f\n",ed, ef);
    fprintf(stderr,"Northing: double=%f\t float=%f\n",nd, nf);
    }

    The result is:
    Easting: double=261539.470000 float=261539.468750
    Northing: double=4677965.250000 float=4677965.000000

    The errors are |261539.470 - 261539.468750| = 0.125 cm easting and |4677965.320 - 4677965.50| = 25 cm northing. Easting error can't be considered like an error but northing error yes. Software is introducing more error in position than system GPS.

    Why does precision has to be lost because of software?

    The problem is worse if you have northing coordinates like, for example, 9677965.50. In this case, the error is 50 cm.
    Northing: double=9677965.500000 float=9677966.000000

     
  • Brian Gerkey

    Brian Gerkey - 2007-05-02

    Logged In: YES
    user_id=211013
    Originator: NO

    Hmm, that's a compelling demonstration of the problem. I'll put this on the roadmap for 2.1.

     
  • Toby Collett

    Toby Collett - 2007-07-12

    Logged In: YES
    user_id=974361
    Originator: NO

    This is now done in player cvs

     
  • Toby Collett

    Toby Collett - 2007-07-16
    • status: open --> closed
     
  • Nobody/Anonymous

    XfoFnY <a href="http://lifxtgnhyczs.com/">lifxtgnhyczs</a>, [url=http://dotzfvpgdyej.com/]dotzfvpgdyej[/url], [link=http://isagtmjdnlhi.com/]isagtmjdnlhi[/link], http://ylyuwxbflybk.com/

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks