
Public Member Functions | |
| def | canonical (cls, typename) |
| def | create_publisher (cls, topic, typecls, latch=True, queue_size=10) |
| def | get_message_class (cls, typename) |
| def | get_message_fields (cls, val) |
| def | get_message_types (cls) |
| def | init (cls, launch=False) |
| def | is_ros_message (cls, val) |
| def | is_ros_time (cls, val) |
| def | make_full_typename (cls, typename) |
| def | message_to_yaml (cls, msg) |
| def | scalar (cls, typename, bound=False) |
| def | shutdown (cls) |
Static Public Attributes | |
| dictionary | DDS_TYPES |
| ROS2 Data Distribution Service types to ROS built-ins. More... | |
| NODE = None | |
| rclpy.Node instance More... | |
| list | ROS_BUILTIN_TYPES = ROS_NUMERIC_TYPES + ROS_STRING_TYPES |
| All built-in basic types in ROS. More... | |
| ROS_INTEGER_RANGES | |
| Value ranges for ROS integer types, as {typename: (min, max)}. More... | |
| list | ROS_NUMERIC_TYPES |
| All built-in numeric types in ROS. More... | |
| list | ROS_STRING_TYPES = ["string", "wstring"] |
| All built-in string types in ROS. More... | |
| dictionary | ROS_TIME_CLASSES |
| ROS time/duration types mapped to type names. More... | |
Generic interface for accessing ROS1 / ROS2 API.
Definition at line 132 of file generate_msgs.py.
| def generate_msgs.rosapi.canonical | ( | cls, | |
| typename | |||
| ) |
Returns "pkg/Type" for "pkg/msg/Type", standardizes various ROS2 formats. Converts DDS types like "octet" to "byte", and "sequence<uint8, 100>" to "uint8[100]".
Definition at line 210 of file generate_msgs.py.
| def generate_msgs.rosapi.create_publisher | ( | cls, | |
| topic, | |||
| typecls, | |||
latch = True, |
|||
queue_size = 10 |
|||
| ) |
Returns ROS publisher instance.
Definition at line 245 of file generate_msgs.py.
| def generate_msgs.rosapi.get_message_class | ( | cls, | |
| typename | |||
| ) |
Returns ROS message class.
Definition at line 255 of file generate_msgs.py.
| def generate_msgs.rosapi.get_message_fields | ( | cls, | |
| val | |||
| ) |
Returns OrderedDict({field name: field type name}) if ROS1 message, else {}.
Definition at line 262 of file generate_msgs.py.
| def generate_msgs.rosapi.get_message_types | ( | cls | ) |
Returns a list of available message types, as ["pksg/Msg", ].
Definition at line 186 of file generate_msgs.py.
| def generate_msgs.rosapi.init | ( | cls, | |
launch = False |
|||
| ) |
Initializes ROS, creating and spinning node if specified.
Definition at line 194 of file generate_msgs.py.
| def generate_msgs.rosapi.is_ros_message | ( | cls, | |
| val | |||
| ) |
Returns whether value is a ROS message or special like time/duration.
Definition at line 274 of file generate_msgs.py.
| def generate_msgs.rosapi.is_ros_time | ( | cls, | |
| val | |||
| ) |
Returns whether value is a ROS time/duration.
Definition at line 281 of file generate_msgs.py.
| def generate_msgs.rosapi.make_full_typename | ( | cls, | |
| typename | |||
| ) |
Returns "pkg/msg/Type" for "pkg/Type".
Definition at line 286 of file generate_msgs.py.
| def generate_msgs.rosapi.message_to_yaml | ( | cls, | |
| msg | |||
| ) |
Returns ROS message as YAML string.
Definition at line 293 of file generate_msgs.py.
| def generate_msgs.rosapi.scalar | ( | cls, | |
| typename, | |||
bound = False |
|||
| ) |
Returns scalar type from ROS message data type, like "uint8" from "uint8[100]". Returns type unchanged if already a scalar. @param bound if True, does not strip string boundaries like "string<=10"
Definition at line 300 of file generate_msgs.py.
| def generate_msgs.rosapi.shutdown | ( | cls | ) |
Definition at line 314 of file generate_msgs.py.
|
static |
ROS2 Data Distribution Service types to ROS built-ins.
Definition at line 174 of file generate_msgs.py.
|
static |
rclpy.Node instance
Definition at line 136 of file generate_msgs.py.
|
static |
All built-in basic types in ROS.
Definition at line 146 of file generate_msgs.py.
|
static |
Value ranges for ROS integer types, as {typename: (min, max)}.
Definition at line 157 of file generate_msgs.py.
|
static |
All built-in numeric types in ROS.
Definition at line 139 of file generate_msgs.py.
|
static |
All built-in string types in ROS.
Definition at line 143 of file generate_msgs.py.
|
static |
ROS time/duration types mapped to type names.
Definition at line 149 of file generate_msgs.py.