Error with octomap_server: "process has died, exit code -6" [closed]
I am trying to use octomap_server
(octomap_mapping.launch
file) for building a 3D map using point cloud data from velodyne. So i drive my robot around, record all sensor data for octomap_server
to post process it on my desktop. I really want to play the rosag at slower rate so that I can get a better 3D map, but unfortunately the slower I run the rosbag more I get the following error (process has died, exit code -6):
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Once this error occurs, I have to restart octomap_server
and then I loose the previously saved 3D map. If I play my rosbag
at more than 2x speed, then octomap_server
doesn't fail but I don't get a good 3D map. Does someone have anything on why am I getting this error?
Also, sometimes the following error pops up, I don't know what that means but it doesn't seem to effect octomap processing. Can someone throw some light on this too.
[ERROR] [1412812984.342799452]: Error serializing OctoMap
std::bad_alloc
means that your process failed to allocate memory. How much memory is the octomap server using before it crashes?I have a 4 core processor with 16GB RAM. Observing
top
for few runs, I observed thatoctomap_server
process uses almost 100% of one core, and the memory usage grows up to 18.4% every time before it dies. Is there any way to allocate more space to the process, as I still have 60% of memory free.That's awfully close to 3GB. Are you running a 32-bit version of Ubuntu or a 32-bit version of octomap?
Most of the memory consumed by octomap_server is actually for the different kinds of visualizations, not for the octomap itself. You can reduce the memory usage by not subscribing to the PointCloud and voxel visualizations (they thus won't be created).
Instead, use the octomap_rviz_plugins package. It will directly create a visualization in RViz out of the serialized octomap.
@AHornung: I am using MarkerArray display in RViz on the topic "occupied_cells_vis_array", and changing it to display OccupancyGrid type message from octomap_rviz_plugin doesn't change anything. It still crashes.
I migrated to a 64-bit platform now. Everything works fine. Apparently, octomap_server is using up to ~5GB RAM which makes sure that I should not run octomap server in real time on a robot.