Skip to content

SuperJappie08/launch_ros2_control

Repository files navigation

launch_ros2_control

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.

spawn_contoller/spawn-controller (SpawnControllers)

The spawn_controller element can be used to spawn multiple controllers. It has the following attributes:

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 the controller_manager/spawner default 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 to False.
  • activate_as_group (Optional, Substitution[bool]): If all controllers should be activated at once. Useful when activating chained controllers together. Defaults to False.
  • controller_manager_timeout (Optional, Substitution[float]): Time to wait for the controller manager service to be available. Defaults to 0.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 to 5.0s (spawner default).
  • service_call_timeout (Optional, Substitution[float]): Time to wait for the service response from the controller manager. Defaults to 10.0s (spawner default).
  • emulate_tty (Optional, Substitution[bool]): Passed to the internally used Node action's emulate_tty attribute. Defaults to False.
  • output (Optional, Substitution[string]): Passed to the internally used Node action's output attribute, 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.

Subelements/Structures

The spawn_controller action can have a list of controller elements to spawn. The controller elements are structured as follows:

Controller attributes

  • name (Substitution[string]): The name of the controller to spawn.
  • if/unless (Optional, Substitution[bool]): The standard conditionals. Always active if omitted.

Controller subelements

  • remap (Optional, zero or more): The same remap structure as available on a node action, however these get specified with the controller name, so only this specific controller is effected.
    • from (Substitution[string]): Which topic/service/action to remap.1
    • to (Substitution[string]): The target to remap to.
  • param (Optional, zero or more): The same parameter structure as available on the node action, however these get applied to the specific controller2. If normal parameters are provided for a controller its type parameter should also be specified. See the node action for details.

Development

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-msg

Footnotes

  1. Action remapping is broken in Humble. The fix is available since Kilted (Kilted and up), however the Jazzy backport is still pending.

  2. Unless a parameter file is loaded, then it uses the specifier in the controller file.

About

Launch extention for ros2_control

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages