Spanda supports WGS84 geofences for safety-critical boundary enforcement, extending the existing
local safety { zone ... } model with GPS-native regions.
geofence SafeZone {
center: geo(30.2672, -97.7431);
radius: 100.0;
}
The compiler validates latitude/longitude ranges and positive radius during spanda verify.
on geofence SafeZone exited {
stop_all_actuators();
notify_operator();
}
Supported phases: entered, exited (also available as keywords).
Combine geofences with runtime checks via robot.in_geofence(name):
behavior patrol() {
if not robot.in_geofence("SafeZone") {
stop_all_actuators();
}
}
Triggers fire on boundary transitions:
on geofence SafeZone exited { stop_all_actuators(); }
Note:
robot.in_zone()remains for local metric safety zones insidesafety { }. Geofences operate in WGS84 coordinates via GPS/GNSS sensors.
Types live in std.geofence: GeoFence, GeoPoint.
See also: Positioning, Connectivity.