ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Error while spawning my robot in gazebo using gazebo_ros

asked 2016-10-05 08:18:27 -0500

patrchri gravatar image

updated 2016-10-05 08:37:10 -0500

I have the following launch file:

<launch>
  <!-- roslaunch arguments -->
  <arg name="paused" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="gui" default="true"/>

  <!-- We resume the logic in empty_world.launch, changing only the name of 
    the world to be launched -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="worlds/empty.world" />
    <arg name="paused" value="$(arg paused)" />
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="use_sim_time" value="true" />
    <arg name="headless" value="false" />
  </include>

  <!-- urdf xml robot description loaded on the Parameter Server-->
  <param name="robot_description" command="$(find xacro)/xacro.py '$(find labrob_description)/urdf/labrob.urdf'" />

  <!-- push robot_description to factory and spawn robot in gazebo -->
  <node name="labrob_spawn" pkg="gazebo_ros" type="spawn_model" output="screen" 
    args="-urdf -param robot_description -model labrob" />
</launch>

I get the following errors, which I cannot understand:

ERROR: cannot launch node of type [gazebo_ros/gzserver]: can't locate node [gzserver] in package [gazebo_ros]
ERROR: cannot launch node of type [gazebo_ros/gzclient]: can't locate node [gzclient] in package [gazebo_ros]
ERROR: cannot launch node of type [gazebo_ros/spawn_model]: can't locate node [spawn_model] in package [gazebo_ros]

My issue is that I could easily run this launch file one month ago when I stopped using ros for a bit and now that I tried again I can't.

Has anything changed about gazebo_ros package? Why do I get this error and what should I change to fix this error?

Thanks for answering,

Chris

1st EDIT:

I tried also something simple as:

roslaunch gazebo_ros empty_world.launch

but I got the following errors:

ERROR: cannot launch node of type [gazebo_ros/gzserver]: can't locate node [gzserver] in package [gazebo_ros]
ERROR: cannot launch node of type [gazebo_ros/gzclient]: can't locate node [gzclient] in package [gazebo_ros]

I am kind of lost on what is going wrong on a simple command like this.

The gazebo command works fine. I also checked the directory /opt/ros/kinetic/share/gazebo_ros and I didn't find any worlds file. Should I remove the gazebo_ros package and install it again ?

edit retag flag offensive close merge delete

5 Answers

Sort by ยป oldest newest most voted
0

answered 2016-10-07 14:49:16 -0500

patrchri gravatar image

I solved the issue by backing up my src file of my workspace and reinstalling it in a new workspace.

The issue probably arised because at past I used a source launch file from the gazebo_ros package probably causing an error at the different existing names.

edit flag offensive delete link more
2

answered 2016-12-08 05:45:53 -0500

ewerlopes gravatar image

Well, it turns out I was having the same problem with the gazebo_ros package with gazebo7 and indigo on a Ubuntu 14.04 machine. I solved in a similar way: by first issuing "catkin_make clean" on the catkin environment and also deleting manually a folder called "gazebo_ros" in the "catking/devel/shared" path. This last step was an attempt to erase all traces of a manual installation of gazebo_ros I tried to do. It turns out that was the cause of the problem. Now, it is solved!

edit flag offensive delete link more

Comments

Thanks a lot! It works for me.
Delete manually a folder called "gazebo_ros" in the "catking/devel/shared" path and then catkin_make

VincyXiao gravatar image VincyXiao  ( 2019-06-07 13:59:54 -0500 )edit
1

answered 2016-12-30 03:09:40 -0500

emigmo gravatar image

I have solved this problem.! Frist : you should check your gazebo_ros is installed or not. just 'roscd gazebo_ros' or 'rospack list'.if not,you can install it by type 'sudo apt-get install ros-<distrib>-gazebo-ros' ; you can also sudo apt-get install ros-<distrib>-gazebo-* Then: source /opt/ros/<distrib>/setup.bash fanal : you can use roscore && rosrun gazebo_ros gazebo or roslaunch gazebo_ros emply_world.launch

edit flag offensive delete link more

Comments

Worked perfectly, it seems roslaunch was unable to source my gazebo package.

dhruv7396 gravatar image dhruv7396  ( 2018-02-06 10:22:10 -0500 )edit
0

answered 2019-01-28 03:20:00 -0500

lyz gravatar image

I solved this issue by removing build and devel folders and then recompiling.

edit flag offensive delete link more
0

answered 2017-12-24 02:08:58 -0500

hsbanktr gravatar image

I have installed Gazebo7 from the source with ROS Indigo. I had the same issue above. But I wasn't clear about what the explanations are explaining above. The way I resolved the issue is by creating the symbolic link in installed gazebo_ros location by using the following command:

$> ln -s /path/to/file /path/to/symlink

where /path/to/file is the original gazebo, gzclient, and gzserver and /path/to/file is the target, i.e. /opt/ros/indigo/share/gazebo_ros/gazebo. To test the solution, just use

$> roslaunch gazebo_ros empty_world.launch

It should launch an empty world in gazebo environment.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-10-05 08:18:27 -0500

Seen: 7,120 times

Last updated: Dec 24 '17