Ask Your Question
0

ros2 launch doesn't exit on ctrlc

asked 2018-06-13 11:04:00 -0500

Faraz Khan gravatar image

Im using the following launch file:

def launch(launch_descriptor, argv):
ld = launch_descriptor

ld.add_process(
    cmd=[get_executable_path(package_name='canoc', executable_name='transceiver')]
)

ld.add_process(
    cmd=[get_executable_path(package_name='radar', executable_name='radar_controller')]
)

This is being launched using:

launch all_launch.launch

Everything works fine but if I try to ctrl+c out the whole thing gets stuck and I have to kill -9 my way out of it. The last thing I get is:

[0] KeyboardInterrupt
(0) signal SIGTERM
(0) rc -15
(1) rc 1

and thats it. Any ideas? Am I supposed to launch this thing differently or is this a bug? I saw something as it relates to windows but not Ubuntu. This is ubuntu 18.04 btw, built from source. Thanks!

edit retag flag offensive close merge delete

Comments

when I do ctrlC , ros2 launch exit but is there any other way to do so ? Can we do something like "shutdown" from the launch.py file itself? Thanks.

poonam1120 gravatar image poonam1120  ( 2018-12-04 02:52:21 -0500 )edit

I converted your response to a comment, please do not use "answer" as a way to ask a new question. Also new questions should be posted as new questions, not comments to related questions.

William gravatar image William  ( 2018-12-04 16:25:19 -0500 )edit

Have a look at this: https://answers.ros.org/question/3078... I believe it already answers your question.

William gravatar image William  ( 2018-12-04 16:25:34 -0500 )edit

please pardon my comment. ros2 launch exit is not working only with ctrlC. After ctrlC, ctrZ needs to be given in order to exit/stop.

^C[WARNING] [launch.LaunchService]: user interrupted with ctrl-c (SIGINT)
[ERROR] [launch.LaunchService]: Caught exception in launch (see debug for trac
poonam1120 gravatar image poonam1120  ( 2018-12-06 12:40:06 -0500 )edit

Please ask a new question and post the link here. This isn't the same issue as described in the question above, nor is it about the same launch. OP is using launch.legacy, you're using the new launch.

William gravatar image William  ( 2018-12-06 14:42:43 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-06-13 11:12:09 -0500

Dirk Thomas gravatar image

I assume you are building the current state rather than Ardent from source?

Currently this is only known to happen on Windows (see https://github.com/ros2/launch/issues/64 ). If this happens for you on Ubuntu can you please post a reproducible example on the ticket so that it can be investigated. Thanks.

edit flag offensive delete link more

Comments

Im building ardent from source. Should I just build master/HEAD?

Faraz Khan gravatar image Faraz Khan  ( 2018-06-13 11:29:31 -0500 )edit

To be precise im using the 'release-latest' repo which seems like it is ardent.

Faraz Khan gravatar image Faraz Khan  ( 2018-06-13 11:30:54 -0500 )edit

Since the Ardent releases patches like https://github.com/ros2/launch/pull/69 have been merged on master. You could try master to check if the problem still exists or if it has been resolved and report back.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-06-13 11:37:43 -0500 )edit

That definitely sounds like my issue. Building master now. Thanks Dirk!

Faraz Khan gravatar image Faraz Khan  ( 2018-06-13 11:46:14 -0500 )edit

Wuhoo its fixed in master. However something tiny is broken: in setup.py for ros2/launch its now launch.legacy.main instead of launch.main (I think these were moved to legacy in the last commit). I can fork/PR if you want.

Faraz Khan gravatar image Faraz Khan  ( 2018-06-13 12:45:39 -0500 )edit

The legacy subdirectory isn't a bug but has been intentionally moved in https://github.com/ros2/launch/pull/73 . It makes "room" for the upcoming code for the improved launch (see https://github.com/ros2/launch/pull/74 ).

Dirk Thomas gravatar image Dirk Thomas  ( 2018-06-13 13:13:28 -0500 )edit

I wasn't saying thats a bug - but not renaming the control_script from launch.main to launch.legacy.main is - I see thats part of the PR so eventually whenever that PR gets merged its all good. But till then launch is broken on master (complains that launch.main doesn't exist)

Faraz Khan gravatar image Faraz Khan  ( 2018-06-13 13:30:59 -0500 )edit

Can you link to the exact file / line you a referring to. That makes it easier to follow and everyone is on the same page. And we can make sure that it is addressed.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-06-13 13:36:42 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-06-13 11:04:00 -0500

Seen: 847 times

Last updated: Dec 04 '18