How to detect when an interactive marker is selected?
I'm writing an Rviz plugin that lets users control the most-recently touched interactive marker with a 3d mouse or haptic device. I'm trying to learn the Rviz / Ogre architecture as I go, so please bear with me.
The only problem I have is how to 'capture' the event where an interactive marker is selected. From within my plugin, I want to know when an interactive marker is clicked with the mouse, and then store the pointer to that marker so I can send events to it later.
I'm beginning to wonder if this is even possible. It seems that when the user clicks a marker, processMouseEvent() and handleMouseEvent() is fired through the chain of interaction_tool and interactive_marker_control. I'm not sure how an external plugin could hook into this to capture the marker.
Do you have any suggestions?
(note: originally posted at https://github.com/ros-visualization/rviz/issues/670)
EDIT: To clarify, based on responses in the Github issue- I want users to still be able to interact with the markers using the mouse. Whichever marker they clicked on most recently, I want to store as a pointer in my own plugin. I'll then call handle3DCursorEvent() on the marker to control it using the 3d device. My problem is just initially capturing and storing the pointer to the marker.