-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecovery_policy_options.sd
More file actions
57 lines (52 loc) · 1.69 KB
/
Copy pathrecovery_policy_options.sd
File metadata and controls
57 lines (52 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Feature options: recovery_policy — multiple on branches and recovery actions
//
// on conditions: gps.failed, lidar.failed, battery.critical, connectivity.lost, …
// actions: switch_to, reduce_speed, enter *_mode, pause_mission, restart connectivity, …
//
// spanda check examples/features/recovery_policy_options.sd
// spanda heal examples/features/recovery_policy_options.sd
// spanda recover examples/features/recovery_policy_options.sd --failure gps
// spanda recover examples/features/recovery_policy_options.sd --failure lidar
// spanda sim examples/features/recovery_policy_options.sd --inject-failure gps
// spanda recovery-report examples/features/recovery_policy_options.sd
//
// Docs: docs/self-healing.md · docs/recovery-orchestrator.md
operating_mode NormalMode { normal; }
operating_mode DegradedMode { degraded; }
operating_mode SafeMode { safe; }
operating_mode RecoveryMode { recovery; }
recovery_policy RoverRecovery {
on gps.failed {
switch_to visual_odometry;
reduce_speed 0.5 m/s;
enter degraded_mode;
}
on lidar.failed {
reduce_speed 0.3 m/s;
enter safe_mode;
}
on battery.critical {
pause_mission;
enter safe_mode;
}
on connectivity.lost {
restart connectivity;
enter degraded_mode;
}
}
mitigation SensorDegradation {
if gps.failed {
switch_to visual_odometry;
enter degraded_mode;
}
}
health_check RoverHealth for robot Rover {
check battery.level >= 20%;
}
robot Rover {
sensor gps: GPS;
sensor lidar: Lidar;
actuator wheels: DifferentialDrive;
safety { max_speed = 1.2 m/s; }
behavior patrol() { wheels.drive(0.5 m/s); }
}