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

"use_sim_time" parameter disabled tf [closed]

asked 2015-07-23 21:04:42 -0500

updated 2017-02-16 17:07:26 -0500

130s gravatar image

Hello,every one,

After I added <param name ="/use_sim_time" value="true"/> in my launch file,the rviz can not show the tf tree and there was an error in the RobotModel:No transform from [base_laser]to[odom] and a warning in Global Status: No tf data.Actual error:Fixed Frame [odom] does not exist. When I entered rostopic echo /tf ,there was a warning :no messages received and simulated time is active.Is /clock being published?

So the root cause is the clock message not be published.How can I publish the /clock messages ?

Thanks in advance!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by redskydeng
close date 2015-07-29 22:56:05.111738


Do you play a bagfile? Can you please edit your question and add some of the commands you execute?

mgruhler gravatar image mgruhler  ( 2015-07-24 03:04:11 -0500 )edit

No,I did not play any bagfile. How can I publish the clock message? Will the bagfile publish a clock message?

redskydeng gravatar image redskydeng  ( 2015-07-25 04:37:42 -0500 )edit

@redskydeng What were you trying to achieve by setting use_sim_time?

Boris gravatar image Boris  ( 2015-07-26 16:12:58 -0500 )edit

I am using the gazebo.Should I write some codes to publish the /clock topic?

redskydeng gravatar image redskydeng  ( 2015-07-29 21:43:21 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-07-27 01:03:51 -0500

mgruhler gravatar image

Well, I'll just give it a go answering now.

You can only use simulation time, if you are either playing a bagfile (then, do rosbag play mybag.bag --clock) or when you have a simulation running. If you are using gazebo, this should be set to true for synchronizing gazebo with ROS. See the documentation here. Usually, you put this parameter in the launch file of you simulator, which you usually start as the first launch file.

Note, that the nodes need to be written using the ROS Time API and not using walltime, as this would mean that they are not able to properly use simulation time. See here for more details.

edit flag offensive delete link more




Thanks! The rosbag play publishes /clock message when using '--clock' parameter.

Thx for your hint:)

redskydeng gravatar image redskydeng  ( 2015-07-29 22:53:58 -0500 )edit

Question Tools

1 follower


Asked: 2015-07-23 21:04:42 -0500

Seen: 16,442 times

Last updated: Feb 16 '17