|
def | calculate_definition_hash (typename, msgdef, extradefs=()) |
|
def | canonical (typename, unbounded=False) |
|
def | create_publisher (topic, cls_or_typename, queue_size) |
|
def | create_subscriber (topic, cls_or_typename, handler, queue_size) |
|
def | deserialize_message (msg, cls_or_typename) |
|
def | dict_to_message (dct, msg) |
|
def | filter_fields (fieldmap, top=(), include=(), exclude=()) |
|
def | format_message_value (msg, name, value) |
|
def | get_alias_type (typename) |
|
def | get_message_class (typename) |
|
def | get_message_definition (msg_or_type) |
|
def | get_message_fields (val) |
|
def | get_message_type (msg_or_cls) |
|
def | get_message_type_hash (msg_or_type) |
|
def | get_message_value (msg, name, typename) |
|
def | get_ros_time_category (msg_or_type) |
|
def | get_rostime (fallback=False) |
|
def | get_topic_types () |
|
def | get_type_alias (typename) |
|
def | init_node (name=None) |
|
def | is_ros_message (val, ignore_time=False) |
|
def | is_ros_time (val) |
|
def | iter_message_fields (msg, messages_only=False, flat=False, scalars=(), include=(), exclude=(), top=()) |
|
def | make_bag_time (stamp, bag) |
|
def | make_duration (secs=0, nsecs=0) |
|
def | make_full_typename (typename, category="msg") |
|
def | make_live_time (stamp) |
|
def | make_message_hash (msg, include=(), exclude=()) |
|
def | make_time (secs=0, nsecs=0) |
|
def | message_to_dict (msg, replace=None) |
|
def | parse_definition_fields (typename, typedef) |
|
def | parse_definition_subtypes (typedef, nesting=False) |
|
def | scalar (typename) |
|
def | serialize_message (msg) |
|
def | set_message_value (obj, name, value) |
|
def | shutdown_node () |
|
def | time_message (val, to_message=True, clock_type=None) |
|
def | to_datetime (val) |
|
def | to_decimal (val) |
|
def | to_duration (val) |
|
def | to_nsec (val) |
|
def | to_sec (val) |
|
def | to_sec_nsec (val) |
|
def | to_time (val) |
|
def | validate (live=False) |
|
|
list | __all___ |
|
tuple | BAG_EXTENSIONS = () |
| Bagfile extensions to seek, including leading dot, populated after init. More...
|
|
string | NODE_NAME = "grepros" |
| Node base name for connecting to ROS (will be anonymized). More...
|
|
| realapi = None |
| Module grepros.ros1 or grepros.ros2. More...
|
|
| ROS1 = None |
| Flag denoting ROS1 environment, populated on validate() More...
|
|
| ROS2 = None |
| Flag denoting ROS2 environment, populated on validate() More...
|
|
dictionary | ROS_ALIAS_TYPES = {} |
| Mapping between type aliases and real types, like {"byte": "int8"} in ROS1. More...
|
|
dictionary | ROS_BUILTIN_CTORS |
| Python constructors for ROS built-in types, as {ROS name: type class}. More...
|
|
list | ROS_BUILTIN_TYPES = ROS_NUMERIC_TYPES + ROS_STRING_TYPES |
| All built-in basic types in ROS. More...
|
|
list | ROS_COMMON_TYPES = [] |
| All built-in basic types plus time types in ROS, populated after init. More...
|
|
| ROS_FAMILY = None |
| ROS Python module family, "rospy" or "rclpy", populated on validate() 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 = {} |
| ROS1 time/duration types mapped to type names, populated after init. More...
|
|
list | ROS_TIME_TYPES = [] |
| ROS time/duration types, populated after init. More...
|
|
| ROS_VERSION = None |
| ROS version from environment, populated on validate() as integer. More...
|
|
tuple | SKIP_EXTENSIONS = () |
| Bagfile extensions to skip, including leading dot, populated after init. More...
|
|
def grepros.api.canonical |
( |
|
typename, |
|
|
|
unbounded = False |
|
) |
| |
Returns "pkg/Type" for "pkg/subdir/Type", standardizes various ROS2 formats.
Converts ROS2 DDS types like "octet" to "byte", and "sequence<uint8, 100>" to "uint8[100]".
@param unbounded drop constraints like array bounds, and string bounds in ROS2,
e.g. returning "uint8[]" for "uint8[10]"
Definition at line 664 of file api.py.
def grepros.api.filter_fields |
( |
|
fieldmap, |
|
|
|
top = () , |
|
|
|
include = () , |
|
|
|
exclude = () |
|
) |
| |
Returns fieldmap filtered by include and exclude patterns.
@param fieldmap {field name: field type name}
@param top parent path as (rootattr, ..)
@param include [((nested, path), re.Pattern())] to require in parent path
@param exclude [((nested, path), re.Pattern())] to reject in parent path
Definition at line 691 of file api.py.
def grepros.api.iter_message_fields |
( |
|
msg, |
|
|
|
messages_only = False , |
|
|
|
flat = False , |
|
|
|
scalars = () , |
|
|
|
include = () , |
|
|
|
exclude = () , |
|
|
|
top = () |
|
) |
| |
Yields ((nested, path), value, typename) from ROS message.
@param messages_only whether to yield only values that are ROS messages themselves
or lists of ROS messages, else will yield scalar and list values
@param flat recurse into lists of nested messages, ignored if `messages_only`
@param scalars sequence of ROS types to consider as scalars, like ("time", duration")
@param include [((nested, path), re.Pattern())] to require in field path, if any
@param exclude [((nested, path), re.Pattern())] to reject in field path, if any
@param top internal recursion helper
Definition at line 826 of file api.py.
def grepros.api.make_message_hash |
( |
|
msg, |
|
|
|
include = () , |
|
|
|
exclude = () |
|
) |
| |
Returns hashcode for ROS message, as a hex digest.
@param include message fields to include if not all, as [((nested, path), re.Pattern())]
@param exclude message fields to exclude, as [((nested, path), re.Pattern())]
Definition at line 938 of file api.py.
def grepros.api.parse_definition_fields |
( |
|
typename, |
|
|
|
typedef |
|
) |
| |
Returns field names and type names from a message definition text.
Does not recurse into subtypes.
@param typename ROS message type name, like "my_pkg/MyCls"
@param typedef ROS message definition, like "Header header\nbool a\nMyCls2 b"
@return ordered {field name: type name},
like {"header": "std_msgs/Header", "a": "bool", "b": "my_pkg/MyCls2"}
Definition at line 1021 of file api.py.