0
$\begingroup$

Rosanswers logo

There are a lot of threads on a bug in openni that crash the kinect because xnsensorserver is not shut down correctly. The solution seems to be to run this script (xn_sensor_server_cleanup.sh) from the launchfile to kill xnsensorserver automatically.

I tried to call this from my launchfile, but it just waits for ctrl-c without starting any of the nodes that should be started by the launchfile. Have anyone been successful in running this script? Currently I call the script by this command (in the end of the launchfile):

<param name="cleanup" command="$(find crops_fruit_localization)/include/xn_sensor_server_cleanup.sh"/> 

Originally posted by Ola Ringdahl on ROS Answers with karma: 328 on 2012-11-04

Post score: 0


Original comments

Comment by dornhege on 2012-11-04:
By putting this into a param command, are you trying some nasty hack that will have this executed before actual nodes? I'm not sure what this will result in.

Comment by Ola Ringdahl on 2012-11-04:
No i would like it to execute after the other nodes have been executed. The script waits until the user press ctrl-c and then it kills xnsensorserver, so it does not remove anything until the program is terminated. The problem is that it prevents any other nodes to be started.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If it waits for Ctrl-C to kill the nodes, just put it in a normal tag and everything should work. As it is, it is clear that it will wait as the param handling will wait for the command to finish to read in the parameter.

I'm not sure if Ctrl-C will conflict with roslaunch catching Ctrl-C to shutdown the launch. Then you'd need to wrap that script.


Originally posted by dornhege with karma: 31395 on 2012-11-05

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Ola Ringdahl on 2012-11-05:
That seems logical, but how can I call a shell script within a node tag, do I have to add something to CMakeLists.txt?

Comment by dornhege on 2012-11-05:
No, you don't need to do anything. Just treat it like any other ROS node.

Comment by Ola Ringdahl on 2012-11-05:
I have tried a couple of variations of but I get an error saying it cannot launch it. I have tried putting the script in different folder (src/, bin/, include/) without success.

Comment by dornhege on 2012-11-05:
Can you rosrun it?

Comment by Ola Ringdahl on 2012-11-05:
I just realized I misspelled the package name. Now everything works as it should :) Thanks for your help!

$\endgroup$

Your Answer

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