Implements ROS2 geofence enforcer for SaltyBot with: - Loads polygon geofence from params (list of x/y vertices) - Subscribes to /odom for real-time robot position - Point-in-polygon ray casting algorithm for boundary checking - Publishes Bool on /saltybot/geofence_breach on boundary violation - Optional enforcement flag for cmd_vel zeroing - Configurable safety margin - Includes 20+ unit tests for geometry and breach detection Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
12 lines
363 B
YAML
12 lines
363 B
YAML
geofence:
|
|
ros__parameters:
|
|
# Polygon vertices as flat list [x1, y1, x2, y2, ...]
|
|
# Example: square from (0,0) to (10,10)
|
|
geofence_vertices: [0.0, 0.0, 10.0, 0.0, 10.0, 10.0, 0.0, 10.0]
|
|
|
|
# Enforce boundary by zeroing cmd_vel on breach
|
|
enforce_boundary: false
|
|
|
|
# Safety margin (m) - breach triggered before actual boundary
|
|
margin: 0.0
|