JaiaBot 2.1.1
JaiaBot micro-AUV software
 
Loading...
Searching...
No Matches
jaia_dccl.proto
Go to the documentation of this file.
1syntax = "proto2";
2
3import "dccl/option_extensions.proto";
4import "jaiabot/messages/mission.proto";
5import "jaiabot/messages/geographic_coordinate.proto";
6import "jaiabot/messages/high_control.proto";
7import "goby/middleware/protobuf/coroner.proto";
8import "jaiabot/messages/health.proto";
9import "jaiabot/messages/imu.proto";
10import "jaiabot/messages/option_extensions.proto";
11import "jaiabot/messages/link.proto";
12
13package jaiabot.protobuf;
14
15message Command
16{
17 /*
18 Actual maximum size of message: 196 bytes / 1568 bits
19 dccl.id head...........................8
20 user head..............................0
21 body................................1556
22 padding to full byte...................4
23 Allowed maximum size of message: 250 bytes / 2000 bits
24 */
25 option (dccl.msg) = {
26 id: 80
27 max_bytes: 250
28 codec_version: 4
29 unit_system: "si"
30 };
31
32 required uint32 bot_id = 1 [
33 (dccl.field) = { min: 0 max: 255 },
34 (jaia.field).rest_api.presence = OMITTED // specified in 'targets'
35 ];
36
37 required uint64 time = 2 [
38 (dccl.field) = {
39 codec: "dccl.time2"
40 units { prefix: "micro" derived_dimensions: "time" }
41 precision: -6 // second precision
42
43 },
44 (jaia.field).rest_api.presence = OMITTED // written by API server
45 ];
46
47 // Special case: not sent in message - written upon receipt based on the
48 // Link traversed
49 optional Link link = 3 [(dccl.field).omit = true];
50
51 optional uint32 from_hub_id = 4 [(dccl.field) = { min: 0 max: 30 }];
52
53 enum CommandType
54 {
55 // pre mission
56 MISSION_PLAN = 1 [(jaia.ev).rest_api.presence = GUARANTEED];
57 ACTIVATE = 2 [(jaia.ev).rest_api.presence = GUARANTEED];
58 START_MISSION = 3 [(jaia.ev).rest_api.presence = GUARANTEED];
59 MISSION_PLAN_FRAGMENT = 4;
60
61 // during any mission
62 NEXT_TASK = 10 [(jaia.ev).rest_api.presence = GUARANTEED];
63 RETURN_TO_HOME = 11 [(jaia.ev).rest_api.presence = GUARANTEED];
64 STOP = 12 [(jaia.ev).rest_api.presence = GUARANTEED];
65 PAUSE = 13 [(jaia.ev).rest_api.presence = GUARANTEED];
66 RESUME = 14 [(jaia.ev).rest_api.presence = GUARANTEED];
67
68 // during remote control mission
69 REMOTE_CONTROL_SETPOINT = 20;
70 REMOTE_CONTROL_TASK = 21;
71 REMOTE_CONTROL_RESUME_MOVEMENT = 22;
72
73 // post mission
74 RECOVERED = 30 [(jaia.ev).rest_api.presence = GUARANTEED];
75 SHUTDOWN = 31 [(jaia.ev).rest_api.presence = GUARANTEED];
76 RETRY_DATA_OFFLOAD = 32;
77 DATA_OFFLOAD_COMPLETE = 33;
78 DATA_OFFLOAD_FAILED = 34;
79
80 // debugging low level commands
81 RESTART_ALL_SERVICES = 40;
82 REBOOT_COMPUTER = 41;
83 SHUTDOWN_COMPUTER = 42;
84 }
85
86 required CommandType type = 10
87 [(jaia.field).rest_api.presence = GUARANTEED];
88
89 oneof command_data
90 {
91 // required for type == MISSION_PLAN
92 MissionPlan plan = 20 [(jaia.field).rest_api = {
93 presence: GUARANTEED,
94 doc: "Used with \"command\": { \"type\" : \"MISSION_PLAN\" }"
95 }];
96
97 // required for type == REMOTE_CONTROL_SETPOINT
98 RemoteControl rc = 30 [(jaia.field).rest_api = {
99 presence: GUARANTEED,
100 doc: "Used with \"command\": { \"type\" : \"REMOTE_CONTROL_SETPOINT\" }"
101 }];
102
103 // required for type == REMOTE_CONTROL_TASK
104 MissionTask rc_task = 31;
105 }
106}
107
108message CommandForHub
109{
110 option (dccl.msg) = {
111 unit_system: "si"
112 };
113
114 required uint32 hub_id = 1 [(jaia.field).rest_api.presence = OMITTED];
115 required uint64 time = 2 [
116 (dccl.field) = { units { prefix: "micro" derived_dimensions: "time" } },
117 (jaia.field).rest_api.presence = OMITTED
118 ];
119
120 enum HubCommandType
121 {
122 SCAN_FOR_BOTS = 5;
123
124 // debugging low level commands
125 RESTART_ALL_SERVICES = 40;
126 REBOOT_COMPUTER = 41;
127 SHUTDOWN_COMPUTER = 42;
128
129 // simulator commands
130 SET_HUB_LOCATION = 80 [(jaia.ev).rest_api.presence = GUARANTEED];
131 }
132
133 required HubCommandType type = 10
134 [(jaia.field).rest_api.presence = GUARANTEED];
135
136 optional uint32 scan_for_bot_id = 11;
137
138 optional GeographicCoordinate hub_location = 80
139 [(jaia.field).rest_api.presence = GUARANTEED];
140}
141
142message BotStatus
143{
144 /*
145 Actual maximum size of message: 46 bytes / 368 bits
146 dccl.id head...........................8
147 user head..............................0
148 body.................................359
149 padding to full byte...................1
150 Allowed maximum size of message: 250 bytes / 2000 bits
151 */
152 option (dccl.msg) = {
153 id: 81
154 max_bytes: 250
155 codec_version: 4
156 unit_system: "si"
157 };
158
159 required uint32 bot_id = 1 [
160 (dccl.field) = { min: 0 max: 255 },
161 (jaia.field).rest_api.presence = GUARANTEED
162 ];
163 required uint64 time = 2 [
164 (dccl.field) = {
165 codec: "dccl.time2"
166 units { prefix: "micro" derived_dimensions: "time" },
167 },
168 (jaia.field).rest_api.presence = GUARANTEED
169 ];
170 optional uint64 last_command_time = 3 [
171 (dccl.field) = {
172 codec: "dccl.time2"
173 units { prefix: "micro" derived_dimensions: "time" }
174 },
175 (jaia.field).rest_api.presence = GUARANTEED
176 ];
177
178 optional goby.middleware.protobuf.HealthState health_state = 4
179 [(jaia.field).rest_api.presence = GUARANTEED];
180 repeated Error error = 5 [
181 (dccl.field).max_repeat = 5,
182 (jaia.field).rest_api.presence = GUARANTEED
183 ];
184 repeated Warning warning = 6 [
185 (dccl.field).max_repeat = 5,
186 (jaia.field).rest_api.presence = GUARANTEED
187 ];
188 enum BotType
189 {
190 HYDRO = 1 [(jaia.ev).rest_api.presence = GUARANTEED];
191 ECHO = 2 [(jaia.ev).rest_api.presence = GUARANTEED];
192 BIO = 3 [(jaia.ev).rest_api.presence = GUARANTEED];
193 }
194 optional BotType bot_type = 7 [(jaia.field).rest_api.presence = GUARANTEED];
195
196 // Special case: not sent in message - written upon receipt based on the
197 // Link traversed
198 optional Link link = 8 [(dccl.field).omit = true];
199
200 optional GeographicCoordinate location = 10
201 [(jaia.field).rest_api.presence = GUARANTEED];
202
203 optional double depth = 11 [
204 (dccl.field) = {
205 min: -1
206 max: 100
207 precision: 1
208 units: { derived_dimensions: "length" }
209 },
210 (jaia.field).rest_api.presence = GUARANTEED
211 ];
212
213 message Attitude
214 {
215 optional double roll = 1 [
216 (dccl.field) = {
217 min: -180
218 max: 180
219 precision: 0
220 units {
221 derived_dimensions: "plane_angle"
222 system: "angle::degree"
223 }
224 },
225 (jaia.field).rest_api.presence = GUARANTEED
226 ];
227 optional double pitch = 2 [
228 (dccl.field) = {
229 min: -180
230 max: 180
231 precision: 0
232 units {
233 derived_dimensions: "plane_angle"
234 system: "angle::degree"
235 }
236 },
237 (jaia.field).rest_api.presence = GUARANTEED
238 ];
239 optional double heading = 3 [
240 (dccl.field) = {
241 min: 0
242 max: 360
243 precision: 0
244 units {
245 derived_dimensions: "plane_angle"
246 system: "angle::degree"
247 }
248 },
249 (jaia.field).rest_api.presence = GUARANTEED
250 ];
251 optional double course_over_ground = 4 [
252 (dccl.field) = {
253 min: 0
254 max: 360
255 precision: 0
256 units {
257 derived_dimensions: "plane_angle"
258 system: "angle::degree"
259 }
260 },
261 (jaia.field).rest_api.presence = GUARANTEED
262 ];
263 }
264 optional Attitude attitude = 20
265 [(jaia.field).rest_api.presence = GUARANTEED];
266
267 message Speed
268 {
269 optional double over_ground = 1 [
270 (dccl.field) = {
271 min: -5
272 max: 10
273 precision: 1
274 units { derived_dimensions: "velocity" }
275 },
276 (jaia.field).rest_api.presence = GUARANTEED
277 ];
278 optional double over_water = 2 [(dccl.field) = {
279 min: -5
280 max: 10
281 precision: 1
282 units { derived_dimensions: "velocity" }
283 }];
284 }
285 optional Speed speed = 30 [(jaia.field).rest_api.presence = GUARANTEED];
286
287 optional MissionState mission_state = 40
288 [(jaia.field).rest_api.presence = GUARANTEED];
289
290 // bounds should match MissionPlan.goal max_repeat value *
291 // expected_fragments max
292 optional int32 active_goal = 41 [
293 (dccl.field) = { min: 0 max: 80 },
294 (jaia.field).rest_api.presence = GUARANTEED
295 ];
296 optional double distance_to_active_goal = 42 [
297 (dccl.field) = {
298 min: 0
299 max: 1000
300 precision: 1
301 units: { derived_dimensions: "length" }
302 },
303 (jaia.field).rest_api.presence = GUARANTEED
304 ];
305 optional uint32 active_goal_timeout = 43 [
306 (dccl.field) = {
307 min: 0
308 max: 3600
309 precision: 0
310 units { base_dimensions: "T" }
311 },
312 (jaia.field).rest_api.presence = GUARANTEED
313 ];
314 optional int32 repeat_index = 44 [
315 (dccl.field) = { min: 0 max: 1000 precision: 0 },
316 (jaia.field).rest_api.presence = GUARANTEED
317 ];
318
319 optional double salinity = 51
320 [(dccl.field) = { min: 0 max: 100 precision: 1 }];
321
322 optional double temperature = 52 [(dccl.field) = {
323 min: -50
324 max: 100
325 precision: 2
326 units { derived_dimensions: "temperature" system: "celsius" }
327 }];
328
329 optional double battery_percent = 53 [
330 (dccl.field) = { min: 0 max: 100 precision: 0 },
331 (jaia.field).rest_api.presence = GUARANTEED
332 ];
333
334 optional int32 calibration_status = 54 [(dccl.field) = { min: 0 max: 3 }];
335
336 optional IMUCalibrationState calibration_state = 55;
337
338 optional double hdop = 56 [(dccl.field) = { min: 0 max: 100 precision: 2 }];
339
340 optional double pdop = 57 [(dccl.field) = { min: 0 max: 100 precision: 2 }];
341
342 optional int32 wifi_link_quality_percentage = 58 [
343 (dccl.field) = { min: 0 max: 100 precision: 0 },
344 (jaia.field).rest_api.presence = GUARANTEED
345 ];
346
347 optional uint64 received_time = 59 [
348 (dccl.field) = {
349 omit: true
350 units { prefix: "micro" derived_dimensions: "time" }
351 },
352 (jaia.field).rest_api.presence = GUARANTEED
353 ];
354}
355
356message DriftPacket
357{
358 option (dccl.msg) = {
359 unit_system: "si"
360 };
361
362 optional int32 drift_duration = 1 [
363 default = 0,
364 (dccl.field) = {
365 min: 0
366 max: 3600
367 precision: -1
368 units { base_dimensions: "T" }
369 },
370 (jaia.field).rest_api.presence = GUARANTEED
371 ];
372
373 message EstimatedDrift
374 {
375 required double speed = 1 [
376 (dccl.field) = {
377 min: 0
378 max: 10
379 precision: 1
380 units { derived_dimensions: "velocity" }
381 },
382 (jaia.field).rest_api.presence = GUARANTEED
383 ];
384
385 optional double heading = 3 [
386 (dccl.field) = {
387 min: 0
388 max: 360
389 precision: 0
390 units {
391 derived_dimensions: "plane_angle"
392 system: "angle::degree"
393 }
394 },
395 (jaia.field).rest_api.presence = GUARANTEED
396 ];
397 }
398
399 // should correspond to ocean current velocity
400 optional EstimatedDrift estimated_drift = 10
401 [(jaia.field).rest_api.presence = GUARANTEED];
402
403 // location C
404 optional GeographicCoordinate start_location = 11
405 [(jaia.field).rest_api.presence = GUARANTEED];
406 // location D
407 optional GeographicCoordinate end_location = 12
408 [(jaia.field).rest_api.presence = GUARANTEED];
409
410 // Significant wave height is defined as the average wave height,
411 // from trough to crest, of the highest one-third of the waves
412 optional double significant_wave_height = 13 [
413 (dccl.field) = {
414 min: 0
415 max: 50
416 precision: 3
417 units: { derived_dimensions: "length" }
418 },
419 (jaia.field).rest_api.presence = GUARANTEED
420 ];
421}
422
423message DivePacket
424{
425 option (dccl.msg) = {
426 unit_system: "si"
427 };
428
429 required double dive_rate = 10 [
430 (dccl.field) = {
431 min: 0
432 max: 10
433 precision: 1
434 units { derived_dimensions: "velocity" }
435 },
436 (jaia.field).rest_api.presence = GUARANTEED
437 ];
438
439 optional double unpowered_rise_rate = 11 [
440 (dccl.field) = {
441 min: 0
442 max: 10
443 precision: 1
444 units { derived_dimensions: "velocity" }
445 },
446 (jaia.field).rest_api.presence = GUARANTEED
447 ];
448
449 optional double powered_rise_rate = 12 [
450 (dccl.field) = {
451 min: 0
452 max: 10
453 precision: 1
454 units { derived_dimensions: "velocity" }
455 },
456 (jaia.field).rest_api.presence = GUARANTEED
457 ];
458
459 required double depth_achieved = 13 [
460 (dccl.field) = {
461 min: 0
462 max: 100
463 precision: 1
464 units: { derived_dimensions: "length" }
465 },
466 (jaia.field).rest_api.presence = GUARANTEED
467 ];
468
469 message Measurements
470 {
471 optional double mean_depth = 1 [
472 (dccl.field) = {
473 min: 0
474 max: 100
475 precision: 1
476 units: { derived_dimensions: "length" }
477 },
478 (jaia.field).rest_api.presence = GUARANTEED
479 ];
480
481 optional double mean_temperature = 2 [
482 (dccl.field) = {
483 min: -1
484 max: 50
485 precision: 1
486 units { derived_dimensions: "temperature" system: "celsius" }
487 },
488 (jaia.field).rest_api.presence = GUARANTEED
489 ];
490
491 optional double mean_salinity = 3 [
492 (dccl.field) = { min: 0 max: 45 precision: 1 },
493 (jaia.field).rest_api.presence = GUARANTEED
494 ];
495 }
496
497 repeated Measurements measurement = 14 [
498 (dccl.field) = { max_repeat: 50 },
499 (jaia.field).rest_api.presence = GUARANTEED
500 ];
501
502 // location A
503 optional GeographicCoordinate start_location = 15
504 [(jaia.field).rest_api.presence = GUARANTEED];
505
506 optional double duration_to_acquire_gps = 16 [
507 (dccl.field) = {
508 min: 0
509 max: 120
510 precision: 1
511 units { base_dimensions: "T" }
512 },
513 (jaia.field).rest_api.presence = GUARANTEED
514 ];
515
516 // Did we reach seafloor?
517 optional bool bottom_dive = 17
518 [default = false, (jaia.field).rest_api.presence = GUARANTEED];
519
520 // Did we reach min depth?
521 optional bool reached_min_depth = 18
522 [default = false, (jaia.field).rest_api.presence = GUARANTEED];
523
524 // If we reached bottom, what was the bottom type
525 enum BottomType
526 {
527 HARD = 1 [(jaia.ev).rest_api.presence = GUARANTEED];
528 SOFT = 2 [(jaia.ev).rest_api.presence = GUARANTEED];
529 }
530
531 optional BottomType bottom_type = 19
532 [(jaia.field).rest_api.presence = GUARANTEED];
533
534 // For bottom characterization
535 optional double max_acceleration = 20 [
536 (dccl.field) = {
537 min: 0
538 max: 100
539 precision: 1
540 units { derived_dimensions: "acceleration" }
541 },
542 (jaia.field).rest_api.presence = GUARANTEED
543 ];
544}
545
546message TaskPacket
547{
548 /*
549 Actual maximum size of message: 218 bytes / 1744 bits
550 dccl.id head..........................16
551 user head..............................0
552 body................................1728
553 padding to full byte...................0
554 Allowed maximum size of message: 250 bytes / 2000 bits
555 */
556 option (dccl.msg) = {
557 id: 0x5001
558 max_bytes: 250
559 codec_version: 4
560 unit_system: "si"
561 };
562
563 required uint32 bot_id = 1 [
564 (dccl.field) = { min: 0 max: 255 },
565 (jaia.field).rest_api.presence = GUARANTEED
566 ];
567 required uint64 start_time = 2 [
568 (dccl.field) = {
569 codec: "dccl.time2"
570 units { prefix: "micro" derived_dimensions: "time" }
571 },
572 (jaia.field).rest_api.presence = GUARANTEED
573 ];
574 required uint64 end_time = 3 [
575 (dccl.field) = {
576 codec: "dccl.time2"
577 units { prefix: "micro" derived_dimensions: "time" }
578 },
579 (jaia.field).rest_api.presence = GUARANTEED
580 ];
581 required MissionTask.TaskType type = 4
582 [(jaia.field).rest_api.presence = GUARANTEED];
583
584 // Special case: not sent in message - written upon receipt based on the
585 // Link traversed
586 optional Link link = 5 [(dccl.field).omit = true];
587
588 optional DivePacket dive = 10 [(jaia.field).rest_api.presence = GUARANTEED];
589 optional DriftPacket drift = 11
590 [(jaia.field).rest_api.presence = GUARANTEED];
591}
592
593message ContactUpdate
594{
595 option (dccl.msg) = {
596 id: 0x5002
597 max_bytes: 16
598 codec_version: 4
599 unit_system: "si"
600 };
601
602 optional int32 contact = 1 [(dccl.field) = { min: 1, max: 15 }];
603 required GeographicCoordinate location = 2;
604 optional double speed_over_ground = 3 [(dccl.field) = {
605 min: -5
606 max: 10
607 precision: 1
608 units { derived_dimensions: "velocity" }
609 }];
610 optional double heading_or_cog = 5 [(dccl.field) = {
611 min: 0
612 max: 360
613 precision: 0
614 units { derived_dimensions: "plane_angle" system: "angle::degree" }
615 }];
616}
617
618message Hub2HubData
619{
620 option (dccl.msg) = {
621 id: 0x5003
622 max_bytes: 1000
623 codec_version: 4
624 unit_system: "si"
625 };
626
627 required uint32 hub_id = 1 [(dccl.field) = { min: 0 max: 30 }];
628 required uint64 time = 2 [(dccl.field) = {
629 codec: "dccl.time"
630 units { prefix: "micro" derived_dimensions: "time" }
631 precision: -5 // deci-second precision
632 }];
633
634 oneof contents
635 {
636 BotStatus bot_status = 10;
637 TaskPacket task_packet = 11;
638 Command command_for_bot = 12;
639 }
640}