ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hi David, as Ruben indicates, your spawner of the model is not failing. I see two problems in your situation:
1- You forgot to include the <inertial>
section in each of the links of the robot. For some reason, Gazebo 7 does not show the model of the robot if you do not include an <inertial>
section in each one with the proper values.
In order to include the <inertial>
include the following just after the <link>
tag:
<inertial>
<origin xyz="0 0 0" rpy="0 0 0"/>
<mass value="1.0" />
<inertia ixx="0.0741666666667" ixy="0.0" ixz="0.0" iyy="0.0585416666667" iyz="0.0" izz="0.0260416666667"/>
</inertial>
Bear in mind that those inertia values are just an example. You must calculate the proper ones for each link.
2- Because Gazebo is not showing to you the model (because of the lack of <inertial>
) you believe that the spawner node is not working, but it is. Actually, if you call the gazebo service for getting the state of the world it will tell you that your model is there (even if you cannot see it): rosservice call /gazebo/get_world_properties
So the error you mention above, is not an actual error: when the spawner node has spawned the model, it dies (its job is completed), but because you have put the respawn
parameter to true
, the node will re-start and try to spawn again the same model with the same name inside the simulation. Since the model already exists in the simulation with that name (even if you cannot see it), then the spawner complains indicating that there is an error.
Summarizing, just, put the respawn to false
.
I have created a video that shows how all that work, and why you are getting the errors. You can find it here: video explanation with example