A launch extension for ros2_control.
This packages provides a launch action for spawning controllers. It is compatible with Humble, Jazzy, Kilted and Rolling.
Examples for the 3 major launch file types, can be found in the examples folder.
The spawn_controller element can be used to spawn multiple controllers.
It has the following attributes:
The format is as follows: (format is hoverable.)
<attr_name>(<?OPTIONAL>, TYPE/Substitution[<REVOLVED_TYPE>]): Description (<?spawner default>)
spawner_name(Optional, Substitution[string]): The node name for the spawner. Defaults to thecontroller_manager/spawnerdefault naming (spawner default).controller_manager(Optional, Substitution[string]): The name of the target controller manager node. Defaults to'controller_manager'(spawner default).final_controller_state(Optional, Substitution[string]): The state for all controllers to end in, can be either'active','inactive'or'unconfigured'. Defaults to'active'.unload_on_kill(Optional, Substitution[bool]): If the spawner should stay active until the launch file receives a shutdown signal, at which moment the controllers will be unloaded. Defaults toFalse.activate_as_group(Optional, Substitution[bool]): If all controllers should be activated at once. Useful when activating chained controllers together. Defaults toFalse.controller_manager_timeout(Optional, Substitution[float]): Time to wait for the controller manager service to be available. Defaults to0.0s(indefinite) (spawner default).switch_timeout(Optional, Substitution[float]): Time to wait for a successful state switch of controllers. Useful when switching cannot be performed immediately, e.g., paused simulations at startup. Defaults to5.0s(spawner default).service_call_timeout(Optional, Substitution[float]): Time to wait for the service response from the controller manager. Defaults to10.0s(spawner default).emulate_tty(Optional, Substitution[bool]): Passed to the internally used Node action'semulate_ttyattribute. Defaults toFalse.output(Optional, Substitution[string]): Passed to the internally used Node action'soutputattribute, commonly used options are'screen','log'and'both', but other options are available. Defaults to'log'.if/unless(Optional, Substitution[bool]): The standard action conditionals. Always active if omitted.
The spawn_controller action can have a list of controller elements to spawn.
The controller elements are structured as follows:
name(Substitution[string]): The name of the controller to spawn.if/unless(Optional, Substitution[bool]): The standard conditionals. Always active if omitted.
remap(Optional, zero or more): The same remap structure as available on anodeaction, however these get specified with the controller name, so only this specific controller is effected.from(Substitution[string]): Which topic/service/action to remap.1to(Substitution[string]): The target to remap to.
param(Optional, zero or more): The same parameter structure as available on thenodeaction, however these get applied to the specific controller2. If normal parameters are provided for a controller itstypeparameter should also be specified. See thenodeaction for details.
This repo uses pre-commit, with gitlint which requires an extra hook to be installed:
# Install default hook and commit-msg
pre-commit install
# Explicitly
pre-commit install --hook-type pre-commit --hook-type commit-msgFootnotes
-
Action remapping is broken in Humble. The fix is available since Kilted (Kilted and up), however the Jazzy backport is still pending. ↩
-
Unless a parameter file is loaded, then it uses the specifier in the controller file. ↩