Functions
rqt_py_common.topic_helpers Namespace Reference

Functions

def find_slots_by_type_bfs (msg_class, slot_type)
 
def find_slots_by_type_dfs (msg_class, slot_type)
 
def get_field_type (topic_name)
 
def get_slot_type (message_class, slot_path)
 
def get_type_class (type_name)
 
def is_slot_numeric (topic_name)
 

Function Documentation

◆ find_slots_by_type_bfs()

def rqt_py_common.topic_helpers.find_slots_by_type_bfs (   msg_class,
  slot_type 
)
Search inside msg_class for all slots of type slot_type and return their paths.
Uses a breadth first search, so it will find the most shallow matches first.

:param msg_class: The class to search in.
:param slot_type: The type name or class to search for (e.g. 'float64' or Quaternion).
:return: List of paths to slots of type slot_type inside msg_class (e.g. ['header/frame_id']).

Definition at line 158 of file topic_helpers.py.

◆ find_slots_by_type_dfs()

def rqt_py_common.topic_helpers.find_slots_by_type_dfs (   msg_class,
  slot_type 
)
Search inside msg_class for all slots of type slot_type and return their paths.
Uses a depth first search.

:param msg_class: The class to search in.
:param slot_type: The type name or class to search for (e.g. 'float64' or Quaternion).
:return: List of paths to slots of type slot_type inside msg_class (e.g. ['header/frame_id']).

Definition at line 123 of file topic_helpers.py.

◆ get_field_type()

def rqt_py_common.topic_helpers.get_field_type (   topic_name)
Get the Python type of a specific field in the given registered topic.
If the field is an array, the type of the array's values are returned and the is_array flag is set to True.
This is a static type check, so it works for unpublished topics and with empty arrays.

:param topic_name: name of field of a registered topic, ``str``, i.e. '/rosout/file'
:returns: field_type, is_array

Definition at line 50 of file topic_helpers.py.

◆ get_slot_type()

def rqt_py_common.topic_helpers.get_slot_type (   message_class,
  slot_path 
)
Get the Python type of a specific slot in the given message class.
If the field is an array, the type of the array's values are returned and the is_array flag is set to True.
This is a static type check, so it works for unpublished topics and with empty arrays.

:param message_class: message class type, ``type``, usually inherits from genpy.message.Message
:param slot_path: path to the slot inside the message class, ``str``, i.e. 'header/seq'
:returns: field_type, is_array

Definition at line 75 of file topic_helpers.py.

◆ get_type_class()

def rqt_py_common.topic_helpers.get_type_class (   type_name)

Definition at line 38 of file topic_helpers.py.

◆ is_slot_numeric()

def rqt_py_common.topic_helpers.is_slot_numeric (   topic_name)
Check is a slot in the given topic is numeric, or an array of numeric values.
This is a static type check, so it works for unpublished topics and with empty arrays.

:param topic_name: name of field of a registered topic, ``str``, i.e. '/rosout/file'
:returns: is_numeric, is_array, description

Definition at line 104 of file topic_helpers.py.



rqt_py_common
Author(s): Dorian Scholz , Isaac Saito, Dirk Thomas
autogenerated on Mon May 16 2022 02:49:40