ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As @gvdhoorn explained in commentaries, there is no loss of information, but effectively std::cout must be tuned for displaying decimals.

It is possible by the following lines:

std::cout << std::fixed;
std::cout << std::setprecision(7); //display 7 first decimals
std::cout << "pose " << input->pose.pose.position.x << std::endl;

Anyway using big values are not a good solution overall if you are using other libraries that do not accept "double" precision.

The best I could do for now is shift the coordinates to the first position received and put it as the origin. This workaround must be changed (explained in the commentaries) if the robot is moving over huge distance.

NB: the original problem was due to a third party library that did not have enough precision to show a position difference between two different position because it could deal only with floating numbers, and this error has been spreaded into the message!