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

Is it possible to remap /clock?

asked 2016-08-29 11:18:21 -0600

JaredMoore gravatar image

updated 2016-08-31 10:01:56 -0600

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.

Thanks!

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:

<launch>

<!-- ********************* 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" />
</node>

</launch>

Here is my world file:

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <physics type="ode">
          <max_step_size>0.025</max_step_size>
        <real_time_update_rate>30</real_time_update_rate>
    </physics>

    <include>
      <uri>model://ground_plane</uri>
    </include>
  </world>
</sdf>

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/gaz... ) after considering Stefan's post. Verified myself that the code works in Indigo/Gazebo2 but not Kinectic/Gazebo7.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-08-31 05:52:44 -0600

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" />
  </node>

Check while gazebo is running:

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

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

Subscribers: 
 * /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).

edit flag offensive delete link more

Comments

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!

JaredMoore gravatar image JaredMoore  ( 2016-08-31 08:47:59 -0600 )edit
1

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?

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2016-08-31 09:07:39 -0600 )edit

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.

JaredMoore gravatar image JaredMoore  ( 2016-08-31 09:15:21 -0600 )edit

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.

JaredMoore gravatar image JaredMoore  ( 2016-08-31 10:02:50 -0600 )edit
1

Wow, that's really surprising, will be interesting to (hopefully) get this resolved.

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2016-08-31 10:12:27 -0600 )edit
0

answered 2016-08-29 12:23:22 -0600

dornhege gravatar image

My guess is that you need to remap '/clock' and not 'clock', if gazebo publishes on /clock explicitly. For Gazebo that would make sense, after all, why should there be more than one time...

edit flag offensive delete link more

Comments

Tried to remap /clock instead of clock as suggested and variants of groupX_clock as well as /groupX_clock. For the first configuration (/clock,groupX_clock) no updates occurred at all. Adding / to groupX published back on the clock topic, remap seems to fail.

JaredMoore gravatar image JaredMoore  ( 2016-08-29 12:48:13 -0600 )edit
1

The clock topic can be remapped as of Hydro and ros_comm version 1.11.0: https://github.com/ros/ros_comm/commi... . Since it uses the absolute name, I think you'll need to remap the absolute name. Use rostopic list and rostopic info to verify.

ahendrix gravatar image ahendrix  ( 2016-08-29 14:21:26 -0600 )edit

I think I'm being a bit dense but I looked around and ran rostopic info. All I see for a name is /clock. Im my setup file I currently do not have anything inside group tags to avoid any possible problems there. Any more info on absolute names? Sorry and thanks for the help!

JaredMoore gravatar image JaredMoore  ( 2016-08-29 14:57:01 -0600 )edit

The best I can do is refer you to: http://wiki.ros.org/Remapping%20Argum...

ahendrix gravatar image ahendrix  ( 2016-08-29 15:12:08 -0600 )edit

Thanks for the help, I've edited my question as I think there might be an issue with remapping clock in gazebo nodes.

JaredMoore gravatar image JaredMoore  ( 2016-08-30 13:20:11 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2016-08-29 11:18:21 -0600

Seen: 1,090 times

Last updated: Aug 31 '16