ros_sugar.config.robot#

Robot description primitives shared by all Sugarcoat components

Module Contents#

Classes#

StrEnum

A string-valued enum whose members behave like their own value.

RobotType

Robot motion model.

RobotGeometryType

Shape of the volume the robot occupies.

LinearCtrlLimits

Linear velocity control limits along one axis

AngularCtrlLimits

Angular velocity control limits

RobotFrames

Coordinate frames of the robot.

RobotConfig

Physical description of the robot: how it moves, how big it is, how fast.

API#

class ros_sugar.config.robot.StrEnum#

Bases: str, enum.Enum

A string-valued enum whose members behave like their own value.

enum.StrEnum only exists on Python 3.11+, so it is implemented here to keep the package usable on older interpreters.

The str mixin 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.StrEnum

Robot 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.StrEnum

Shape 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.BaseAttrs

Linear 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.BaseAttrs

Angular 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.BaseAttrs

Coordinate 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.BaseAttrs

Physical 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, ACKERMANN

Robot motion model type

geometry_type

RobotGeometryType | str, CYLINDER

Robot 3D geometry shape type

geometry_params

np.ndarray, [0.2, 1.0]

Shape parameters, whose length must match the geometry type

ctrl_vx_limits

LinearCtrlLimits

Forward linear velocity (x-direction) control limits

ctrl_omega_limits

AngularCtrlLimits

Angular velocity control limits

ctrl_vy_limits

LinearCtrlLimits

Lateral 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]]#