Gazebo crashes when SDF model is spawned through launch file
I have a problem with spawning an SDF model (it is based on mesh), basically it is just a model of a table. I've tried this method link text of conversing SDF into URDF and then loading them both into parameter server but it doesn't work at all. When I launch my launch file, Gazebo starts, but there is no model to be seem in the world. Though it can be found in the list of all models. I click it, and then gazebo crashes. Here part of my SDF, defining its mesh:
<visual name='visual'>
<pose frame=''>0 0 0 1.5707 -0 0</pose>
<geometry>
<mesh>
<uri>/home/me/somebot_urdf_ws/src/somebot_urdf/Table/table_test/test_map.dae</uri>
<scale>0.001 0.001 0.001</scale>
</mesh>
</geometry>
</visual>
Here part of my launch file:
<param name="robot_description" textfile="$(find somebot_urdf)/Table/table_test/model.urdf"/>
<param name="robot_description_sdf" textfile="$(find somebot_urdf)/Table/table_test/model.sdf"/>
<node name="spawn_model" pkg="gazebo_ros" type="spawn_model" output="screen"
args="-sdf -param robot_description_sdf -model model -x 0.0 -y 0.0 -z 0.0"/>
What am I doing wrong? Also there is some strange message when gazebo crashes:
gzclient: /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/OgreMain/include/OgreAxisAlignedBox.h:252: void Ogre::AxisAlignedBox::setExtents(const Ogre::Vector3&, const Ogre::Vector3&): Assertion `(min.x <= max.x && min.y <= max.y && min.z <= max.z) && "The minimum corner of the box must be less than or equal to maximum corner"' failed.
Maybe it is somehow connected with the mesh, though I scale it down a lot. And there is no problems when I spawn it directly through Gazebo.
Does it still crash if you don't scale it down? Does it crash when you load it as SDF and then click on it? (the crash is coming from the moment you select and Gazebo tries to draw a white box around the model)
Thanks, the problem was hidden in the mesh. Gazebo could not accept an enormous mesh - it crashed before it was able to scale it down.
I also meet the same problem: the ground is black! The original color of ground is light grey, but now it changes to black. That's abnormal. Have you noticed this?
Well, when it launched it didn't crash instantly except the world was just empty. I looked in the list of models, clicked the model that I wanted to appear, then all went light light grey just as if my camera view was inside the model. Then it crashed. So I didn't see any black.
@littleghost, I moved your answer to a comment. Please don't ask questions in answers; comment or ask a new question instead. Cheers.