step.motion.resync¶
Minimal resync steps that inject observations into the localization filter.
Classes¶
Inject a direct absolute pose observation without additional motion. |
|
Drive until an IR sensor sees a line, then inject a localization observation. |
|
Run wall-align, then inject a wall-based observation into localization. |
Functions¶
|
|
|
|
|
Module Contents¶
- class step.motion.resync.ResyncAtStartPose(expected_x_cm: float | None = None, expected_y_cm: float | None = None, expected_theta_deg: float | None = None, snap_axes: tuple[bool, bool, bool] = (True, True, True), sigma_xy_cm: float = 1.0, sigma_theta_deg: float = 5.0)¶
Bases:
step.StepInject a direct absolute pose observation without additional motion.
Reads the robot’s current odometry pose (or uses supplied override values) and feeds it as an absolute-pose observation into the localization filter. Use this at the start of a run to anchor the EKF to the known start pose.
- Parameters:
expected_x_cm – Override for the expected X position in cm. If None, the robot’s current odometric X is used.
expected_y_cm – Override for the expected Y position in cm. If None, the robot’s current odometric Y is used.
expected_theta_deg – Override for the expected heading in degrees. If None, the robot’s current odometric heading is used.
snap_axes – Which axes (x, y, theta) to include in the observation. Defaults to (True, True, True) — all three.
sigma_xy_cm – Position uncertainty (standard deviation) in cm.
sigma_theta_deg – Heading uncertainty (standard deviation) in degrees.
Example:
from raccoon.step.motion import resync_at_start_pose resync_at_start_pose(expected_x_cm=0.0, expected_y_cm=0.0, expected_theta_deg=0.0)
- expected_x_cm = None¶
- expected_y_cm = None¶
- expected_theta_deg = None¶
- snap_axes = (True, True, True)¶
- sigma_xy_cm = 1.0¶
- sigma_theta_deg = 5.0¶
- class step.motion.resync.FindLineResync(sensor: raccoon.sensor_ir.IRSensor, sensor_position: raccoon.map.SensorOffset, *, expected_x_cm: float | None = None, expected_y_cm: float | None = None, expected_theta_deg: float | None = None, snap_axes: tuple[bool, bool, bool] = (False, True, False), sigma_xy_cm: float = 1.0, sigma_theta_deg: float = 5.0, line_sigma_cm: float = 0.75, threshold: float = 0.7, forward_speed_mps: float = 0.15, strafe_speed_mps: float = 0.0, timeout_s: float = 3.0)¶
Bases:
step.motion.motion_step.MotionStepDrive until an IR sensor sees a line, then inject a localization observation.
- sensor¶
- sensor_position¶
- expected_x_cm = None¶
- expected_y_cm = None¶
- expected_theta_deg = None¶
- snap_axes = (False, True, False)¶
- sigma_xy_cm = 1.0¶
- sigma_theta_deg = 5.0¶
- line_sigma_cm = 0.75¶
- threshold = 0.7¶
- forward_speed_mps = 0.15¶
- strafe_speed_mps = 0.0¶
- timeout_s = 3.0¶
- class step.motion.resync.AlignToWallResync(direction: step.motion.wall_align.WallDirection = WallDirection.FORWARD, *, expected_x_cm: float | None = None, expected_y_cm: float | None = None, expected_theta_deg: float | None = None, snap_axes: tuple[bool, bool, bool] = (True, True, True), sigma_xy_cm: float = 1.0, sigma_theta_deg: float = 5.0, wall_sigma_cm: float = 0.75, sensor_position: SensorOffset | None = None, speed: float = 1.0, accel_threshold: float = 0.5, settle_duration: float = 0.2, max_duration: float = 5.0, grace_period: float = 0.3)¶
Bases:
step.StepRun wall-align, then inject a wall-based observation into localization.
- direction¶
- expected_x_cm = None¶
- expected_y_cm = None¶
- expected_theta_deg = None¶
- snap_axes = (True, True, True)¶
- sigma_xy_cm = 1.0¶
- sigma_theta_deg = 5.0¶
- wall_sigma_cm = 0.75¶
- sensor_position = None¶
- required_resources() frozenset[str]¶
Return the hardware resources this step requires exclusive access to.
For leaf steps (drive, motor, servo), return the resources this step directly uses. Composite steps override
collected_resourcesinstead to include children —required_resourcesstays empty for composites because they don’t touch hardware themselves.
- step.motion.resync.resync_at_start_pose(expected_x_cm: float | None = None, expected_y_cm: float | None = None, expected_theta_deg: float | None = None, *, snap_axes: tuple[bool, bool, bool] = (True, True, True), sigma_xy_cm: float = 1.0, sigma_theta_deg: float = 5.0) ResyncAtStartPose¶
- step.motion.resync.find_line_resync(sensor: raccoon.sensor_ir.IRSensor, sensor_position: raccoon.map.SensorOffset, *, expected_x_cm: float | None = None, expected_y_cm: float | None = None, expected_theta_deg: float | None = None, snap_axes: tuple[bool, bool, bool] = (False, True, False), sigma_xy_cm: float = 1.0, sigma_theta_deg: float = 5.0, line_sigma_cm: float = 0.75, threshold: float = 0.7, forward_speed_mps: float = 0.15, strafe_speed_mps: float = 0.0, timeout_s: float = 3.0) FindLineResync¶
- step.motion.resync.align_to_wall_resync(*, direction: step.motion.wall_align.WallDirection = WallDirection.FORWARD, expected_x_cm: float | None = None, expected_y_cm: float | None = None, expected_theta_deg: float | None = None, snap_axes: tuple[bool, bool, bool] = (True, True, True), sigma_xy_cm: float = 1.0, sigma_theta_deg: float = 5.0, wall_sigma_cm: float = 0.75, sensor_position: SensorOffset | None = None, speed: float = 1.0, accel_threshold: float = 0.5, settle_duration: float = 0.2, max_duration: float = 5.0, grace_period: float = 0.3) AlignToWallResync¶