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