ros_sugar.io.topic
#
ROS Topic Configuration
Module Contents#
Classes#
Class for ROS topic configuration (name, type and QoS) |
|
Configure allowed types to restrict a component Topic |
Functions#
Gets all message types from supported data_types |
|
Gets a message type from supported data_types given a string name |
|
Validates that a string message type corresponds to a supported data type |
API#
- ros_sugar.io.topic.get_all_msg_types(msg_types_module: types.ModuleType = supported_types) List[type[ros_sugar.io.supported_types.SupportedType]] #
Gets all message types from supported data_types
- Returns:
Supported data types
- Return type:
list[type]
- ros_sugar.io.topic.get_msg_type(type_name: Union[type[ros_sugar.io.supported_types.SupportedType], str], msg_types_module: Optional[types.ModuleType] = supported_types) Union[type[ros_sugar.io.supported_types.SupportedType], str] #
Gets a message type from supported data_types given a string name
- Parameters:
type_name (str) – Message name
- Returns:
Supported data type or None if not found
- Return type:
type
- ros_sugar.io.topic.msg_type_validator(*_: Any, value)#
Validates that a string message type corresponds to a supported data type
- Parameters:
value (type) – description
- Raises:
ValueError – description
- class ros_sugar.io.topic.Topic#
Bases:
ros_sugar.config.BaseAttrs
Class for ROS topic configuration (name, type and QoS)
- asdict(filter: Optional[Callable] = None) Dict #
- from_dict(dict_obj: Dict) None #
- from_yaml(file_path: str, nested_root_name: str | None = None, get_common: bool = False) None #
- to_json() Union[str, bytes, bytearray] #
- from_json(json_obj: Union[str, bytes, bytearray]) None #
- has_attribute(attr_name: str) bool #
- get_attribute_type(attr_name: str) Optional[type] #
- update_value(attr_name: str, attr_value: Any) bool #
- class ros_sugar.io.topic.AllowedTopics#
Bases:
ros_sugar.config.BaseAttrs
Configure allowed types to restrict a component Topic
- asdict(filter: Optional[Callable] = None) Dict #
- from_dict(dict_obj: Dict) None #
- from_yaml(file_path: str, nested_root_name: str | None = None, get_common: bool = False) None #
- to_json() Union[str, bytes, bytearray] #
- from_json(json_obj: Union[str, bytes, bytearray]) None #
- has_attribute(attr_name: str) bool #
- get_attribute_type(attr_name: str) Optional[type] #
- update_value(attr_name: str, attr_value: Any) bool #