feat: RPLIDAR safety zone detector (Issue #575) #580
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sl-perception/issue-575-safety-zone"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements
saltybot_safety_zone— a ROS2 Python node that processes the RPLIDAR A1M8/scaninto three concentric 360° safety zones, latches an e-stop when DANGER is detected in the forward arc, and overrides/cmd_velto zero while latched.Zone thresholds (configurable)
Sector grid
{sector, angle_deg, zone, min_range_m, forward}E-stop behaviour
Twistpublished to/cmd_velon every scan + everycmd_vel_inputmessage/saltybot/safety_zone/clear_estop(std_srvs/Trigger) — only succeeds when no DANGER sectors remainestop_all_arcs: truetriggers on DANGER anywhere in 360°Topics
/scan/cmd_vel_input/saltybot/safety_zone/saltybot/safety_zone/status/cmd_vel/saltybot/safety_zoneJSON (every scan)/saltybot/safety_zone/statusJSON (10 Hz)cmd_vel intercept chain
When e-stopped, the safety zone node blocks
/cmd_vel_inputand publishes zero to/cmd_vel.Test plan
colcon build --packages-select saltybot_safety_zonesucceedsros2 run saltybot_safety_zone safety_zone/saltybot/safety_zonepublishes 36 sectors on every/scanmessage/cmd_velzeroed immediately on latch/cmd_vel_inputblocked while latchedestop_all_arcs: truetriggers on side/rear DANGER tooCloses #575
Add saltybot_safety_zone — ROS2 Python node that processes the RPLIDAR A1M8 /scan into three concentric 360° safety zones, latches an e-stop when DANGER is detected in the forward arc, and overrides /cmd_vel to zero while the latch is active. Zone thresholds (default): DANGER < 0.30 m — latching e-stop in forward arc WARN < 1.00 m — advisory (published in sector data) CLEAR otherwise Sector grid: 36 sectors of 10° each (sector 0 = robot forward, CCW positive). Per-sector: angle_deg, zone, min_range_m, in_forward_arc flag. E-stop behaviour: - Latches after estop_debounce_frames (2) consecutive DANGER scans in the forward arc (configurable ±30°, or all-arcs mode). - While latched: zero Twist published to /cmd_vel every scan + every incoming /cmd_vel_input message is blocked. - Clear only via service (obstacle must be gone): /saltybot/safety_zone/clear_estop (std_srvs/Trigger) Published topics: /saltybot/safety_zone String/JSON every scan — per-sector {sector, angle_deg, zone, min_range_m, forward} — estop_active, estop_reason, danger_sectors[], warn_sectors[] /saltybot/safety_zone/status String/JSON 10 Hz — forward_zone, closest_obstacle_m, danger/warn counts /cmd_vel Twist zero when e-stopped Subscribed topics: /scan LaserScan — RPLIDAR A1M8 /cmd_vel_input Twist — upstream velocity (pass-through / block) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>