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

launch file ignoring a message

asked 2011-07-13 07:17:57 -0500

mkt29 gravatar image

updated 2011-07-15 05:13:39 -0500

kwc gravatar image

I'm using a launch file to start a driver node and another node at the same time. Meanwhile, I'm running another file, which is supposed to publish a message to a topic, to which the non-driver node in the launch file is subscribed. When I don't use the launch file and run the driver separately, everything works fine. The message is published and read correctly. However, when I use the launch file, the message appears not to be read.

edit retag flag offensive close merge delete


Is this a single message that one of your nodes is firing off when it starts, or a topic that is updated periodically? In launch files, the order that nodes start up in is not guaranteed, so one node could publish a message before the receiving node is ready.
Dan Lazewatsky gravatar image Dan Lazewatsky  ( 2011-07-13 08:26:59 -0500 )edit
The message is published by a program outside of the launch file and it's being published constantly so I don't think that's the problem.
mkt29 gravatar image mkt29  ( 2011-07-13 08:38:33 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2011-07-13 09:08:11 -0500

Lorenz gravatar image

Just a guess, but maybe you specified a different node name in the launch file than when calling ros::init in your subscriber node. If you use relative topic names, they will be in a namespace named according to your node name.

rostopic list and rostopic echo might help, too. Start up everything and try to find out if your topic is present twice, in different namespaces (just call rostopic list). Then do a rostopic info <topic> to verify the node names that publish/subscribe to the topic.

If my guess is correct, either change your nodes to use absolute node names or use topic remapping to fix the topic name or simply rename your node in the launch file.

edit flag offensive delete link more


Yep, that was the problem. Thanks!
mkt29 gravatar image mkt29  ( 2011-07-14 03:31:20 -0500 )edit

answered 2011-07-13 08:30:23 -0500

hsu gravatar image

you might want to take a look at the latch option for roscpp and for rospy.

edit flag offensive delete link more


Hm, didn't work for me.
mkt29 gravatar image mkt29  ( 2011-07-13 08:55:07 -0500 )edit

Question Tools


Asked: 2011-07-13 07:17:57 -0500

Seen: 274 times

Last updated: Jul 13 '11