Gazebo | Ignition | Community
Ask Your Question
0

Error with ROS Simulator-Gazebo and best practices for URDFs in Gazebo

asked 2013-03-14 14:12:07 -0600

KelGuerin gravatar image

Hi All,

I have reciently upgraded from Fuerte to Groovy, and I am working on Ubuntu Precise.

I wanted to start simulating my robot in Gazebo using my existing URDF and models. I started by trying out Gazebo with the debian package ros-groovy-simulator-gazebo by running

kel@accuser:~$ rosrun gazebo gazebo

This gives the following behavior, similar to this question posted to answers.gazebosim.org.

kel@accuser:~$ rosrun gazebo gazebo
Gazebo multi-robot simulator, version 1.3.0
Copyright (C) 2012 Nate Koenig, John Hsu, and contributors.
Released under the Apache 2 License.
http://gazebosim.org

Msg Waiting for master.[ INFO] [1363287175.831594707]: waitForService: Service [/gazebo    /set_physics_properties] has not been advertised, 
waiting.................

Which then continues to wait forever, and has to be ctrl-\ to be stopped (or killed).

At first I thought that this could be a problem with my ROS_IP or other network parameters, but I think those are ok, and other ROS nodes can be brought up just fine:

kel@accuser:~$ export |grep ROS

returns

declare -x ROS_DISTRO="groovy"
declare -x ROS_ETC_DIR="/opt/ros/groovy/etc/ros"
declare -x ROS_IP="10.162.34.26"
declare -x ROS_MASTER_URI="http://localhost:11311"
declare -x ROS_PACKAGE_PATH="/home/kel/ros_workspace/executive_smach_tutorials:/home/kel    /ros_workspace/adjutant:/home/kel/ros_workspace/merlin_robot:/home/kel/ros_workspace    /ros_controllers:/home/kel/ros_workspace/ros_control:/opt/ros/groovy/share:/opt/ros/groovy/stacks"
declare -x ROS_ROOT="/opt/ros/groovy/share/ros"
declare -x ROS_WORKSPACE="/home/kel/ros_workspace"

and

kel@accuser:~$ ifconfig

returns

eth0  Link encap:Ethernet  HWaddr 00:1a:6b:36:b0:1b  
      inet addr:10.162.34.26  Bcast:10.162.34.255  Mask:255.255.255.0
      inet6 addr: fe80::21a:6bff:fe36:b01b/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1425950 errors:0 dropped:0 overruns:0 frame:0
      TX packets:477752 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:212769407 (212.7 MB)  TX bytes:39867099 (39.8 MB)
      Interrupt:20 Memory:fe200000-fe220000 

lo    Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:16436  Metric:1
      RX packets:111011 errors:0 dropped:0 overruns:0 frame:0
      TX packets:111011 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:15710426 (15.7 MB)  TX bytes:15710426 (15.7 MB)

After reading a few other questions such as this one, it seems apparent that the ROS simulator-gazebo stuff is deprecated. However, I have it on good authority that the ros simulator-gazebo tools (specifically the spawn_model command to use URDF's) should still work as of Groovy.

I am not sure if the error I am having with simulator-gazebo is related to a separate problem, or this supposed deprecation. I also have installed Gazebo 1.5. What is the best way for me to use my existing URDFs and models?

Thanks for the help, and let me know if you need more information about anything.

Cheers, Kel ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2013-03-14 18:05:37 -0600

KelGuerin gravatar image

updated 2013-03-14 18:06:13 -0600

Ok so here is what I ended up doing. I found this answer from @nkoenig in which he suggested removing "localhost" from the "::1" line of /etc/hosts. I am not sure this is a good long term solution, but it solved my start-up problem and now gazebo runs fine. I used spawn_model to load in my robot and that worked great as well.

I think I will stick with using gazebo through ROS for now, since the ability to use URDFs really simplifies my workflow.

There are still some issues with gazebo not finishing cleanly when you click the x to close the simulation window. Sometimes there is still a gazebo process running in the background, which then causes a segmentation fault the next time you try and roslaunch gazebo_world foo.launch.

I hope this can help anyone else having this problem.

Cheers, Kel Guerin

edit flag offensive delete link more

Comments

FYI you can still spawn URDFs from Gazebo standalone. There is a slight overhead to port your existing models to the standalone structure, but you don't have to sacrifice URDF, at least for now. The main difference is that your models: 1. must be exposed as a Gazebo model database, and 2. should be spawned using gzfactory instead of spawn_model.

Adolfo Rodríguez T gravatar imageAdolfo Rodríguez T ( 2013-03-15 03:29:13 -0600 )edit

@KelGuerin Yes I got the same problem but I am spawning and launching gazebo by following commands

roslaunch gazeboworlds emptyworld.launch rosrun gazebo spawnmodel -file model.sdf -gazebo -z 200 -model myrobot

skhan gravatar imageskhan ( 2013-03-15 06:02:24 -0600 )edit

@KelGuerin Yes I got the same problem

skhan gravatar imageskhan ( 2013-03-15 06:02:25 -0600 )edit

rosrun gazebo spawnmodel -file model.sdf -gazebo -z 200 -model myrobot

skhan gravatar imageskhan ( 2013-03-15 06:07:21 -0600 )edit

rosrun gazebo spawn_model -file model.sdf -gazebo -z 200 -model my_robot

skhan gravatar imageskhan ( 2013-03-15 06:07:23 -0600 )edit
1

The original problem posted is resolved in Gazebo 1.5.

nkoenig gravatar imagenkoenig ( 2013-03-15 15:52:52 -0600 )edit

Question Tools

Stats

Asked: 2013-03-14 14:12:07 -0600

Seen: 22,307 times

Last updated: Mar 14 '13