Solving all tasks from withing one script




Solving all tasks from withing one script

Postby proprentnerl » Thu 25. Sep 2014, 12:04

Hello again,

as I have written in another topic ros cannot handle time_jumps very well, especially tf.
So after solving a task, it is necessary to kill all nodes using tf frames which brings up the problem that there seems to be no sure kill method for all nodes except restarting the roscore (which is not possible in the final evaluation).
I tried to simply relaunch my launch file, which starts all nodes a new but can lead to conditions where a node subscribes to an old node which than gets killed.

Any help would be appreciated!
Lukas
proprentnerl
 
Posts: 17
Joined: Tue 29. Jul 2014, 09:45

by Advertising » Thu 25. Sep 2014, 12:04

Advertising
 

Re: Solving all tasks from withing one script

Postby Peter Lehner » Thu 25. Sep 2014, 12:36

Hi,

proprentnerl wrote:I tried to simply relaunch my launch file, which starts all nodes a new but can lead to conditions where a node subscribes to an old node which than gets killed.

The problem I see is that the old ros nodes are not killed before you start your new nodes. Before relaunching your nodes you should probably check which of your old nodes are still running and kill them manually. You can use the 'rosnode' tool to do so:
Code: Select all
rosnode list
will list all current running nodes.
Code: Select all
rosnode kill YOUR_ROS_NODE
will kill the node with the name 'YOUR_ROS_NODE' and block until its shutdown.

Be careful though not to accidentally kill any of the simulator nodes.

Best,
Peter
Peter Lehner
 
Posts: 53
Joined: Fri 27. Jun 2014, 14:33

Re: Solving all tasks from withing one script

Postby proprentnerl » Thu 25. Sep 2014, 12:44

rosnode kill is sadly not very reliable...
there is simply no reliable way to reset everything in ros without restarting the roscore
proprentnerl
 
Posts: 17
Joined: Tue 29. Jul 2014, 09:45


Return to Stage 1 - Simulation

Who is online

No registered users

cron