ros-visualization/rviz — pull request #724 by hersh (2014-02-19 02:17:11+00:00)
Title: Fix mesh bug in moveit_ros/visualization.

This fixes https://github.com/ros-planning/moveit_ros/issues/348.

This class could be streamlined by entirely removing the ```entity_``` member and never calling convertToMesh(), since ManualObjects can be added to SceneNodes just like Entities. There is no need for the intermediary. In fact, this is probably leaking mesh objects into Ogre that are never cleaned up. This change is smaller to just fix the bug so I don't need to think about side effects immediately.

The bug happens because the calling code is frequently destroying and re-creating these objects (that is a bad idea, I know, but someone else wrote it) and so the same pointer value is frequently re-used for a different mesh. But since we've baked the pointer value into the mesh name that we gave Ogre, we often get the wrong mesh showing up. Sigh. This just replaces the string-ified pointer with an always-incrementing counter.