irsim.lib.handler#
Handler classes for IR-SIM simulation.
This package contains factory classes for: - kinematics_handler: Kinematics factory - geometry_handler: Geometry factory
Submodules#
Classes#
Factory class to create geometry handlers. |
|
Factory class to create kinematics handlers. |
Package Contents#
- class irsim.lib.handler.GeometryFactory[源代码]#
Factory class to create geometry handlers.
- static create_geometry(name: str = 'circle', **kwargs) geometry_handler[源代码]#
Create a geometry handler from a YAML
shapename.- 参数:
name -- Shape name. Supported values are
circle,polygon,rectangle,compound,linestring, andmap.**kwargs -- Shape-specific parameters forwarded to the handler.
- 返回:
Concrete geometry handler.
- 返回类型:
- 抛出:
ValueError -- If
nameis not supported.
- class irsim.lib.handler.KinematicsFactory[源代码]#
Factory class to create kinematics handlers.
- static create_kinematics(name: str | None = None, noise: bool = False, alpha: list | None = None, mode: str | None = None, wheelbase: float | None = None, role: str = 'robot', *, shape_wheelbase: float | None = None, **kwargs: Any) KinematicsHandler[源代码]#
Create a kinematics handler from a YAML
kinematicsblock.- 参数:
name -- Registered kinematics name:
diff,omni,omni_angular,acker, or a custom name registered withregister_kinematics().Nonedefaults todiff;staticis retained as the static-object sentinel.noise -- Whether to apply motion noise.
alpha -- Noise parameters passed to the handler.
mode -- Steering mode of
ackerhandlers; forwarded when given.wheelbase -- Wheelbase set under
kinematics; forwarded when given and takes precedence overshape_wheelbase.role -- Object role, retained for API compatibility.
shape_wheelbase -- Wheelbase taken from a car-like shape; the fallback for
ackerhandlers (default1.0) whenwheelbaseis not given.**kwargs -- Any other
kinematicskey, forwarded to the handler's__init__(a custom handler's own parameters).
- 返回:
Handler instance for
name.- 返回类型:
- 抛出:
NotImplementedError -- If
nameis not registered.TypeError -- If the handler does not accept a forwarded parameter.
- static get_handler_class(name: str) type[KinematicsHandler] | None[源代码]#
Look up a registered handler class by name without instantiation.
- 参数:
name (str) -- Kinematics name (e.g.
"diff","omni").- 返回:
The class, or
Noneif not found.- 返回类型:
type[KinematicsHandler] | None