Ask Your Question
0

Publisher sleep forever using roslaunch

asked 2014-09-30 22:35:01 -0500

Min gravatar image

When I ran a simple publisher in the tutorial ( http://wiki.ros.org/ROS/Tutorials/Wri... ). 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?

<launch>

<master auto="start"/>

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

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

</launch>

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-10-01 01:12:20 -0500

Wolf gravatar image

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/19382... 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

edit flag offensive delete link more

Comments

Yes, problem solved. Thanks a lot ;)

Min gravatar imageMin ( 2014-10-01 02:14:49 -0500 )edit

Plz accept answer and close thread if issue is solved...

Wolf gravatar imageWolf ( 2014-10-01 03:17:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-09-30 22:35:01 -0500

Seen: 212 times

Last updated: Oct 01 '14