How to debug world file in gazebo?
My launch file:
sam@sam:~/code/ros/temp$ cat t1.launch
<launch>
<!-- start gazebo with an empty plane -->
<param name="/use_sim_time" value="true" />
<node name="gazebo" pkg="gazebo" type="gazebo" args="$(find ias_gazebo)/worlds/ros_fallschool_day4.world" respawn="false" >
</node>
</launch>
My world file:
sam@sam:~/code/ros/temp$ cat /home/sam/code/ros/cram/ias_gazebo/worlds/ros_fallschool_day4.world
<?xml version="1.0"?>
<gazebo:world
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:gazebo="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz"
xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model"
xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
xmlns:window="http://playerstage.sourceforge.net/gazebo/xmlschema/#window"
xmlns:param="http://playerstage.sourceforge.net/gazebo/xmlschema/#param"
xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body"
xmlns:geo="http://willowgarage.com/xmlschema/#geo"
xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom"
xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint"
xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
xmlns:ui="http://playerstage.sourceforge.net/gazebo/xmlschema/#ui"
xmlns:rendering="http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering"
xmlns:renderable="http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable"
xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
xmlns:physics="http://playerstage.sourceforge.net/gazebo/xmlschema/#physics" >
<verbosity>5</verbosity>
<!-- cfm is 1e-5 for single precision -->
<!-- erp is typically .1-.8 -->
<!-- here's the global contact cfm/erp -->
<physics:ode>
<stepTime>0.001</stepTime>
<gravity>0 0 -9.8</gravity>
<cfm>0.000000000001</cfm>
<erp>0.2</erp>
<quickStep>true</quickStep>
<quickStepIters>10</quickStepIters>
<quickStepW>1.3</quickStepW>
<contactMaxCorrectingVel>100.0</contactMaxCorrectingVel>
<contactSurfaceLayer>0.001</contactSurfaceLayer>
</physics:ode>
<geo:origin>
<lat>37.4270909558</lat><lon>-122.077919338</lon>
</geo:origin>
<rendering:gui>
<type>fltk</type>
<size>1024 768</size>
<pos>0 0</pos>
<frames>
<row height="100%">
<camera width="100%">
<xyz>2 0 1.5</xyz>
<rpy>0 20 180</rpy>
</camera>
</row>
</frames>
</rendering:gui>
<rendering:ogre>
<ambient>0.3 0.3 0.3 0.3</ambient>
<sky>
<material>Gazebo/CloudySky</material>
</sky>
<gazeboPath>media</gazeboPath>
<grid>false</grid>
<maxUpdateRate>10</maxUpdateRate>
<shadowTechnique>stencilAdditive</shadowTechnique>
</rendering:ogre>
<!-- clock -->
<model:physical name="clock">
<xyz>0 0 0</xyz>
<rpy>0 0 0</rpy>
<static>true</static>
<body:box name="clock_body">
<geom:box name="clock_geom">
<mesh>default</mesh>
<size>0 0 0</size>
<visual>
<size>0 0 0</size>
<material>PR2/White</material>
<mesh>unit_box</mesh>
</visual>
</geom:box>
</body:box>
<!-- broadcast ros /time with simTime -->
<controller:gazebo_ros_time name="gazebo_ros_time" plugin="libgazebo_ros_time.so">
<alwaysOn>true</alwaysOn>
<updateRate>1000.0</updateRate>
<interface:audio name="dummy_gazebo_ros_time_iface_should_not_be_here"/>
</controller:gazebo_ros_time>
<!-- offer ROS services to spawn and delete models -->
<controller:gazebo_ros_factory name="gazebo_ros_factory" plugin="libgazebo_ros_factory.so">
<alwaysOn>true</alwaysOn>
<updateRate>1.0</updateRate>
<interface:audio name="dummy_gazebo_ros_factory_iface_should_not_be_here"/>
</controller:gazebo_ros_factory>
</model:physical>
<!-- ground plane -->
<model:physical name="gplane">
<xyz>0 0 0</xyz>
<rpy>0 0 0</rpy>
<static>true</static>
<body:plane name="plane">
<geom:plane name="plane">
<laserRetro>2000.0</laserRetro>
<mu1>50.0</mu1>
<mu2>50.0</mu2>
<kp>1000000000.0</kp>
<kd>1.0</kd>
<normal>0 0 1</normal>
<size>51.3 51.3</size>
<segments>10 10</segments>
<uvTile>100 100</uvTile>
<material>Gazebo/GrayGrid</material>
</geom:plane>
</body:plane>
</model:physical>
<!-- White Directional light -->
<model:renderable name="point_white">
<xyz>2 0.0 3</xyz>
<enableGravity>false</enableGravity>
<light>
<type>point</type>
<diffuseColor>0.6 0.6 0.6</diffuseColor>
<specularColor>.1 .1 .1</specularColor>
<attenuation>0.2 0.1 0</attenuation>
<range>10</range>
</light>
</model:renderable>
<model:physical name = "table1">
<xyz>0 -0.6 0</xyz>
<static>true</static>
<include embedded="true">
<xi:include href="ccrl_table.model" />
</include>
</model:physical>
<model:physical name = "table2">
<xyz>0 0.6 0</xyz>
<rpy>0 0 180</rpy>
<static>true</static>
<include embedded="true">
<xi:include href="ccrl_table.model" />
</include>
</model:physical>
<model:physical name = "cereal_box">
<xyz>0.35 -0.5 0.715</xyz>
<rpy>0 0 0</rpy>
<include embedded="true">
<xi:include href="cereal_box.model" />
</include>
</model:physical>
<model:physical name = "milk_box">
<xyz>0.2 0.6 0.715</xyz>
<rpy>0 0 0</rpy>
<include embedded="true">
<xi:include href="milk_box.model" />
</include>
</model:physical>
</gazebo:world>
sam@sam:~/code/ros/temp$
But I failed to load world file on ROS fuerte:
sam@sam:~/code/ros/temp$ optirun roslaunch ./t1.launch
... logging to /home/sam/.ros/log/5f260af4-34d1-11e2-ab5d-10bf482dcef4/roslaunch-sam-31584.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:42279/
SUMMARY
========
PARAMETERS
* /rosdistro
* /rosversion
* /use_sim_time
NODES
/
gazebo (gazebo/gazebo)
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 [31609]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to 5f260af4-34d1-11e2-ab5d-10bf482dcef4
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 [31626]
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 [31640]
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
Warning [parser.cc:348] Gazebo SDF has no gazebo element
Entity: line 138: parser error : Opening and ending tag mismatch: physical line 133 and include
</include>
^
Entity: line 139: parser error : Opening and ending tag mismatch: world line 3 and physical
</model:physical>
^
Entity: line 141: parser error : Extra content at the end of the document
<model:physical name = "table2">
^
Error [parser_deprecated.cc:1365] Could not parse the xml
Entity: line 138: parser error : Opening and ending tag mismatch: physical line 133 and include
</include>
^
Entity: line 139: parser error : Opening and ending tag mismatch: world line 3 and physical
</model:physical>
^
Entity: line 141: parser error : Extra content at the end of the document
<model:physical name = "table2">
^
Error [parser_deprecated.cc:1307] Could not parse the xml
Error [parser.cc:263] parse as old deprecated model file failed.
Error [Server.cc:196] Unable to read sdf file[/home/sam/code/ros/cram/ias_gazebo/worlds/ros_fallschool_day4.world]
[gazebo-2] process has died [pid 31640, exit code 255, cmd /opt/ros/fuerte/stacks/simulator_gazebo/gazebo/scripts/gazebo /home/sam/code/ros/cram/ias_gazebo/worlds/ros_fallschool_day4.world __name:=gazebo __log:=/home/sam/.ros/log/5f260af4-34d1-11e2-ab5d-10bf482dcef4/gazebo-2.log].
log file: /home/sam/.ros/log/5f260af4-34d1-11e2-ab5d-10bf482dcef4/gazebo-2*.log
How to solve it?
Is there any tools and visualize world file before loading to gazebo?
Thank you~
Asked by sam on 2012-11-22 07:22:11 UTC
Comments