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