forked from boston-dynamics/spot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathestop.proto
302 lines (227 loc) · 8.5 KB
/
estop.proto
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
// Copyright (c) 2019 Boston Dynamics, Inc. All rights reserved.
//
// Downloading, reproducing, distributing or otherwise using the SDK Software
// is subject to the terms and conditions of the Boston Dynamics Software
// Development Kit License (20191101-BDSDK-SL).
syntax = "proto3";
package bosdyn.api;
option java_outer_classname = "EstopProto";
import "bosdyn/api/header.proto";
import "google/protobuf/duration.proto";
/// An API client to the robot software-estop system.
message EstopEndpoint {
/// Role of this endpoint. Should be user-friendly, e.g. "OCU"
string role = 1;
/// Name of this endpoint. Specifies a thing to fill the given role, e.g. "patrol-ocu01"
string name = 2;
/// Unique ID assigned by the server.
string unique_id = 3;
/// Maximum delay between challenge and response for this endpoint prior to soft power off
/// handling. After timeout seconds has passed, the robot will try to get to a safe state prior
/// to disabling motor power. The robot response is equivalent to an ESTOP_LEVEL_SETTLE_THEN_CUT
/// which may involve the robot sitting down in order to prepare for disabling motor power.
google.protobuf.Duration timeout = 4;
/// Optional maximum delay between challenge and response for this endpoint prior to disabling
/// motor power. After cut_power_timeout seconds has passed, motor power will be disconnected
/// immediately regardless of current robot state. If this value is not set robot will default
/// to timeout plus a nominal expected duration to reach a safe state. In practice this
/// is typically 3-4 seconds. The response is equivalent to an ESTOP_LEVEL_CUT.
google.protobuf.Duration cut_power_timeout = 5;
}
/// The state of the estop system.
enum EstopStopLevel {
/// Invalid stop level.
ESTOP_LEVEL_UNKNOWN = 0;
/// Immediately cut power to the actuators.
ESTOP_LEVEL_CUT = 1;
/// Prepare for loss of actuator power, then cut power.
ESTOP_LEVEL_SETTLE_THEN_CUT = 2;
ESTOP_LEVEL_CEASE = 3;
/// No-stop level. The endpoint believes the robot is safe to operate.
ESTOP_LEVEL_NONE = 4;
}
/// Configuration of a root / server.
message EstopConfig {
/// EstopEndpoints that are part of this configuration.
/// Unique IDs do not have to be filled out, but can be.
repeated EstopEndpoint endpoints = 1;
/// Unique ID for this configuration.
string unique_id = 2;
}
/// EstopEndpoint with some extra status data.
message EstopEndpointWithStatus {
/// The endpoint.
EstopEndpoint endpoint = 1;
/// Stop level most recently requested by the endpoint.
EstopStopLevel stop_level = 2;
/// Time since a valid response was provided by the endpoint.
google.protobuf.Duration time_since_valid_response = 3;
}
/// Status of Estop system.
message EstopSystemStatus {
/// Status for all available endpoints.
repeated EstopEndpointWithStatus endpoints = 3;
/// Current stop level for the system.
/// Will be the most-restrictive stop level specified by an endpoint, or a stop level
/// asserted by the system as a whole (e.g. if an endpoint timed out).
EstopStopLevel stop_level = 4;
/// Human-readable information on the stop level.
string stop_level_details = 5;
}
/// Client request for setting/maintaining an estop system level.
/// After the first CheckIn, must include response to previous challenge.
message EstopCheckInRequest {
/// Common request header.
RequestHeader header = 1;
/// The endpoint making the request.
EstopEndpoint endpoint = 2;
/// Challenge being responded to.
/// Don't set if this is the first EstopCheckInRequest.
uint64 challenge = 3;
/// Response to above challenge.
/// Don't set if this is the first EstopCheckInRequest.
uint64 response = 4;
/// Assert this stop level.
EstopStopLevel stop_level = 5;
}
/// Server response to EstopCheckInRequest.
message EstopCheckInResponse {
/// Common response header.
ResponseHeader header = 1;
/// Copy of initial request.
EstopCheckInRequest request = 2;
/// Next challenge to answer.
uint64 challenge = 3;
enum Status {
/// Unknown error occurred.
STATUS_UNKNOWN = 0;
/// Valid challenge has been returned.
STATUS_OK = 1;
/// The endpoint specified in the request is not registered.
STATUS_ENDPOINT_UNKNOWN = 2;
/// The challenge and/or response was incorrect.
STATUS_INCORRECT_CHALLENGE_RESPONSE = 5;
}
/// Status code for the response.
Status status = 4;
}
/// Register an endpoint.
/// EstopEndpoints must be registered before they can send commands or request challenges.
message RegisterEstopEndpointRequest {
/// Common request header
RequestHeader header = 1;
/// The endpoint to replace.
/// Set the endpoint's unique ID if replacing an active endpoint.
EstopEndpoint target_endpoint = 2;
/// ID of the configuration we are registering against.
string target_config_id = 3;
/// The description of the new endpoint.
/// Do not set the unique ID. It will be ignored.
EstopEndpoint new_endpoint = 4;
}
/// Response to registration request.
message RegisterEstopEndpointResponse {
/// Common response header
ResponseHeader header = 1;
/// Copy of the initial request.
RegisterEstopEndpointRequest request = 2;
/// The resulting endpoint on success.
EstopEndpoint new_endpoint = 3;
enum Status {
/// An unknown / unexpected error occurred.
STATUS_UNKNOWN = 0;
/// Request succeeded.
STATUS_SUCCESS = 1;
/// Target endpoint did not match.
STATUS_ENDPOINT_MISMATCH = 2;
/// Registered to wrong configuration.
STATUS_CONFIG_MISMATCH = 3;
/// New endpoint was invalid.
STATUS_INVALID_ENDPOINT = 4;
}
/// Status code for the response.
Status status = 4;
}
/// Deregister the specified estop endpoint registration.
message DeregisterEstopEndpointRequest {
/// Common request header
RequestHeader header = 1;
/// The endpoint to deregister.
EstopEndpoint target_endpoint = 2;
/// ID of the configuration we are registering against.
string target_config_id = 3;
}
/// Response to estop endpoint deregistration request.
message DeregisterEstopEndpointResponse {
/// Common resonse header.
ResponseHeader header = 1;
/// Copy of the initial request.
DeregisterEstopEndpointRequest request = 2;
enum Status {
/// An unknown / unexpected error occurred.
STATUS_UNKNOWN = 0;
/// Request succeeded.
STATUS_SUCCESS = 1;
/// Target endpoint did not match.
STATUS_ENDPOINT_MISMATCH = 2;
/// Registered to wrong configuration.
STATUS_CONFIG_MISMATCH = 3;
}
/// Status code for the response.
Status status = 4;
}
/// Get the active EstopConfig.
message GetEstopConfigRequest {
/// Common request header.
RequestHeader header = 1;
/// unique_id of EstopConfig to get.
string target_config_id = 4;
}
/// Response to EstopConfigRequest.
message GetEstopConfigResponse {
/// Common response header.
ResponseHeader header = 1;
/// Copy of the request.
GetEstopConfigRequest request = 2;
/// The currently active configuration.
EstopConfig active_config = 3;
}
/// Set a new active EstopConfig.
message SetEstopConfigRequest {
/// Common request header.
RequestHeader header = 1;
/// New configuration to set.
EstopConfig config = 3;
/// unique_id of EstopConfig to replace, if replacing one.
string target_config_id = 4;
}
/// Response to EstopConfigRequest.
message SetEstopConfigResponse {
/// Common response header.
ResponseHeader header = 1;
/// Copy of the request.
SetEstopConfigRequest request = 2;
/// The currently active configuration.
EstopConfig active_config = 3;
enum Status {
/// An unknown / unexpected error occurred.
STATUS_UNKNOWN = 0;
/// Request succeeded.
STATUS_SUCCESS = 1;
/// Tried to replace a EstopConfig, but provided bad ID.
STATUS_INVALID_ID = 2;
}
Status status = 4;
}
/// Ask for the current status of the Estop system.
message GetEstopSystemStatusRequest {
/// Common request header.
RequestHeader header = 1;
}
/// Respond with the current Estop system status.
message GetEstopSystemStatusResponse {
/// Common response header.
ResponseHeader header = 1;
/// Status of the Estop system.
EstopSystemStatus status = 3;
}