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

Clean-up of rosparam after ending launch scripts

asked 2013-01-25 01:29:03 -0500

NickVT gravatar image

Hi,

I've a launch file that launches some PR2 controllers. I've another script that has to know which launch file has been launched. I tried creating a rosparam in my first launch file with the name of the controller. In my second script, I check the existence of the rosparam and whether the value corresponds with my desired file.

But it seems that these rosparam's are not deleted when the first launch file is terminated, also when this rosparam is set in a node.

My question is how to solve my problem, by either:

  • Deleting the rosparam when my script is terminating
  • Finding another way to check which launch file is executed
  • A total other solution I didn't think of

Thanks in advance!

Nick

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-01-25 01:38:34 -0500

dornhege gravatar image
  1. Deleting the rosparam when you are finished might work. roslaunch will not delete any set params. You should note that rosparams are set before the launch starts.
  2. There is no proper way for this.
  3. A different solution should be preferable. If you need help you'll need to state what you want to achieve.

roslaunch intentionally does not provide any dependencies between nodes and launches. If you need a node to be running before you do something else, you'd probably need to do something custom or solve the problem differently. The reason for this is that there is just no definition of what it means that a node is running.

edit flag offensive delete link more

Comments

  1. => but I can't do this from within the same launch file? or is there a 'when killed, do' option: a bit like spawn/respawn of the pr2_controller_manager
NickVT gravatar image NickVT  ( 2013-01-25 02:21:30 -0500 )edit

Not automatically. If you would include a rosparam delete command it will be executed immediately as it is "launched" as any other node. There might be a hack possible: Write a simple node that catches SIGINT and delete the param upon that. When you Ctrl-C the launch it should execute.

dornhege gravatar image dornhege  ( 2013-01-25 04:35:52 -0500 )edit

Question Tools

Stats

Asked: 2013-01-25 01:29:03 -0500

Seen: 1,552 times

Last updated: Jan 25 '13