Closed nickponline closed 6 years ago
The library can work with float
or double
. The executable pmicp
used float
by default.
You can change this line for:
typedef PointMatcher<double> PM;
Do you think that is actually the issue, that's shouldn't cause the output value to be rounded to whole numbers?
From a C++ tutorial:
When outputting floating point numbers, std::cout has a default precision of 6 -- that is, it assumes all floating point variables are only significant to 6 digits, and hence it will truncate anything after that.
This would explain 539719.26
converted to 539719
and clearly 4065740.41
to 4.06574e+06
.
Computing with floating point is faster than double precision, but I saw your problem when working with GPS coordinates. If you want to keep the computational speed, you can express your point cloud in a temporary frame that subtracts the repetitive information.
Did you try to change the template to double
?
Yeah I did try changing float to double. I will try centering the data by subtracting the mean. In general is that a good practice?
On Tue, Oct 17, 2017 at 9:54 AM, François Pomerleau < notifications@github.com> wrote:
From a C++ tutorial:
When outputting floating point numbers, std::cout has a default precision of 6 -- that is, it assumes all floating point variables are only significant to 6 digits, and hence it will truncate anything after that.
This would explain 539719.26 converted to 539719 and clearly 4065740.41 to 4.06574e+06.
Computing with floating point is faster than double precision, but I saw your problem when working with GPS coordinates. If you want to keep the computational speed, you can express your point cloud in a temporary frame that subtracts the repetitive information.
Did you try to change the template to double?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ethz-asl/libpointmatcher/issues/226#issuecomment-337283816, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkBRyboNMyKirSFh2q8M9SljAHWOMlSks5stNvbgaJpZM4P662G .
That's what is happening inside libpm anyway to properly resolve the rotations. So, there should be no harm in doing so to preserve the floating precision at the right place for meters.
Hi @pomerlef
I registered a pointcloud to itself as a test and it appears to round the x and y values to the nearest whole number:
Since my data is in meters the rounding is significant. I used the example
pmicp
binary.Nick