grepros 1.2.2
grep for ROS bag files and live topics
|
Generic interface for accessing ROS1 / ROS2 API. More...
Public Member Functions | |
canonical (cls, typename) | |
Returns "pkg/Type" for "pkg/msg/Type", standardizes various ROS2 formats. | |
create_publisher (cls, topic, typecls, latch=True, queue_size=10) | |
Returns ROS publisher instance. | |
get_message_class (cls, typename) | |
Returns ROS message class. | |
get_message_fields (cls, val) | |
Returns OrderedDict({field name: field type name}) if ROS1 message, else {}. | |
get_message_types (cls) | |
Returns a list of available message types, as ["pksg/Msg", ]. | |
init (cls, launch=False) | |
Initializes ROS, creating and spinning node if specified. | |
is_ros_message (cls, val) | |
Returns whether value is a ROS message or special like time/duration. | |
is_ros_time (cls, val) | |
Returns whether value is a ROS time/duration. | |
make_full_typename (cls, typename) | |
Returns "pkg/msg/Type" for "pkg/Type". | |
message_to_yaml (cls, msg) | |
Returns ROS message as YAML string. | |
scalar (cls, typename, bound=False) | |
Returns scalar type from ROS message data type, like "uint8" from "uint8[100]". | |
shutdown (cls) | |
Public Attributes | |
ROS_TIME_CLASSES | |
Static Public Attributes | |
dict | DDS_TYPES |
ROS2 Data Distribution Service types to ROS built-ins. | |
NODE = None | |
rclpy.Node instance | |
list | ROS_BUILTIN_TYPES = ROS_NUMERIC_TYPES + ROS_STRING_TYPES |
All built-in basic types in ROS. | |
ROS_INTEGER_RANGES | |
Value ranges for ROS integer types, as {typename: (min, max)}. | |
list | ROS_NUMERIC_TYPES |
All built-in numeric types in ROS. | |
list | ROS_STRING_TYPES = ["string", "wstring"] |
All built-in string types in ROS. | |
dict | ROS_TIME_CLASSES |
ROS time/duration types mapped to type names. | |
Generic interface for accessing ROS1 / ROS2 API.
Definition at line 134 of file generate_msgs.py.
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 217 of file generate_msgs.py.
create_publisher | ( | cls, | |
topic, | |||
typecls, | |||
latch = True , |
|||
queue_size = 10 |
|||
) |
Returns ROS publisher instance.
Definition at line 247 of file generate_msgs.py.
get_message_class | ( | cls, | |
typename | |||
) |
Returns ROS message class.
Definition at line 257 of file generate_msgs.py.
get_message_fields | ( | cls, | |
val | |||
) |
Returns OrderedDict({field name: field type name}) if ROS1 message, else {}.
Definition at line 264 of file generate_msgs.py.
get_message_types | ( | cls | ) |
Returns a list of available message types, as ["pksg/Msg", ].
Definition at line 188 of file generate_msgs.py.
init | ( | cls, | |
launch = False |
|||
) |
Initializes ROS, creating and spinning node if specified.
Definition at line 196 of file generate_msgs.py.
is_ros_message | ( | cls, | |
val | |||
) |
Returns whether value is a ROS message or special like time/duration.
Definition at line 276 of file generate_msgs.py.
is_ros_time | ( | cls, | |
val | |||
) |
Returns whether value is a ROS time/duration.
Definition at line 283 of file generate_msgs.py.
make_full_typename | ( | cls, | |
typename | |||
) |
Returns "pkg/msg/Type" for "pkg/Type".
Definition at line 288 of file generate_msgs.py.
message_to_yaml | ( | cls, | |
msg | |||
) |
Returns ROS message as YAML string.
Definition at line 295 of file generate_msgs.py.
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.
bound | if True, does not strip string boundaries like "string<=10" |
Definition at line 309 of file generate_msgs.py.
shutdown | ( | cls | ) |
Definition at line 316 of file generate_msgs.py.
|
static |
ROS2 Data Distribution Service types to ROS built-ins.
Definition at line 176 of file generate_msgs.py.
|
static |
rclpy.Node instance
Definition at line 138 of file generate_msgs.py.
|
static |
All built-in basic types in ROS.
Definition at line 148 of file generate_msgs.py.
|
static |
Value ranges for ROS integer types, as {typename: (min, max)}.
Definition at line 159 of file generate_msgs.py.
|
static |
All built-in numeric types in ROS.
Definition at line 141 of file generate_msgs.py.
|
static |
All built-in string types in ROS.
Definition at line 145 of file generate_msgs.py.
|
static |
ROS time/duration types mapped to type names.
Definition at line 151 of file generate_msgs.py.
ROS_TIME_CLASSES |
Definition at line 285 of file generate_msgs.py.