Writing map.ot file generates lines with the same adress

asked 2019-07-14 06:53:19 -0500

RSA_kustar gravatar image

updated 2019-07-14 06:55:14 -0500

Hi,

I am trying to save the octomap in ".ot" format and visualize it using octovis. I installed a sample file for the map.ot file from http://ais.informatik.uni-freiburg.de.... I can visualize the file using octovis. Here are the first ten lines from the example file.

2320 4f63 746f 6d61 7020 4f63 5472 6565
2066 696c 650a 2320 2866 6565 6c20 6672
6565 2074 6f20 6164 6420 2f20 6368 616e
6765 2063 6f6d 6d65 6e74 732c 2062 7574
206c 6561 7665 2074 6865 2066 6972 7374
206c 696e 6520 6173 2069 7420 6973 2129
0a23 0a69 6420 4f63 5472 6565 0a73 697a
6520 3333 3035 3533 340a 7265 7320 302e
3035 0a64 6174 610a bab4 6040 ffba b460
4080 bab4 6040 80ba b460 4080 bab4 6040

While the first 10 lines from the file that I generated is as follows:

6b78 5e40 0080 8080 6b78 5e40 0080 8080
6b78 5e40 0080 8080 6b78 5e40 0080 8080
6b78 5e40 0080 8080 6b78 5e40 0080 8080
6b78 5e40 0080 8080 6b78 5e40 0080 8080
6b78 5e40 0080 80c0 6b78 5e40 0080 80c0
6b78 5e40 0080 80c0 82e8 d83f 0080 8080
82e8 d83f 0080 8080 82e8 d83f 0080 80b0
82e8 583f 0080 8000 82e8 d83f 0080 8000
82e8 583f 0080 8000 6b78 5e40 0080 80f0
82e8 583f 0080 8080 82e8 583f 0080 8020

First of all, I cannot visualize my file in octovis although I can visualise the sample file. They have the same format which is:

  s.write((const char*)&value, sizeof(value));  // occupancy
  s.write((const char*)&color, sizeof(Color));  // color

When I tried to visualize it using the function read and see the octomap in RVIZ, the map was fine but all the voxels are shown in white. Also, why I have repeated lines in my file?

How can I make sure that when I save the file, I can visualize it in octovis? Also, Is there any mistake in my way of saving the file?

edit retag flag offensive close merge delete