Calling the launch method of ROSLaunchManager would no longer return None and instead return a ROSLaunchController instance, allowing the user to interact with the underlying roslaunch process. Note that this change is fully backwards compatible as users can simply choose to ignore the return value as they do now.
At a minimum, the ROSLaunchController could expose the following methods:
terminate: terminates the underlying roslaunch process
close: alias for terminate
is_running: determines whether or not the underlying roslaunch process is running.
__enter__: does nothing; used to satisfy requirements of a context-managed object.
__exit__: closes the roslaunch via close
By adding __enter__ and __exit__, users can use the with keyword in conjuction with the ROSLaunchController instance to automatically close the launch process at the end of a context:
launch = roscore.roslaunch(...)
with launch:
# do stuff
# launch is dead!
with roscore.roslaunch(...) as launch:
# do stuff
# launch is dead!
There is also the possibility that the ROSLaunchController could expose the logs for its associated roslaunch process. This feature would be useful for debugging roslaunch processes that do not behave as expected.
Calling the
launch
method ofROSLaunchManager
would no longer returnNone
and instead return aROSLaunchController
instance, allowing the user to interact with the underlyingroslaunch
process. Note that this change is fully backwards compatible as users can simply choose to ignore the return value as they do now.At a minimum, the
ROSLaunchController
could expose the following methods:terminate
: terminates the underlyingroslaunch
processclose
: alias forterminate
is_running
: determines whether or not the underlyingroslaunch
process is running.__enter__
: does nothing; used to satisfy requirements of a context-managed object.__exit__
: closes theroslaunch
viaclose
By adding
__enter__
and__exit__
, users can use thewith
keyword in conjuction with theROSLaunchController
instance to automatically close the launch process at the end of a context:There is also the possibility that the
ROSLaunchController
could expose the logs for its associatedroslaunch
process. This feature would be useful for debuggingroslaunch
processes that do not behave as expected.