OctoMap / octomap_rviz_plugins

RViz display plugins for visualizing octomap messages in ROS
http://ros.org/wiki/octomap_rviz_plugins
89 stars 63 forks source link

OccupancyGridStamped Rviz plugin crashed #25

Closed fredd2409 closed 4 years ago

fredd2409 commented 7 years ago

Hi, I'm publishing an OcTreeStamped and want to visualize it with RVIZ. However, when I set the topic /octomap for the plugin in RVIZ, RVIZ crashes completely. I've tried it on three different computers with Ubuntu 16.04 and ROS Kinetic. One computer gives "Segmentation fault (core dumped)". The other two only give "process has died [pid 4342, exit code -11...".

Is this a known issue?

ahornung commented 7 years ago

I don't think there's a working visualization for OcTreeStamped, and probably there's not a proper check in place to catch that error.

fredd2409 commented 7 years ago

I see. I assumed that there was because I can choose the plugin OccupancyGridStamped in RViz and also the code is templated to OcTreeStamped.

So is there are an obvious reason that this wouldn't work with OcTreeStamped? The data structures aren't fundamentally different (actually not at all?), right?

Via debugging, I've located that the segmentation fault occurs in this line: std::size_t octree_depth = octomap->getTreeDepth(); (Line 492, occupancy_grid_display.cpp) But the error only occurs with the OcTreeStamped, not with regular OcTree. On the other hand, the getTreeDepth() works fine with OcTreeStamped in other functions.

Any quick ideas? Otherwise I'll try to find a fix myself.

Thanks anyway for the quick reply!

fredd2409 commented 7 years ago

I found the problem. It's that octomap_msgs::msgToMap, or more specifically binaryMsgToMap does not handle OcTreeStamped but only OcTree and ColorOcTree and then returns null. Probably the same issue as here. It works when OcTreeStamped is added to that function.

ploverpang commented 4 years ago

I found the problem. It's that octomap_msgs::msgToMap, or more specifically binaryMsgToMap does not handle OcTreeStamped but only OcTree and ColorOcTree and then returns null. Probably the same issue as here. It works when OcTreeStamped is added to that function.

Does Anyone fix this bug?

wxmerkt commented 4 years ago

Apparently it should be fixed, cf. https://github.com/OctoMap/octomap_msgs/commit/2b390b684782dbed0ad244dbf75923522c40a2f2

Did you encounter this issue? And if so, what versions of octomap_rviz_plugins are you running on which platform?