It can show table1(model),table2(model) but failed to show cereal_box(sdf).
I use gzsdf to translatefrom model file to sdf.
rosrun gazebo gzsdf print cereal_box.model > cereal_box.sdf
vim t1.launch
<launch>
<!-- start up empty world -->
<node name="gazebo" pkg="gazebo" type="gazebo" args="-u $(find gazebo_worlds)/worlds/empty.world" respawn="false" output="screen">
<env name="GAZEBO_RESOURCE_PATH" value="$(find pr2_ogre):$(find gazebo_worlds):$(find pr2_description):$(find gazebo_worlds):$(find gazebo)/gazebo/share/gazebo:." />
</node>
<!-- send urdf to param server -->
<param name="table1" textfile="/home/sam/code/ros/temp/ccrl_table.model" />
<node name="spawn_table1" pkg="gazebo" type="spawn_model" args="-gazebo -param table1 -x 0 -y -0.6 -z 0.0 -R 0 -P 0 -Y 0 -model table1" respawn="false" output="screen" />
<param name="table2" textfile="/home/sam/code/ros/temp/ccrl_table.model" />
<node name="spawn_table2" pkg="gazebo" type="spawn_model" args="-gazebo -param table2 -x 0 -y 0.6 -z 0.0 -R 0 -P 0 -Y 180 -model table2" respawn="false" output="screen" />
<param name="cereal_box" textfile="/home/sam/code/ros/temp/cereal_box.sdf" />
<node name="spawn_cereal_box" pkg="gazebo" type="spawn_model" args="-sdf -param cereal_box -x 0.35 -y -0.5 -z 0.715 -R 0 -P 0 -Y 0 -model cereal_box" respawn="false" output="screen" />
<!-- start gui -->
<node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen"/>
</launch>
sam@sam:~/code/ros/temp$ optirun roslaunch ./t1.launch
... logging to /home/sam/.ros/log/0d9f8da6-388f-11e2-aeff-e0b9a5f829db/roslaunch-sam-4621.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://sam:48406/
SUMMARY
========
PARAMETERS
* /robot_description
* /rosdistro
* /rosversion
* /table1
* /table2
NODES
/
gazebo (gazebo/gazebo)
gazebo_gui (gazebo/gui)
spawn_cereal_box (gazebo/spawn_model)
spawn_table1 (gazebo/spawn_model)
spawn_table2 (gazebo/spawn_model)
auto-starting new master
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[master]: started with pid [4646]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to 0d9f8da6-388f-11e2-aeff-e0b9a5f829db
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[rosout-1]: started with pid [4659]
started core service [/rosout]
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[gazebo-2]: started with pid [4671]
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[spawn_table1-3]: started with pid [4677]
Gazebo multi-robot simulator, version 1.0.2
Copyright (C) 2011 Nate Koenig, John Hsu, Andrew Howard, and contributors.
Released under the Apache 2 License.
http://gazebosim.org
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[spawn_table2-4]: started with pid [4679]
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[spawn_cereal_box-5]: started with pid [4692]
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[gazebo_gui-6]: started with pid [4711]
Msg Waiting for master
Msg Connected to gazebo master @ http://localhost:11345
[ INFO] [1354019785.526560667]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
Gazebo multi-robot simulator, version 1.0.2
Copyright (C) 2011 Nate Koenig, John Hsu, Andrew Howard, and contributors.
Released under the Apache 2 License.
http://gazebosim.org
loading model xml from ros parameter
[INFO] [WallTime: 1354019785.894103] waiting for service /gazebo/spawn_gazebo_model
Error: you must specify incoming format as either urdf or gazebo format xml
loading model xml from ros parameter
[INFO] [WallTime: 1354019785.943767] waiting for service /gazebo/spawn_gazebo_model
[ INFO] [1354019786.053411907]: joint trajectory plugin missing <updateRate>, defaults to 0.0 (as fast as possible)
[ INFO] [1354019786.089028786]: waitForService: Service [/gazebo/set_physics_properties] is now available.
Msg Waiting for master
Msg Connected to gazebo master @ http://localhost:11345
[spawn_cereal_box-5] process has finished cleanly
log file: /home/sam/.ros/log/0d9f8da6-388f-11e2-aeff-e0b9a5f829db/spawn_cereal_box-5*.log
[ INFO] [1354019786.151540830]: Starting to spin physics dynamic reconfigure node...
Warning [parser.cc:348] Gazebo SDF has no gazebo element
Warning [parser.cc:291] DEPRECATED GAZEBO MODEL FILE
On July 1st, 2012, this formate will no longer by supported
Convert your files using the gzsdf command line tool
You have been warned!
spawn status: SpawnModel: successfully spawned model
Warning [parser.cc:348] Gazebo SDF has no gazebo element
Warning [parser.cc:291] DEPRECATED GAZEBO MODEL FILE
On July 1st, 2012, this formate will no longer by supported
Convert your files using the gzsdf command line tool
You have been warned!
spawn status: SpawnModel: successfully spawned model
[spawn_table1-3] process has finished cleanly
log file: /home/sam/.ros/log/0d9f8da6-388f-11e2-aeff-e0b9a5f829db/spawn_table1-3*.log
[spawn_table2-4] process has finished cleanly
log file: /home/sam/.ros/log/0d9f8da6-388f-11e2-aeff-e0b9a5f829db/spawn_table2-4*.log
Warning [Visual.cc:689] Unable to get Material[Ias/DarkGray] for Geometry[table1::table_body::foot1_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/DarkGray] for Geometry[table1::table_body::foot2_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/DarkGray] for Geometry[table1::table_body::foot3_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/DarkGray] for Geometry[table1::table_body::foot4_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/DarkGray] for Geometry[table2::table_body::foot1_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/DarkGray] for Geometry[table2::table_body::foot2_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/DarkGray] for Geometry[table2::table_body::foot3_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/DarkGray] for Geometry[table2::table_body::foot4_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/DarkGray] for Geometry[table1::table_body::undertop_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/White] for Geometry[table1::table_body::tabletop_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/DarkGray] for Geometry[table2::table_body::undertop_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/White] for Geometry[table2::table_body::tabletop_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/LightBrown] for Geometry[table1::table_body::back_plate_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/LightBrown] for Geometry[table2::table_body::back_plate_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/CCRLCalibPlate] for Geometry[table1::table_body::calibration_plate_visual. Object will appear white
Warning [Visual.cc:689] Unable to get Material[Ias/CCRLCalibPlate] for Geometry[table2::table_body::calibration_plate_visual. Object will appear white
LightListWidget::OnLightMsg
^C[25053.959737] [WARN]Received Interrupt signal.
[gazebo_gui-6] killing on exit
[gazebo-2] killing on exit
gzclient: Fatal IO error 11 (Resource temporarily unavailable) on X server :8.
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":8"
after 394 requests (394 known processed) with 0 events remaining.
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
sam@sam:~/code/ros/temp$
My cereal_box.sdf:
<gazebo version='1.0'>
<model name='cereal_box' static='0'>
<origin pose='0.000000 0.000000 0.000000 0.000000 -0.000000 0.000000'/>
<link name='box_body' gravity='1' self_collide='0' kinematic='0'>
<origin pose='0.000000 0.000000 0.000000 0.000000 -0.000000 0.000000'/>
<inertial mass='1.000000' density='1.000000'>
<inertia ixx='1.000000' ixy='0.000000' ixz='0.000000' iyy='1.000000' iyz='0.000000' izz='1.000000'/>
</inertial>
<collision name='box_geom' laser_retro='0.000000'>
<origin pose='0.000000 0.000000 0.130000 0.000000 -0.000000 0.000000'/>
<geometry>
<box size='0.052000 0.195000 0.260000'/>
</geometry>
<surface>
<friction>
<ode mu='-1.000000' mu2='-1.000000' fdir1='0.000000 0.000000 0.000000' slip1='0.000000' slip2='0.000000'/>
</friction>
<bounce restitution_coefficient='0.000000' threshold='100000.000000'/>
<contact>
<ode soft_cfm='0.000000' soft_erp='0.200000' kp='1000000000000.000000' kd='1.000000' max_vel='100.000000' min_depth='0.001000'/>
</contact>
</surface>
</collision>
<visual name='box_geom_visual' cast_shadows='1' laser_retro='0.000000' transparency='0.000000'>
<origin pose='0.000000 0.000000 0.130000 0.000000 -0.000000 0.000000'/>
<geometry>
<mesh filename='nestle_cereal_box.dae' scale='1.000000 1.000000 1.000000'/>
</geometry>
</visual>
</link>
</model>
</gazebo>
How to fix it?
Thank you~
====================================================
My nestle_cereal_box.dae:
<?xml version="1.0" encoding="utf-8"?>
<COLLADA version="1.4.0" xmlns="http://www.collada.org/2005/11/COLLADASchema">
<asset>
<contributor>
<author>Illusoft Collada 1.4.0 plugin for Blender - http://colladablender.illusoft.com</author>
<authoring_tool>Blender v:249 - Illusoft Collada Exporter v:0.3.162</authoring_tool>
<comments></comments>
<copyright></copyright>
<source_data>file://</source_data>
</contributor>
<created>2010-10-31T20:18:28.191759</created>
<modified>2010-10-31T20:18:28.191776</modified>
<unit meter="0.01" name="centimeter"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_effects>
<effect id="tex_png-fx" name="tex_png-fx">
<profile_COMMON>
<newparam sid="tex_png-surface">
<surface type="2D">
<init_from>tex_png-img</init_from>
<format>A8R8G8B8</format>
</surface>
</newparam>
<newparam sid="tex_png-sampler">
<sampler2D>
<source>tex_png-surface</source>
<minfilter>LINEAR_MIPMAP_LINEAR</minfilter>
<magfilter>LINEAR</magfilter>
</sampler2D>
</newparam>
<technique sid="blender">
<phong>
<emission>
<color>0.00000 0.00000 0.00000 1</color>
</emission>
<ambient>
<color>1.0000 1.0000 1.0000 1</color>
</ambient>
<diffuse>
<texture texcoord="CHANNEL1" texture="tex_png-sampler"/>
</diffuse>
<specular>
<color>0.50000 0.50000 0.50000 1</color>
</specular>
<shininess>
<float>12.5</float>
</shininess>
<reflective>
<color>1.00000 1.00000 1.00000 1</color>
</reflective>
<reflectivity>
<float>0.0</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.0</float>
</transparency>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_images>
<image id="tex_png-img" name="tex_png-img">
<init_from>cereal_box_tex.jpg</init_from>
</image>
</library_images>
<library_materials>
<material id="tex_png" name="tex_png">
<instance_effect url="#tex_png-fx"/>
</material>
</library_materials>
<library_geometries>
<geometry id="Cube_002" name="Cube_002">
<mesh>
<source id="Cube_002-Position">
<float_array count="24" id="Cube_002-Position-array">0.02600 0.09750 -0.13000 0.02600 -0.09750 -0.13000 -0.02600 -0.09750 -0.13000 -0.02600 0.09750 -0.13000 0.02600 0.09750 0.13000 0.02600 -0.09750 0.13000 -0.02600 -0.09750 0.13000 -0.02600 0.09750 0.13000</float_array>
<technique_common>
<accessor count="8" source="#Cube_002-Position-array" stride="3">
<param type="float" name="X"></param>
<param type="float" name="Y"></param>
<param type="float" name="Z"></param>
</accessor>
</technique_common>
</source>
<source id="Cube_002-Normals">
<float_array count="18" id="Cube_002-Normals-array">0.00000 0.00000 -1.00000 0.00000 -0.00000 1.00000 1.00000 -0.00000 0.00000 -0.00000 -1.00000 -0.00000 -1.00000 0.00000 -0.00000 0.00000 1.00000 0.00000</float_array>
<technique_common>
<accessor count="6" source="#Cube_002-Normals-array" stride="3">
<param type="float" name="X"></param>
<param type="float" name="Y"></param>
<param type="float" name="Z"></param>
</accessor>
</technique_common>
</source>
<source id="Cube_002-UV">
<float_array count="72" id="Cube_002-UV-array">0.60389 0.08627 0.60389 0.40978 0.51762 0.40978 0.51762 0.40978 0.51762 0.08627 0.60389 0.08627 0.00000 0.08627 0.08627 0.08627 0.08627 0.40978 0.08627 0.40978 0.00000 0.40978 0.00000 0.08627 1.00000 0.00000 1.00000 0.52815 0.60389 0.52815 0.60389 0.52815 0.60389 0.00000 1.00000 0.00000 0.51762 0.49605 0.08627 0.49605 0.08627 0.40978 0.08627 0.40978 0.51762 0.40978 0.51762 0.49605 0.51762 0.40978 0.08627 0.40978 0.08627 0.08627 0.08627 0.08627 0.51762 0.08627 0.51762 0.40978 0.08627 0.00000 0.51762 0.00000 0.51762 0.08627 0.51762 0.08627 0.08627 0.08627 0.08627 0.00000</float_array>
<technique_common>
<accessor count="36" source="#Cube_002-UV-array" stride="2">
<param type="float" name="S"></param>
<param type="float" name="T"></param>
</accessor>
</technique_common>
</source>
<vertices id="Cube_002-Vertex">
<input semantic="POSITION" source="#Cube_002-Position"/>
</vertices>
<triangles count="12" material="tex_png">
<input offset="0" semantic="VERTEX" source="#Cube_002-Vertex"/>
<input offset="1" semantic="NORMAL" source="#Cube_002-Normals"/>
<input offset="2" semantic="TEXCOORD" source="#Cube_002-UV"/>
<p>0 0 0 1 0 1 2 0 2 2 0 3 3 0 4 0 0 5 4 1 6 7 1 7 6 1 8 6 1 9 5 1 10 4 1 11 0 2 12 4 2 13 5 2 14 5 2 15 1 2 16 0 2 17 1 3 18 5 3 19 6 3 20 6 3 21 2 3 22 1 3 23 2 4 24 6 4 25 7 4 26 7 4 27 3 4 28 2 4 29 4 5 30 0 5 31 3 5 32 3 5 33 7 5 34 4 5 35</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="Scene" name="Scene">
<node layer="L1" id="Cube" name="Cube">
<matrix>
1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
</matrix>
<instance_geometry url="#Cube_002">
<bind_material>
<technique_common>
<instance_material symbol="tex_png" target="#tex_png">
<bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</visual_scene>
</library_visual_scenes>
<library_physics_materials>
<physics_material id="Cube-PhysicsMaterial" name="Cube-PhysicsMaterial">
<technique_common>
<dynamic_friction>0.5</dynamic_friction>
<restitution>0.0</restitution>
<static_friction>0.5</static_friction>
</technique_common>
</physics_material>
</library_physics_materials>
<library_physics_models>
<physics_model id="Scene-PhysicsModel" name="Scene-PhysicsModel">
<rigid_body name="Cube-RigidBody" sid="Cube-RigidBody">
<technique_common>
<dynamic>false</dynamic>
<mass>0</mass>
<instance_physics_material url="#Cube-PhysicsMaterial"/>
<shape>
<instance_geometry url="#Cube_002"/>
</shape>
</technique_common>
</rigid_body>
</physics_model>
</library_physics_models>
<library_physics_scenes>
<physics_scene id="Scene-Physics" name="Scene-Physics">
<instance_physics_model url="#Scene-PhysicsModel">
<instance_rigid_body body="Cube-RigidBody" target="#Cube"/>
</instance_physics_model>
</physics_scene>
</library_physics_scenes>
<scene>
<instance_physics_scene url="#Scene-Physics"/>
<instance_visual_scene url="#Scene"/>
</scene>
</COLLADA>
Originally posted by sam on Gazebo Answers with karma: 13 on 2012-11-27
Post score: 0
Original comments
Comment by nkoenig on 2012-11-27:
Can you post the nestle_cereal_box.dae
file?