Skip to content

Updating PlanningScene after clearOctomap #439

@simonschmeisser

Description

@simonschmeisser

Description

We use the following code to clear the Octomap:

m_planningSceneMonitor->clearOctomap();

// TODO: octomap is not updated visually with planningSceneMonitor->clearOctomap().
//       This workaround fixes the problem, but often causes a crash
planning_scene_monitor::LockedPlanningSceneRW ps(m_planningSceneMonitor);
    m_planningSceneMonitor->triggerSceneUpdateEvent(planning_scene_monitor::PlanningSceneMonitor::UPDATE_SCENE);

but shouldn't this update be triggered internally here?
https://github.com/ros-planning/moveit/blob/kinetic-devel/moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp#L498

void planning_scene_monitor::PlanningSceneMonitor::clearOctomap()
{
  octomap_monitor_->getOcTreePtr()->lockWrite();
  octomap_monitor_->getOcTreePtr()->clear();
  octomap_monitor_->getOcTreePtr()->unlockWrite();
}

Also I'm not sure about the locking necessary

I will provide a PR once I have the time and some feedback here

Your environment

  • ROS Distro: Kinetic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions