Gazebo | Ignition | Community
Ask Your Question

ROS Indigo with parallel physics

asked 2017-05-18 17:26:55 -0600

hamzamerzic gravatar image

updated 2017-05-18 17:29:42 -0600

Hi everyone. I am trying to enable parallel physics (as per with Gazebo on ROS Indigo. I tried combining the instructions from the previous link with the instructions here, but I cannot make it work.

What makes it tricky is that I have to have proper versions of Gazebo along with the proper sdformat and gazebo_ros_pkgs. I basically follow the tutorial for installing gazebo from source (using catkin-tools), but using the commits for gazebo and sdformat specified in the parallel physics guide. The first error that shows up is:

catkin_ws/src/gazebo/util/ error: no match for ‘operator/’ (operand types are ‘std::string {aka std::basic_string<char>}’ and ‘const char [7]’)
this->dataPtr->logPath = paths->GetTmpPath() / "gazebo";

Since the logPath is of type boost::filesystem::path, I do explicit conversion of std::strings in, e.g.

this->dataPtr->logPath = paths->GetTmpPath() / boost::filesystem::path("gazebo");

The compilation continues and I get another error:

catkin_ws/src/gazebo/test/integration/ fatal error: helper_physics_generator.hh: No such file or directory
#include "helper_physics_generator.hh"

To solve this I simply put a copy of helper_physics_generator into the gazebo/test/integration folder.

cp src/gazebo/gazebo/test/helper_physics_generator.hh src/gazebo/test/integration/

So now it compiles (both gazebo and the sdformat). After that I download gazebo_ros_pkgs and compile it. I tried with both indigo-devel and kinetic-devel, since I am not sure which one to use for my setup, but in both cases I get the following errors when launching a launch file which worked on both Indigo+Gazebo2.2 and Indigo+Gazebo7 (from deb):

Error [Element.hh:336] Unable to find value for key[gravity]
[INFO] [WallTime: 1495147521.301791] [0.000000] Calling service /gazebo/spawn_urdf_model
Error [] Missing element description for [gravity]
Service call failed: transport error completing service call: unable to receive data from sender, check sender's logs for details
Segmentation fault
Warning [] Converting a deprecated SDF source[data-string].
Error [] Unable to convert from SDF version 1.6 to 1.5
Warning [] Converting a deprecated SDF source[data-string].
Error [] Unable to convert from SDF version 1.6 to 1.5
Warning [] Converting a deprecated SDF source[data-string].
Error [] Unable to convert from SDF version 1.6 to 1.5

Any pointers would be much appreciated, thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-05-19 06:18:09 -0600

hamzamerzic gravatar image

updated 2017-05-19 06:22:25 -0600

So, after spending some time on this, I figured out how to make it work. To make it work, I started with this tutorial. First, I uninstalled all the previous Gazebo versions and cleaned up all the dependencies, but I did not install the dependencies again, since this installs another sdformat version, and we want to have only our version present.

After that I create a catkin workspace, download catkin, sdformat, bullet (since I also want bullet support) and Gazebo. I take the branch diagnostics_scpeters for Gazebo and island_threads for sdformat. But, I noticed that this version of sdformat is outdated so I do

cd ${WS}/src/sdformat
hg merge sdformat4_4.1.0

One other thing that I did, which might not be crucial is manually patching sdformat. If you look at the diff for the island_threads branch, you can see two new fields added (which enable parallel physics), and they seem to be enabled only for version 1.5. I apply the same patch to version 1.6 just to make sure.

Then I make the changes to Gazebo mentioned in the question - explicit conversion of strings to boost::filesystem::path in and copying of the helper_physics_generator.hh. Everything is now set up and I am able to build. Since I am using catkin-tools, I use the command from build from source tutorial:

cd ${WS}
catkin build -vi --cmake-args \

For gazebo_ros_pkgs, I compiled the branch indigo-devel, but I think kinect would also work.

I noticed that I can decrease the step size quite a bit, and the simulation stays stable. I managed to speed up the simulation 8 times by using 6 island threads and position error correction.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-05-18 17:26:55 -0600

Seen: 714 times

Last updated: May 19 '17