Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary read and write of log file is bugged #131

Closed
andresax opened this issue Sep 6, 2016 · 2 comments
Closed

Binary read and write of log file is bugged #131

andresax opened this issue Sep 6, 2016 · 2 comments
Labels

Comments

@andresax
Copy link

andresax commented Sep 6, 2016

Hi,

thanks for the great tool you made available for the whole community.

I found an issue during the data import of a log file. In the PointCloud.cpp source the binary read and write are not symmetric, and so the reading fails.
I'm referring in particular at:
https://github.com/OctoMap/octomap/blob/devel/octomap/src/Pointcloud.cpp#L287
and
https://github.com/OctoMap/octomap/blob/devel/octomap/src/Pointcloud.cpp#L313

where an unsigned int it is read, while a size_t is written.

I suggest also to fix line
https://github.com/OctoMap/octomap/blob/devel/octomap/src/Pointcloud.cpp#L294 with size_t instead of unsigned int.

Cheers,
Andrea

@ahornung
Copy link
Member

ahornung commented Sep 7, 2016

Good catch! We really need a unit test for these IO operations, just like the OcTree tests.

But I think the types should be fixed size to make it really portable. Just like unsigned int, size_t can be different on different platforms. Reference should be the existing graph files from the homepage (I think they were written with uint).

@ahornung
Copy link
Member

ahornung commented Oct 6, 2016

Fixed now.

ahornung added a commit that referenced this issue Jan 13, 2017
- uint32_t for size, move inttypes.h include into octomap_types.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants