ros_sugar.config.base_config#

Module Contents#

Classes#

QoSConfig

Class for quality of service (QoS) configuration in ROS2

BaseConfig

Node General Parameters

ComponentRunType

Component run type:

BaseComponentConfig

Component configuration parameters

API#

class ros_sugar.config.base_config.QoSConfig#

Bases: ros_sugar.config.base_attrs.BaseAttrs

Class for quality of service (QoS) configuration in ROS2

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.config.base_config.BaseConfig#

Bases: ros_sugar.config.base_attrs.BaseAttrs

Node General Parameters

Parameters:
  • loop_rate (float) – Rate (Hz) in which the node executes

  • visualization (bool) – To publish additional topics for visualization

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.config.base_config.ComponentRunType#

Bases: enum.Enum

Component run type:

  • Timed: Executes main in a timed loop

  • Event: Executes based on a trigger topic/event

  • Server: Executes based on a ROS service request from a client

  • ActionServer: Executes based on a ROS action server request from a client

classmethod to_str(enum_value) str#

Return string value corresponding to enum value if exists

Parameters:

enum_value (ComponentRunType | str) – description

Raises:

ValueError – If the enum value is not from this class

Returns:

String value

Return type:

str

name()#
value()#
class ros_sugar.config.base_config.BaseComponentConfig#

Bases: ros_sugar.config.base_config.BaseConfig

Component configuration parameters

Parameters:
  • use_without_launcher (bool) – To use the component without the Launcher. When True it initializes a ROS node on component init

  • layer_id (int) – Component layer ID. Refers to the component ‘start’ or ‘activate’ priority. Zero is equivalent to no-priority

  • fallback_rate (float) – Rate (Hz) in which the component checks for Fallbacks and executes actions if a failure is detected

  • run_type (ComponentRunType) – Component run type

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#