Closed raabuchanan closed 4 years ago
gazebo used to automatically name included models without an explicit <name>
tag to model_1
, model_2
, etc. This seems to be no longer the case. One must explicitly set unique names now. gazebo2rviz relies on included model names being identical to the model name (as specified in the uri) except the _n
suffix above.
Thus the following works:
<?xml version="1.0" ?>
<sdf version="1.5">
<world name="default">
<!-- A global light source -->
<include>
<uri>model://sun</uri>
</include>
<!-- A ground plane -->
<include>
<uri>model://ground_plane</uri>
</include>
<include>
<uri>model://beer</uri>
<pose>0 0 0 0 0 0</pose>
<name>beer_1</name>
</include>
<include>
<uri>model://beer</uri>
<pose>1 0 0 0 0 0</pose>
<name>beer_2</name>
</include>
<include>
<uri>model://beer</uri>
<pose>0 2 0 0 0 0</pose>
<name>beer_3</name>
</include>
</world>
</sdf>
Background: The topic /gazebo/model_states
only provides the instantiated model name, but no information about the model origin (e.g. uri), thus gazebo2rviz has to rely on such naming conventions to work.
I want to spawn multiple copies of a model from a launch file so I am using
name
tag like so:But if I use the
name
tag then gazebo2rviz doesn't work and the model isn't visible in rviz. gazebo2marker doesn't publish anything. Removing the tag fixes the issues but then I can only have one copy of the model in a world at a time.