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

"Failed to create octree structure" when subscribing to octomap_full #1

Closed PierrickKoch closed 11 years ago

PierrickKoch commented 11 years ago

On the latest Groovy package, in rviz, after adding either an occupancy_map or an occupancy_grid, when I set the topic to /octomap_full, I get the error: "Failed to create octree structure", and if I set it to /octomap_binary, rviz crash.

jihoonl commented 11 years ago

I'm getting this error too. Does anyone know how to fix this?

ahornung commented 11 years ago

I assume the crash is the one reported in issue #2?

jihoonl commented 11 years ago

Yes. It is the same crash. But it still does not porovide octomap_full topic.

ahornung commented 11 years ago

Apparently it's only implemented for binary messages right now. If you have a devel checkout / overlay, that should be easy to fix if you can test it. Change line 292 of occupancy_grid_display.cpp fromoctomap::OcTree* octomap = octomap_msgs::binaryMsgToMap(*msg); to

  octomap::AbstractOcTree* tree = octomap_msgs::msgToMap(*msg);
  octomap::OcTree* octomap = dynamic_cast<OcTree*>(tree);

(and the same for the corresponding line in `occupancy_map_display.cpp``=

sotte commented 11 years ago

Great, your solution worked for me!

I don't know if you have a fixed way to deal with bug fixes for multiple versions therefore I just created a simple pull request.

Best, Stefan

ahornung commented 11 years ago

Pull request is perfect, thanks for the patch and the feedback that it worked! Fixed in groovy-devel, will be part of the next release (and hydro as well).