Gazebo | Ignition | Community
Ask Your Question
0

How to load sdf file in gazebo on ROS fuerte?

asked 2012-11-27 06:45:37 -0500

sam gravatar image

updated 2012-11-27 19:25:07 -0500

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 ...
(more)
edit retag flag offensive close merge delete

Comments

Can you post the `nestle_cereal_box.dae` file?

nkoenig gravatar imagenkoenig ( 2012-11-27 11:03:14 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-07-23 17:06:55 -0500

nkoenig gravatar image

The units on the cereal box are incorrect. Change

<unit meter="0.01" name="centimeter"/>

to

 <unit meter="1.0" name="meter"/>
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2012-11-27 06:45:37 -0500

Seen: 3,532 times

Last updated: Jul 23 '13