0
$\begingroup$

Rosanswers logo

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!


Originally posted by redskydeng on ROS Answers with karma: 118 on 2015-07-23

Post score: 0


Original comments

Comment by mgruhler on 2015-07-24:
Do you play a bagfile? Can you please edit your question and add some of the commands you execute?

Comment by redskydeng on 2015-07-25:
No,I did not play any bagfile. How can I publish the clock message? Will the bagfile publish a clock message?

Comment by Boris on 2015-07-26:
@redskydeng What were you trying to achieve by setting use_sim_time?

Comment by redskydeng on 2015-07-29:
I am using the gazebo.Should I write some codes to publish the /clock topic?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by mgruhler with karma: 12390 on 2015-07-27

This answer was ACCEPTED on the original site

Post score: 10


Original comments

Comment by redskydeng on 2015-07-29:
mig,

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

Thx for your hint:)

$\endgroup$

Your Answer

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