0
$\begingroup$

Rosanswers logo

When I ran a simple publisher in the tutorial (http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29). I got a problem that if I ran it through launch file, the node will sleep forever. But if I ran it through rosrun [packagename] talker, it works fine. My launch file looks like this, can anyone help me?

<master auto="start"/>

<param name="use_sim_time" value="true"/>

<node pkg="hybridAstar" type="talker" name="talker" output="screen"/>

Originally posted by Min on ROS Answers with karma: 3 on 2014-09-30

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The problem is

<param name="use_sim_time" value="true"/>

This means the uses simulation time published to /clock topic by e. g. Gazebo or a rosbag started by rosbag play --clock file.bag.

See this http://wiki.ros.org/Clock ans this http://answers.ros.org/question/193820/time-stamp-ros_info/?comment=193890#comment-193890 for info about clock and simulation time

This means your node will not spin before any other node (gazebo/rosbag) is started and publishes to /clock topic


Originally posted by Wolf with karma: 7555 on 2014-10-01

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Min on 2014-10-01:
Yes, problem solved. Thanks a lot ;)

Comment by Wolf on 2014-10-01:
Plz accept answer and close thread if issue is solved...

$\endgroup$

Your Answer

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