Gazebo | Ignition | Community
Ask Your Question
0

Gazebo crashes when SDF model is spawned through launch file

asked 2018-11-09 12:20:03 -0600

roskicker gravatar image

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. image description 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.

edit retag flag offensive close merge delete

Comments

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)

chapulina gravatar imagechapulina ( 2018-11-09 13:57:50 -0600 )edit

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.

roskicker gravatar imageroskicker ( 2018-11-09 15:04:08 -0600 )edit

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?

littleghost gravatar imagelittleghost ( 2018-11-09 22:17:44 -0600 )edit

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.

roskicker gravatar imageroskicker ( 2018-11-10 14:37:28 -0600 )edit

@littleghost, I moved your answer to a comment. Please don't ask questions in answers; comment or ask a new question instead. Cheers.

chapulina gravatar imagechapulina ( 2018-11-12 11:21:31 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-11-09 15:00:40 -0600

roskicker gravatar image

updated 2018-11-09 15:02:45 -0600

Okay, I've got the problem - the mesh was bad (very huge). Redesign helped, the primary scale (in graphics program) needed to be fixed (lessen the mesh). For those who are beginners, to spawn a simple SDF you need just to:

<param name="robot_description_sdf" textfile="$(find somebot_urdf)/Table/v140/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"/>

The second .urdf file in simple cases is not necessary. Now Gazebo works perfectly without crashes.

edit flag offensive delete link more

Comments

It was that status when I only run the Gazebo without load any meshes. And it didn't crashed, it just went black.

littleghost gravatar imagelittleghost ( 2018-11-12 20:53:28 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-11-09 12:17:26 -0600

Seen: 1,773 times

Last updated: Nov 09 '18