ompl/ompl — pull request #31 by davetcoleman (2014-08-12 10:13:19+00:00)
Title: Visualize callback

I think OMPL needs some more tools for introspection, so I'm proposing this callback that is very flexible but essentially can be used to visualize each step of a planner, e.g. each time an edge or vertex is added it can be visualized in OMPLapp, [ompl_visual_tools](https://github.com/davetcoleman/ompl_visual_tools) (for ROS), etc.

You can see how I am using this on the client-side [here](https://github.com/davetcoleman/ompl_visual_tools/blob/395b7593458aef5d8dad33350e842bda1f385862/src/ompl_visual_tools.cpp#L744)
```
void OmplVisualTools::visualizationCallback(ompl::base::Planner *planner)
{
ROS_ERROR_STREAM_NAMED("temp","visualizationCallback called");

ompl::base::PlannerDataPtr data(new ompl::base::PlannerData(si_));
planner->getPlannerData(*data);

publishGraph( data, moveit_visual_tools::PURPLE );
publishSamples( data );
ros::Duration(0.1).sleep();
}

ompl::base::VisualizationCallback OmplVisualTools::getVisualizationCallback()
{
return boost::bind(&OmplVisualTools::visualizationCallback, this, _1);
}
```

Then on the planner-side, I call ``visualizeCallback()`` whenever the graph/tree is modified, and I can watch the planner work in real-time.

I chose to pass a pointer of the planner in the callback rather than PlannerData because I wanted
- Flexibility and generic-ness to any planner's data and visualization needs
- So that the entire feature can easily be disabled without still always calling getPlannerData(), which can in some cases be an expensive operation

This is a bold pull request for me, so I understand if its not a desired feature (but I'm still going to use it)