Rosanswers logo

I'm running a launch file with grouped gazebo instances. So far I've been able to successfully separate each group into its own container, however, the \clock topic is still being shared among the groups. I've inserted a <remap from="clock" to="groupX_clock"/> following the conventions in http://wiki.ros.org/roslaunch/XML/remap. After launching, it appears that the clock is not being remapped correctly and the different Gazebo nodes use the same clock topic, leading to collisions in messages and errors mentioning that the simulation has moved back in time.

Is there an undocumented restriction on remapping certain topics? Or perhaps (most likely) I have just missed a critical piece of information.


Edit 1

After the comments posted in dornhege's answer, I've tried quite a few variations and investigated using rostopic list, rostopic info, and gz topic -l. It appears that the clock topic is remapped correctly in all but the Gazebo node. Something appears to be hindering the remapping there, but I'm am currently unsure how to get it to work correctly.

Edit 2

I've created a simplified set of launch and world files to try and isolate where I might be running into a problem. Here is my gazebo_only.launch file:


<!-- ********************* Begin Gazebo Defaults ******************************** -->

<arg name="args" default="--verbose -r -e ode"/>
<arg name="world" value="$(find basicbot_gazebo)/worlds/empty.world"/>
<!-- set use_sim_time flag -->
<!--<param name="/use_sim_time" value="true" />-->

<!-- ********************* End Gazebo Defaults ******************************** -->    

<!-- start gazebo server-->
<!--<env name="GAZEBO_MASTER_URI" value="http://localhost:11345"/>-->
<node name="gazebo" pkg="gazebo_ros" type="gzserver" args="$(arg world) $(arg args)" respawn="false" output="screen">
  <remap from="rosout" to="rosout_remapped" />  
  <remap from="clock" to="clock_remapped" />


Here is my world file:

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <physics type="ode">


I've tried launching this on both my remote system, and my local Ubuntu VM both running Kinectic and Gazebo7. The remapping of both topics in the gazebo node still appears to fail. Does it work on your system?

Edit 3

Opened a github issue in the gazebo_ros_pkgs repository (https://github.com/ros-simulation/gazebo_ros_pkgs/issues/486) after considering Stefan's post. Verified myself that the code works in Indigo/Gazebo2 but not Kinectic/Gazebo7.

Originally posted by JaredMoore on ROS Answers with karma: 71 on 2016-08-29

Post score: 1


1 Answer 1


Rosanswers logo

Remapping /clock works fine more me: Gazebo launch:

  <node name="gazebo" pkg="gazebo_ros" type="gzserver" args="$(arg world) $(arg args)" respawn="false" output="screen">
    <remap from="odom" to="odom_trash" />
    <remap from="clock" to="clock_remapped" />

Check while gazebo is running:

kohlbrecher@kohlbrecher-XPS-15-9550:~$ rostopic info /clock_remapped
Type: rosgraph_msgs/Clock

 * /gazebo (http://kohlbrecher-XPS-15-9550:49687/)

 * /gazebo (http://kohlbrecher-XPS-15-9550:49687/)

Note that remapping applies to a topic and process/node, so it is not possible to remap tf data of one robot in a gazebo process from /tf to /tf_robot_1 and for another robot to tf_robot_2 (at least not with simple command line remapping).

Originally posted by Stefan Kohlbrecher with karma: 24361 on 2016-08-31

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by JaredMoore on 2016-08-31:
Just tried using this configuration using the launch and world file in my Edit 2. Any chance you could take a look, maybe try those on your system to see if the remapping works? It has failed on my two test systems. Thanks for the help!

Comment by Stefan Kohlbrecher on 2016-08-31:
I just copied your launch file (only change was the world file, back to <arg name="world" default="worlds/empty.world"/>. Works for me, I'm using Gazebo2 on Indigo, however (but I think it's unlikely this ceased working with 7). How did you test wether the remapping works?

Comment by JaredMoore on 2016-08-31:
Great, thanks for the quick reply! I just tried changing the world to use empty world as well but still no success. I'm wondering if they inadvertently broke something on Gazebo7/Kinectic. I launched the file and then used rostopic list. The /clock topic was there, but no remapped one.

Comment by JaredMoore on 2016-08-31:
Tested the code on my local VM with Indigo/Gazebo2. Works here as well. Appears that possibly they've broken something between versions. I went ahead and added a github issue to the repository. Thanks for the help here, looks like I might have to go there to get the issue resolved.

Comment by Stefan Kohlbrecher on 2016-08-31:
Wow, that's really surprising, will be interesting to (hopefully) get this resolved.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.