Waiting for service /gazebo/spawn_urdf_model


#1

Hi,

The situation is:

  • We have created a new robot model for our Fable robot in Gazebo.
  • We are able to spawn the model in Gazebo when we are working on a PC where the NRP is not installed.

The problem comes when we move the packages containing the model into the NRP catkin_workspace ($HBP/GazeboRosPackages). It is possible to do catkin_make (since the code does not need to be compiled) and the new packages are detected when we do roslaunch.

The problem is that Gazebo gets stuck on the service spawn_urdf_model, so it is not able to show up the model. I have been trying different things but for now I can’t find a way to solve this problem.

Notice that our model is not part of the NRP yet, we are only using Gazebo.

Any help will be very welcome,

Thanks in advance and Happy Holidays!

Carlos


#2

Hi Carlos,

Most likely some exception is raised while executing spawn_urdf_model.
You may find some useful insights in the backend log.

Please post here the log so we can have a look at it.

If not possible, you may send me the model so I can test it on my machine.

Cheers


#3

Hi!

Thanks for your answer. I was not available for the last couple of weeks, I am sorry for the delay.

I am trying to find the backend log that you mention but I cannot find it. As I said, the model is not part of the NRP, hence I am only using Gazebo to do my test. I am not sure if that is the reason why I cannot find the backend log file. If you could guide me a little bit with that I would really appreciate it.
Otherwise, we could continue this conversation by email so I could send you the model and you can test it in your machine.

Again, sorry for the delay in my response.

Kind regards,

Carlos


#4

Hi Carlos,

First of all happy new year! Could you send your urdf?

Kind regards,
Manos


#5

Hi Manos,

Thank you! Happy new year to you too!

It seems that I am having problems with all kind of urdf files. I have simplified the problem in this way.

First I create an empty world,

roslaunch gazebo_ros empty_world.launch

And then I try to spawn a simple box by:

rosrun gazebo_ros spawn_model -file pwd/test.urdf -urdf -z 1 -model my_object

The test.urdf file is:

<?xml version="1.0"?>

<robot name="simple_box">
  <link name="my_box">
    <inertial>
      <origin xyz="2 0 0" />
      <mass value="1.0" />
      <inertia  ixx="1.0" ixy="0.0"  ixz="0.0"  iyy="100.0"  iyz="0.0"  izz="1.0" />
    </inertial>
    <visual>
      <origin xyz="2 0 1"/>
      <geometry>
        <box size="1 1 2" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="2 0 1"/>
      <geometry>
        <box size="1 1 2" />
      </geometry>
    </collision>
  </link>
  <gazebo reference="my_box">
    <material>Gazebo/Blue</material>
  </gazebo>
</robot>

The output of this test is the same as the one I had with our robot model: Gazebo gets stuck on the service spawn_urdf_model

Kind regards,

Carlos


#6

Hi,

I reproduced the problem and I will discuss it with some of our gazebo experts and will get back to you

Regards,
Manos


#7

Hi Carlos,

I found the problem and I am working on a fix.

In short, our GazeboRosPackages code contains a ros package called gazebo_ros_packages and in there there is a package called gazebo_ros . When you are trying to spawn the object it is trying to use the code from the NRP repo and it hangs forever, due to the fact that the roslaunch file is probably up to date or something else is happening behind the scenes. So you have to run the roslaunch from the default gazebo_ros apt package, and then it should work.

Long story short:

In one terminal:

  1. ROS_PACKAGE_PATH=/opt/ros/version kinetic-indigo/share
  2. source /opt/ros/version kinetic-indigo/setup.bash
  3. rospack find gazebo_ros
  4. if it is not found sudo apt-get install ros-version indigo/kinetic-gazebo-ros
  5. source /opt/ros/version kinetic-indigo/setup.bash
  6. your launch command as usual. This should successfully launch gazebo

In another terminal:

  1. source ~/.bashrc (this should bring back the things to how they were will gazebo is working with the working roslaunch)
  2. your spawn command, and then everything should work fine.

If you verify that this hack works I will try to synchronize the correct roslaunch file with the one that we are providing. Hope it helps!

Kind regards,
Manos


#8

Hi,

Manos helped me figuring out a way to hack my problem. The solution that he proposed before works for the simple case of the box since the test.urdf does not contain any dependencies to other ros packages. However, if we try to spawn our robot model, ros will complain since it cannot find some of the packages.

To bypass this issue:

In one terminal:

  1. ROS_PACKAGE_PATH=$HOME/catkin_ws:/opt/ros/version kinetic-indigo/share
  2. your launch command as usual. This should successfully launch gazebo
    roslaunch gazebo_ros empty_world.launch

In another terminal:

  1. ROS_PACKAGE_PATH=$HOME/catkin_ws:/opt/ros/version kinetic-indigo/share
  2. your spawn command, and then everything should work fine.
    rosrun gazebo_ros spawn_model -file pwd/fable_test.urdf -urdf -x 1 -model fable

This hack is working so far. The next step would be to include the model in the NRP so we can avoid this kind of issues.

Kind regards,

Carlos


#9

Hi Carlos,

Did you actually manage to load the URDF Robot in the NRP?

Regards,
Mahmoud


#10

Hi Mahmoud,

Now we are working with the NRP and the sdf representation of our urdf files. What I was trying to do was not the best option. Now we have a PC without the NRP that we use in case we need to debug things in ROS in a faster way.

But it would be nice to be able to have your own ROS packages within the NRP and not having to work with multiple computers.

Kind regards,

Carlos