capella_ros_tools package

The capella_ros_tools package.

Submodules

capella_ros_tools.data_model module

Tool for parsing ROS messages.

class capella_ros_tools.data_model.ConstantDef(type: TypeDef, name: str, value: str, description: str)

Bases: object

Definition of a constant in a ROS message.

description: str
name: str
type: TypeDef
value: str
class capella_ros_tools.data_model.EnumDef(name: str, literals: list[ConstantDef], description: str)

Bases: object

Definition of an enum in a ROS message.

description: str
literals: list[ConstantDef]
name: str
class capella_ros_tools.data_model.FieldDef(type: TypeDef, name: str, description: str)

Bases: object

Definition of a field in a ROS message.

description: str
name: str
type: TypeDef
class capella_ros_tools.data_model.MessageDef(name: str, fields: list[FieldDef], enums: list[EnumDef], description: str)

Bases: object

Definition of a ROS message.

description: str
enums: list[EnumDef]
fields: list[FieldDef]
classmethod from_file(file: FilePath | Path, license_header: str | None = None, msg_description_regex: Pattern[str] | None = None) MessageDef

Create message definition from a .msg file.

classmethod from_string(msg_name: str, msg_string: str, msg_description_regex: Pattern[str] | None = None) MessageDef

Create message definition from a string.

name: str
class capella_ros_tools.data_model.MessagePkgDef(name: str, messages: list[MessageDef], packages: list[MessagePkgDef])

Bases: object

Definition of a ROS message package.

classmethod from_msg_folder(pkg_name: str, msg_path: FilePath | Path, license_header: str | None = None, msg_description_regex: Pattern[str] | None = None) MessagePkgDef

Create a message package definition from a folder.

messages: list[MessageDef]
name: str
packages: list[MessagePkgDef]
class capella_ros_tools.data_model.Range(min: str, max: str)

Bases: NamedTuple

Define range of values.

max: str

Alias for field number 1

min: str

Alias for field number 0

class capella_ros_tools.data_model.TypeDef(name: str, card: Range, package: str | None = None)

Bases: object

Type definition.

card: Range
classmethod from_string(type_str: str) TypeDef

Create a type definition from a string.

name: str
package: str | None = None

capella_ros_tools.exporter module

Tool for exporting a Capella data package to ROS messages.

capella_ros_tools.exporter.export(current_pkg: DataPkg, current_path: Path)

Export a Capella data package to ROS messages.

capella_ros_tools.importer module

Tool for importing ROS messages to a Capella data package.

class capella_ros_tools.importer.Importer(msg_path: str, no_deps: bool, license_header_path: Path | None = None, msg_description_regex: str | None = None)

Bases: object

Class for importing ROS messages to a Capella data package.

to_yaml(root_uuid: str, types_parent_uuid: str = '', types_uuid: str = '') str

Import ROS messages into a Capella data package.