Adding dynamic markings on ground plane
I am working on a janitorial robot. I would like to simulate patches on the ground plane (plain black square patches), make the robot detect these via cameras and simulate the cleaning task. However only the area cleaned by the robot should disappear in the patch. For example if the patch is a 1x1 square and the robot manages to clean only the upper left corner of it, I need only that portion to disapper. What is the best way to simulate this in gazebo? These are my attempts so far:
Visual markers in gazebo8+ - gazebo examples
Triangulated the whole square and used TRIANGLE_LIST visual markers. However the marker manager for gazebo isn't initialised on the server side (from these lines) making these markers invisible to sensors like cameras. These are only visible in the GUI.
Visual plugin loaded to ground plane
I wrote a visual plugin and loaded it to the ground plane. Managed to use the DynamicLines class to render triangles (again, triangulated the whole square and used RENDERING_TRIANGLE_LIST as render operation type for the lines), following this answer. Changed visibility type to GZ_VISIBILITY_ALL
instead of GZ_VISIBILITY_GUI
to make it visible to cameras. But the behaviour in this case is quite strange. Gazebo renders the visual either in the GUI or in the camera but not both, and this varies randomly during different runs.
What is the best way to simulate this feature in gazebo??
Setup: Gazebo 11.6 + ROS Noetic on Ubuntu 20.04