0
$\begingroup$

Rosanswers logo

Hi,

I have a launch file that starts several nodes, one of which processes a video file and publishes messages to topics, on per video frame basis. Other nodes listen to those topics and process the received messages. I would like to run this launch file in a script with different video files passed as launch file parameters. The issue is that the listening nodes do not know when the publisher node terminates, and thus roslaunch does not return since listening nodes are still running even though there are going to be no data published on the topics.

I can think of setting timers in the listening nodes and signal_shutdown(.) them if time lapse since last received message exceeds some predefined threshold, but I suppose there may be better solutions. I cannot send shutdown signal from one node to terminate another node within ROS API, right? What options (other than timer) do I have in order to implement that architecture in ROS?


Originally posted by Alexey Ozhigov on ROS Answers with karma: 31 on 2012-12-28

Post score: 2


Original comments

Comment by yigit on 2012-12-28:
I don't understand the problem very well. If you know the id of the roslaunch process, for example, is killing that process enough for you?

Comment by Alexey Ozhigov on 2012-12-28:
The problem is that if you have a launch file with several nodes, all of which perform some processing of fixed set data of predefined size, all of the nodes should know when the processing task they are running for is finished so that all the nodes terminate. Yes, I am now doing kill by PID.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

In the roslaunch xml include the option required="true" as shown here.


Originally posted by SL Remy with karma: 2022 on 2012-12-28

This answer was ACCEPTED on the original site

Post score: 5


Original comments

Comment by joq on 2012-12-28:
Good answer. I didn't know about that option.

$\endgroup$

Your Answer

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