ROS plugin doesn't quit in headless mode

Report crashes, strange behaviour, or apparent bugs
Post Reply
manip
Posts: 10
Joined: 14 Oct 2015, 11:27

ROS plugin doesn't quit in headless mode

Post by manip »

Hello,

I am using the ROS plugin for v.3.3.0 in headless mode on a linux machine, and it is running well.
However, when I try to terminate V-REP by hitting CTRL+C, V-REP stops responding and never quit. So, I need to kill the process manually.

I looked into the code a bit, and it seems that v_repEnd() for the ROS plugin is never called. (Maybe the termination process gets stuck before calling it?)

On the other hand, V-REP terminates cleanly when
- the ROS plugin was not loaded, or
- V-REP is running in GUI mode with ROS plugin.


It would be great if you can take a look and give me some advice.
Thank you.

coppelia
Site Admin
Posts: 10360
Joined: 14 Dec 2012, 00:25

Re: ROS plugin doesn't quit in headless mode

Post by coppelia »

Hello,

CTRL+C is not directly supported, I guess when you use it it will simply kill the process. You should call simQuitSimulator from a child script, or from within a plugin. If you do that make sure that no simulation is running (simStopSimulation, then wait a bit, since the command needs a few cycles to execute).

Have a look at the beta release that came out today: with the new RosInterface, you can easily achieve what you want. With the old RosPlugin you could also do it by simply setting a specific signal, and a child script / customization script reacting to that signal and executing the quit command.

Cheers

manip
Posts: 10
Joined: 14 Oct 2015, 11:27

Re: ROS plugin doesn't quit in headless mode

Post by manip »

Thanks for the information. In the meantime I tried the following bash commands to unload the ROS plugin node from the master and kill the process, but maybe I need a fancier way to do that.
$ kill -2 $(pgrep vrep); sleep 1; kill -15 $(pgrep vrep);

By the way, the new ROS plugin looks good! Thank you for your continued support for ROS users.

Post Reply