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