rosidl_cli.command.translate.extensions module

class rosidl_cli.command.translate.extensions.TranslateCommandExtension(name: str)

Bases: Extension

The extension point for interface definition translation.

The following attributes must be defined * input_format * output_format

The following methods must be defined: * translate

input_format: ClassVar[str]
output_format: ClassVar[str]
translate(package_name: str, interface_files: List[str], include_paths: List[str], output_path: Path) List[str]

Translate interface definition files.

The path to an interface definition file is a relative path optionally prefixed by an absolute path followed by a colon ‘:’, in which case path resolution is to be performed against that absolute path.

On output, the directory structure specified by this relative path will be replicated e.g. an msg/Empty.foo file will result in a msg/Empty.bar file under output_path.

Parameters:
  • package_name – name of the package interface_file belongs to

  • interface_files – list of paths to interface definition files

  • include_paths – list of paths to include dependency interface definition files from

  • output_path – path to directory to hold translated interface definition files

Returns:

list of paths to translated interface definition files

rosidl_cli.command.translate.extensions.load_translate_extensions(*, specs: List[str] | None, strict: bool) List[TranslateCommandExtension]

Load extensions for interface definition translation.