ros_sugar.config.robot#
Robot description primitives shared by all Sugarcoat components
Module Contents#
Classes#
A string-valued enum whose members behave like their own value. |
|
Robot motion model. |
|
Shape of the volume the robot occupies. |
|
Linear velocity control limits along one axis |
|
Angular velocity control limits |
|
Coordinate frames of the robot. |
|
Physical description of the robot: how it moves, how big it is, how fast. |
API#
- class ros_sugar.config.robot.StrEnum#
Bases:
str,enum.EnumA string-valued enum whose members behave like their own value.
enum.StrEnumonly exists on Python 3.11+, so it is implemented here to keep the package usable on older interpreters.The
strmixin is the load-bearing part: it makes a member compare equal to its name across package boundaries, so a consumer holding an equivalent enum of its own (or a plain string read from a config file) still matches. Overriding__str__keeps serialization emitting"CYLINDER"rather than the"RobotGeometryType.CYLINDER"repr that a bare mixin produces.- classmethod get_enum(__value: str) Optional[ros_sugar.config.robot.T]#
Get Enum member equal to the given value
- Parameters:
__value (str) – Reference value
- Returns:
Enum member
- Return type:
StrEnum | None
- classmethod values() List[str]#
Get all enum values
- capitalize()#
- casefold()#
- center()#
- count()#
- encode()#
- endswith()#
- expandtabs()#
- find()#
- format()#
- format_map()#
- index()#
- isalnum()#
- isalpha()#
- isascii()#
- isdecimal()#
- isdigit()#
- isidentifier()#
- islower()#
- isnumeric()#
- isprintable()#
- isspace()#
- istitle()#
- isupper()#
- join()#
- ljust()#
- lower()#
- lstrip()#
- partition()#
- removeprefix()#
- removesuffix()#
- replace()#
- rfind()#
- rindex()#
- rjust()#
- rpartition()#
- rsplit()#
- rstrip()#
- split()#
- splitlines()#
- startswith()#
- strip()#
- swapcase()#
- title()#
- translate()#
- upper()#
- zfill()#
- name()#
- value()#
- class ros_sugar.config.robot.RobotType#
Bases:
ros_sugar.config.robot.StrEnumRobot motion model.
- classmethod get_enum(__value: str) Optional[ros_sugar.config.robot.T]#
- classmethod values() List[str]#
- capitalize()#
- casefold()#
- center()#
- count()#
- encode()#
- endswith()#
- expandtabs()#
- find()#
- format()#
- format_map()#
- index()#
- isalnum()#
- isalpha()#
- isascii()#
- isdecimal()#
- isdigit()#
- isidentifier()#
- islower()#
- isnumeric()#
- isprintable()#
- isspace()#
- istitle()#
- isupper()#
- join()#
- ljust()#
- lower()#
- lstrip()#
- partition()#
- removeprefix()#
- removesuffix()#
- replace()#
- rfind()#
- rindex()#
- rjust()#
- rpartition()#
- rsplit()#
- rstrip()#
- split()#
- splitlines()#
- startswith()#
- strip()#
- swapcase()#
- title()#
- translate()#
- upper()#
- zfill()#
- name()#
- value()#
- class ros_sugar.config.robot.RobotGeometryType#
Bases:
ros_sugar.config.robot.StrEnumShape of the volume the robot occupies.
- classmethod get_enum(__value: str) Optional[ros_sugar.config.robot.T]#
- classmethod values() List[str]#
- capitalize()#
- casefold()#
- center()#
- count()#
- encode()#
- endswith()#
- expandtabs()#
- find()#
- format()#
- format_map()#
- index()#
- isalnum()#
- isalpha()#
- isascii()#
- isdecimal()#
- isdigit()#
- isidentifier()#
- islower()#
- isnumeric()#
- isprintable()#
- isspace()#
- istitle()#
- isupper()#
- join()#
- ljust()#
- lower()#
- lstrip()#
- partition()#
- removeprefix()#
- removesuffix()#
- replace()#
- rfind()#
- rindex()#
- rjust()#
- rpartition()#
- rsplit()#
- rstrip()#
- split()#
- splitlines()#
- startswith()#
- strip()#
- swapcase()#
- title()#
- translate()#
- upper()#
- zfill()#
- name()#
- value()#
- class ros_sugar.config.robot.LinearCtrlLimits#
Bases:
ros_sugar.config.base_attrs.BaseAttrsLinear velocity control limits along one axis
- asdict(filter: Optional[Callable] = None) Dict#
- to_dict() Dict#
- asdict_explicit() Dict#
- from_dict(dict_obj: Dict) None#
- from_file(file_path: str, nested_root_name: Union[str, None] = None, get_common: bool = False) bool#
- 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#
- classmethod get_fields_info(class_object) Dict[str, Dict[str, Any]]#
- class ros_sugar.config.robot.AngularCtrlLimits#
Bases:
ros_sugar.config.base_attrs.BaseAttrsAngular velocity control limits
- asdict(filter: Optional[Callable] = None) Dict#
- to_dict() Dict#
- asdict_explicit() Dict#
- from_dict(dict_obj: Dict) None#
- from_file(file_path: str, nested_root_name: Union[str, None] = None, get_common: bool = False) bool#
- 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#
- classmethod get_fields_info(class_object) Dict[str, Dict[str, Any]]#
- class ros_sugar.config.robot.RobotFrames#
Bases:
ros_sugar.config.base_attrs.BaseAttrsCoordinate frames of the robot.
Only the two frames a deployment genuinely has to choose are declared here. Every other frame is read from the online data.
Name
Type, Default
Description
robot_base
str,"base_link"Frame rigidly attached to the robot body.
world
str,"map"Global reference frame the robot operates in. Goals, paths and maps are expressed in it, and robot location is transformed into it.
- asdict(filter: Optional[Callable] = None) Dict#
- to_dict() Dict#
- asdict_explicit() Dict#
- from_dict(dict_obj: Dict) None#
- from_file(file_path: str, nested_root_name: Union[str, None] = None, get_common: bool = False) bool#
- 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#
- classmethod get_fields_info(class_object) Dict[str, Dict[str, Any]]#
- class ros_sugar.config.robot.RobotConfig#
Bases:
ros_sugar.config.base_attrs.BaseAttrsPhysical description of the robot: how it moves, how big it is, how fast.
This is a navigation description – a motion model, a bounding volume and a velocity envelope. It deliberately carries no links, joints, masses or URDF: consumers that need those read them from the ROS graph.
Name
Type, Default
Description
model_type
RobotType | str,ACKERMANNRobot motion model type
geometry_type
RobotGeometryType | str,CYLINDERRobot 3D geometry shape type
geometry_params
np.ndarray,[0.2, 1.0]Shape parameters, whose length must match the geometry type
ctrl_vx_limits
LinearCtrlLimitsForward linear velocity (x-direction) control limits
ctrl_omega_limits
AngularCtrlLimitsAngular velocity control limits
ctrl_vy_limits
LinearCtrlLimitsLateral linear velocity (y-direction) control limits
- validate_params(_, value)#
Validates geometry parameters against geometry type
- asdict(filter: Optional[Callable] = None) Dict#
- to_dict() Dict#
- asdict_explicit() Dict#
- from_dict(dict_obj: Dict) None#
- from_file(file_path: str, nested_root_name: Union[str, None] = None, get_common: bool = False) bool#
- 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#
- classmethod get_fields_info(class_object) Dict[str, Dict[str, Any]]#