Apollo 11.0
自动驾驶开放平台
safety_manager.proto
浏览该文件的文档.
1syntax = "proto2";
2
3package apollo.safety_manager;
4
6
7message Filter {
8 required uint32 required_cycles = 1;
9 required uint32 total_cycles = 2;
10}
11
12message SafetyRule {
13 // If no message received during the timeout seconds, status will be set to
14 // OK.
15 optional double timeout = 1;
16 // Duration seconds required for the status from PENDING to real,
17 // include WARN_PENDING to WARN, ERROR_PENDING to ERROR, FATAL_PENDING to
18 // FATAL, it takes at least two cycles to caculate.
19 optional double duration = 2;
20 // Filter conditions, such as 1/2, 3/3, PENDING status will be set before
21 // unsatisfied.
22 optional Filter filter = 3;
23 // Note: at most one rule can be configured at the same time,
24 // if multi rules are configured, the result may not be what you expected.
25
26 // fault removal time in seconds, set -1 if never removed.
27 optional int32 fault_removed_secs = 4 [default = 5];
28}
29
30message Matcher {
31 // Full name match, ["CPU Usage", "CPU Temp"] means name equal "CPU Usage" or
32 // "CPU Temp".
33 repeated string name = 1;
34 // Name contains match, ["CPU", "MEM"] means name contain CPU or MEM.
35 repeated string contains = 2;
36 // Name prefix match.
37 repeated string prefix = 3;
38 // Name regex match.
39 repeated string regex = 4;
40 // Tags contains at least one, ["resource", "net"] means contain resource or
41 // net tag.
42 repeated string tags_contains_one = 5;
43 // Tags contain many, e.g. ["resource", "net"] means contain both resource and
44 // net tag.
45 repeated string tags_contains_many = 6;
46}
47
48message RuleMatcher {
49 required Matcher matcher = 1;
50 required SafetyRule rule = 2;
51}
52
54 repeated RuleMatcher rule_matcher = 1;
55}
56
57message SafetyStatus {
58 enum Status {
59 // Normal status.
60 OK = 1;
61 // Pending status will be set util the rule conditions are satisfied.
62 WARN_PENDING = 2;
63 ERROR_PENDING = 3;
64 FATAL_PENDING = 4;
65 // Warn status only send an alert notice.
66 WARN = 5;
67 // Error status trigger comfortable braking normally.
68 ERROR = 6;
69 // Fatal status trigger emergency braking normally.
70 FATAL = 7;
71 // wait removed status.
72 WAIT_REMOVED = 8;
73 }
74 message Item {
75 // item basic info
76 required string name = 1;
77 optional uint64 code = 2;
78 optional string type = 3;
79 optional string level = 4;
80 optional string conditions = 5;
81 optional string description = 6;
82 // item status info
83 optional Status status = 7;
84 optional string value = 8;
85 optional string message = 9;
86 }
87 optional apollo.common.Header header = 1;
88 // Name as the unique identifier.
89 required string name = 2;
90 required Status status = 3;
91 optional string message = 4;
92 // Used for status detailed desciption.
93 map<string, string> values = 5;
94 repeated string tags = 6;
95 optional SafetyRule rule = 7;
96 repeated Item items = 8;
97}
98
100 optional apollo.common.Header header = 1;
101 repeated SafetyStatus status_array = 2;
102}
103
105 optional apollo.common.Header header = 1;
106 // If we have this field, safety_mode should be triggered.
107 // We'll check the system action and driver action continuously. If no proper
108 // action was taken in a specified period of time (such as 10 seconds), EStop
109 // will be sent to bring the vehicle into emergency full stop.
110 optional double safety_mode_trigger_time = 2;
111 optional bool require_emergency_stop = 3;
112}
113
115 required double timestamp = 1; // in seconds
116 repeated string names = 2;
117}
118
120 required bool success = 1;
121 optional string message = 2;
122}
apollo::common
class register implement
Definition arena_queue.h:37