rosros 0.2.5
Simple unified interface to ROS1 / ROS2 Python API
Loading...
Searching...
No Matches
rosros.parsing Namespace Reference

Utilities for ROS message definition texts. More...

Functions

 calculate_definition_hash (typename, definition, subdefs=())
 Returns MD5 hash for message / service type definition.
 
 get_ros2_message_definition (typename, full=True)
 Returns ROS2 message/service type definition full text.
 
 get_ros2_message_definition_idl (typename)
 Returns ROS2 message type definition parsed from IDL file.
 
 get_ros2_service_definition (typename)
 Returns ROS2 service type definition full text.
 
 get_ros2_service_definition_idl (typename)
 Returns ROS2 service type definition parsed from IDL file.
 
 make_definition_hash_text (pkg, definition, subdefs=())
 Returns text for calculating message or service request/response type definition.
 
 parse_definition_subtypes (typedef)
 Returns subtype names and type definitions from a full message definition.
 
 rosidl_format_comment (text)
 Returns annotation text formatted with comment prefixes and escapes.
 
 rosidl_format_idl_type (typeobj, msgpackage, constant=False)
 Returns canonical type name for ROS2 IDL parser entity, like "uint8" or "nav_msgs/Path".
 
 rosidl_format_message_content (msgidl)
 Returns message IDL as .msg text.
 
 rosidl_get_comments (obj)
 Returns all comments for annotatable object, as [text, ].
 

Detailed Description

Utilities for ROS message definition texts.

Function Documentation

◆ calculate_definition_hash()

rosros.parsing.calculate_definition_hash (   typename,
  definition,
  subdefs = () 
)

Returns MD5 hash for message / service type definition.

Parameters
subdefsdefinitions for subtypes, if any, as ((typename, definition), )

Definition at line 36 of file parsing.py.

◆ get_ros2_message_definition()

rosros.parsing.get_ros2_message_definition (   typename,
  full = True 
)

Returns ROS2 message/service type definition full text.

Parses and assembles text from .msg or .srv or .idl files on disk.

Parameters
fullinclude subtype definitions, separated with lines of "="

Definition at line 133 of file parsing.py.

◆ get_ros2_message_definition_idl()

rosros.parsing.get_ros2_message_definition_idl (   typename)

Returns ROS2 message type definition parsed from IDL file.

Definition at line 179 of file parsing.py.

◆ get_ros2_service_definition()

rosros.parsing.get_ros2_service_definition (   typename)

Returns ROS2 service type definition full text.

Parses and assembles text from .srv or .idl files on disk.

Definition at line 166 of file parsing.py.

◆ get_ros2_service_definition_idl()

rosros.parsing.get_ros2_service_definition_idl (   typename)

Returns ROS2 service type definition parsed from IDL file.

Definition at line 192 of file parsing.py.

◆ make_definition_hash_text()

rosros.parsing.make_definition_hash_text (   pkg,
  definition,
  subdefs = () 
)

Returns text for calculating message or service request/response type definition.

Parameters
subdefsdefinitions for subtypes, as ((typename, definition), )

Definition at line 49 of file parsing.py.

◆ parse_definition_subtypes()

rosros.parsing.parse_definition_subtypes (   typedef)

Returns subtype names and type definitions from a full message definition.

Returns
{"pkg/MsgType": "full definition for MsgType including subtypes"}

Definition at line 90 of file parsing.py.

◆ rosidl_format_comment()

rosros.parsing.rosidl_format_comment (   text)

Returns annotation text formatted with comment prefixes and escapes.

Definition at line 246 of file parsing.py.

◆ rosidl_format_idl_type()

rosros.parsing.rosidl_format_idl_type (   typeobj,
  msgpackage,
  constant = False 
)

Returns canonical type name for ROS2 IDL parser entity, like "uint8" or "nav_msgs/Path".

Parameters
typeobjROS2 IDL parser entity, like `rosidl_parser.definition.Array`
msgpackagename of parsed package
constantwhether parsed item is a constant

Definition at line 213 of file parsing.py.

◆ rosidl_format_message_content()

rosros.parsing.rosidl_format_message_content (   msgidl)

Returns message IDL as .msg text.

Parameters
msgidlrosidl_parser.definition.Message instance

Definition at line 266 of file parsing.py.

◆ rosidl_get_comments()

rosros.parsing.rosidl_get_comments (   obj)

Returns all comments for annotatable object, as [text, ].

Definition at line 255 of file parsing.py.