How are you creating the roads? It doesn't look like the default one that's created by the <road> sdf element. Is it a <model> with your own mesh?
The roads are created by a plugin with custom material. I figured out that this issue ONLY occurs when the camera is inserted from the "insert" tab bar when gazebo is already running. When the camera is loaded from a world-file at startup, everything is shown normal.
ok. Can you give more details on how the model is created in the plugin? Did you create the roads by publishing an SDF string to ~/factory topic?
If the model only shows up in gzclient, one reason could be that it's a client-side only visual. In order for a model to show in the camera sensor, it has to be spawned on the server side.
this issue appears with Gazebo 6.5.1 as well as with Gazebo 8.6.0. We have implemented a WorldPlugin, which parses a RoadNetwork and then heuristically converts the roads into road messages, which are published over a registered publisher:
m_road_publisher=m_node->Advertise<msgs::Road>("~/roads",10000);// publish for visualization
Irrespectively, wether custom or the default gazebo road textures are used, such message looks like:
We have recognized that the gzclient as well as the server gets problems, if we publish a bunch of messages, starting from publishing ~20 messages (for each road segment or intersection a separate one): Some roads are visualized and some are not. This even differs between the gzclient and the elements visualized on the gzserver (captured by a virtual camera). We attached an exemplary screenshot to demonstrate this effect:
Varying the publishing rate of the publisher to 50, but also 100Hz seems also to worsen the problem. We assume that this is due to lost messages between the pugin's publisher and the gzclient and gzserver-specific subscriber.
I had this problem when loading a world file with <road> elements and spawning a model with a camera sensor. I found a workaround and opened pull request #3097