JaiaBot  1.12.1
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 
11 package jaiabot.protobuf;
12 
13 message Command
14 {
15  /*
16  Actual maximum size of message: 179 bytes / 1432 bits
17  dccl.id head...........................8
18  user head..............................0
19  body................................1423
20  padding to full byte...................1
21  Allowed maximum size of message: 250 bytes / 2000 bits
22  */
23  option (dccl.msg) = {
24  id: 80
25  max_bytes: 250
26  codec_version: 4
27  unit_system: "si"
28  };
29 
30  required uint32 bot_id = 1 [(dccl.field) = { min: 0 max: 255 }];
31  required uint64 time = 2 [(dccl.field) = {
32  codec: "dccl.time2"
33  units { prefix: "micro" derived_dimensions: "time" }
34  precision: -6 // second precision
35  }];
36 
37  enum CommandType
38  {
39  // pre mission
40  MISSION_PLAN = 1;
41  ACTIVATE = 2;
42  START_MISSION = 3;
43  MISSION_PLAN_FRAGMENT = 4;
44 
45  // during any mission
46  NEXT_TASK = 10;
47  RETURN_TO_HOME = 11;
48  STOP = 12;
49  PAUSE = 13;
50  RESUME = 14;
51 
52  // during remote control mission
53  REMOTE_CONTROL_SETPOINT = 20;
54  REMOTE_CONTROL_TASK = 21;
55  REMOTE_CONTROL_RESUME_MOVEMENT = 22;
56 
57  // post mission
58  RECOVERED = 30;
59  SHUTDOWN = 31;
60  RETRY_DATA_OFFLOAD = 32;
61  DATA_OFFLOAD_COMPLETE = 33;
62  DATA_OFFLOAD_FAILED = 34;
63 
64  // debugging low level commands
65  RESTART_ALL_SERVICES = 40;
66  REBOOT_COMPUTER = 41;
67  SHUTDOWN_COMPUTER = 42;
68  }
69 
70  required CommandType type = 10;
71 
72  oneof command_data
73  {
74  // required for type == MISSION_PLAN
75  MissionPlan plan = 20;
76 
77  // required for type == REMOTE_CONTROL_SETPOINT
78  RemoteControl rc = 30;
79 
80  // required for type == REMOTE_CONTROL_TASK
81  MissionTask rc_task = 31;
82  }
83 }
84 
85 message CommandForHub
86 {
87  option (dccl.msg) = {
88  unit_system: "si"
89  };
90 
91  required uint32 hub_id = 1;
92  required uint64 time = 2 [
93  (dccl.field) = { units { prefix: "micro" derived_dimensions: "time" } }
94  ];
95 
96  enum HubCommandType
97  {
98  SCAN_FOR_BOTS = 5;
99 
100  // debugging low level commands
101  RESTART_ALL_SERVICES = 40;
102  REBOOT_COMPUTER = 41;
103  SHUTDOWN_COMPUTER = 42;
104 
105  // simulator commands
106  SET_HUB_LOCATION = 80;
107  }
108 
109  required HubCommandType type = 10;
110  optional uint32 scan_for_bot_id = 11;
111 
112  optional GeographicCoordinate hub_location = 80;
113 }
114 
115 message BotStatus
116 {
117  /*
118  Actual maximum size of message: 54 bytes / 432 bits
119  dccl.id head...........................8
120  user head..............................0
121  body.................................417
122  padding to full byte...................7
123  Allowed maximum size of message: 250 bytes / 2000 bits
124  */
125  option (dccl.msg) = {
126  id: 81
127  max_bytes: 250
128  codec_version: 4
129  unit_system: "si"
130  };
131 
132  required uint32 bot_id = 1 [(dccl.field) = { min: 0 max: 255 }];
133  required uint64 time = 2 [(dccl.field) = {
134  codec: "dccl.time2"
135  units { prefix: "micro" derived_dimensions: "time" }
136  }];
137  optional uint64 last_command_time = 3 [(dccl.field) = {
138  codec: "dccl.time2"
139  units { prefix: "micro" derived_dimensions: "time" }
140  }];
141 
142  optional goby.middleware.protobuf.HealthState health_state = 4;
143  repeated Error error = 5 [(dccl.field).max_repeat = 5];
144  repeated Warning warning = 6 [(dccl.field).max_repeat = 5];
145  enum BotType
146  {
147  HYDRO = 1;
148  ECHO = 2;
149  }
150  optional BotType bot_type = 7;
151 
152  optional GeographicCoordinate location = 10;
153 
154  optional double depth = 11 [(dccl.field) = {
155  min: -1
156  max: 100
157  precision: 1
158  units: { derived_dimensions: "length" }
159  }];
160 
161  message Attitude
162  {
163  optional double roll = 1 [(dccl.field) = {
164  min: -180
165  max: 180
166  precision: 0
167  units { derived_dimensions: "plane_angle" system: "angle::degree" }
168  }];
169  optional double pitch = 2 [(dccl.field) = {
170  min: -180
171  max: 180
172  precision: 0
173  units { derived_dimensions: "plane_angle" system: "angle::degree" }
174  }];
175  optional double heading = 3 [(dccl.field) = {
176  min: 0
177  max: 360
178  precision: 0
179  units { derived_dimensions: "plane_angle" system: "angle::degree" }
180  }];
181  optional double course_over_ground = 4 [(dccl.field) = {
182  min: 0
183  max: 360
184  precision: 0
185  units { derived_dimensions: "plane_angle" system: "angle::degree" }
186  }];
187  }
188  optional Attitude attitude = 20;
189 
190  message Speed
191  {
192  optional double over_ground = 1 [(dccl.field) = {
193  min: -5
194  max: 10
195  precision: 1
196  units { derived_dimensions: "velocity" }
197  }];
198  optional double over_water = 2 [(dccl.field) = {
199  min: -5
200  max: 10
201  precision: 1
202  units { derived_dimensions: "velocity" }
203  }];
204  }
205  optional Speed speed = 30;
206 
207  optional MissionState mission_state = 40;
208 
209  // bounds should match MissionPlan.goal max_repeat value *
210  // expected_fragments max
211  optional int32 active_goal = 41 [(dccl.field) = { min: 0 max: 29 }];
212  optional double distance_to_active_goal = 42 [(dccl.field) = {
213  min: 0
214  max: 1000
215  precision: 1
216  units: { derived_dimensions: "length" }
217  }];
218  optional uint32 active_goal_timeout = 43 [(dccl.field) = {
219  min: 0
220  max: 3600
221  precision: 0
222  units { base_dimensions: "T" }
223  }];
224  optional int32 repeat_index = 44
225  [(dccl.field) = { min: 0 max: 1000 precision: 0 }];
226 
227  optional double salinity = 51
228  [(dccl.field) = { min: 0 max: 100 precision: 1 }];
229 
230  optional double temperature = 52 [(dccl.field) = {
231  min: -50
232  max: 100
233  precision: 2
234  units { derived_dimensions: "temperature" system: "celsius" }
235  }];
236 
237  optional double thermocouple_temperature = 53 [(dccl.field) = {
238  min: -50
239  max: 100
240  precision: 2
241  units { derived_dimensions: "temperature" system: "celsius" }
242  }];
243 
244  optional double vv_current = 54 [(dccl.field) = {
245  min: -5
246  max: 1000
247  precision: 2
248  units { derived_dimensions: "current" }
249  }];
250 
251  optional double vcc_current = 55 [(dccl.field) = {
252  min: -5
253  max: 1000
254  precision: 2
255  units { derived_dimensions: "current" }
256  }];
257 
258  optional double vcc_voltage = 56 [(dccl.field) = {
259  min: 0
260  max: 25
261  precision: 2
262  units { derived_dimensions: "electric_potential" system: "si" }
263  }];
264 
265  optional double battery_percent = 57
266  [(dccl.field) = { min: 0 max: 100 precision: 0 }];
267 
268  optional int32 calibration_status = 58 [(dccl.field) = { min: 0 max: 3 }];
269 
270  optional IMUCalibrationState calibration_state = 59;
271 
272  optional double hdop = 60 [(dccl.field) = { min: 0 max: 100 precision: 2 }];
273 
274  optional double pdop = 61 [(dccl.field) = { min: 0 max: 100 precision: 2 }];
275 
276  optional int32 wifi_link_quality_percentage = 62
277  [(dccl.field) = { min: 0 max: 100 precision: 0 }];
278 }
279 
280 message DriftPacket
281 {
282  option (dccl.msg) = {
283  unit_system: "si"
284  };
285 
286  optional int32 drift_duration = 1 [
287  default = 0,
288  (dccl.field) = {
289  min: 0
290  max: 3600
291  precision: -1
292  units { base_dimensions: "T" }
293  }
294  ];
295 
296  message EstimatedDrift
297  {
298  required double speed = 1 [(dccl.field) = {
299  min: 0
300  max: 10
301  precision: 1
302  units { derived_dimensions: "velocity" }
303  }];
304 
305  optional double heading = 3 [(dccl.field) = {
306  min: 0
307  max: 360
308  precision: 0
309  units { derived_dimensions: "plane_angle" system: "angle::degree" }
310  }];
311  }
312 
313  // should correspond to ocean current velocity
314  optional EstimatedDrift estimated_drift = 10;
315 
316  // location C
317  optional GeographicCoordinate start_location = 11;
318  // location D
319  optional GeographicCoordinate end_location = 12;
320 
321  // Significant wave height is defined as the average wave height,
322  // from trough to crest, of the highest one-third of the waves
323  optional double significant_wave_height = 13 [(dccl.field) = {
324  min: 0
325  max: 50
326  precision: 3
327  units: { derived_dimensions: "length" }
328  }];
329 }
330 
331 message DivePacket
332 {
333  option (dccl.msg) = {
334  unit_system: "si"
335  };
336 
337  required double dive_rate = 10 [(dccl.field) = {
338  min: 0
339  max: 10
340  precision: 1
341  units { derived_dimensions: "velocity" }
342  }];
343 
344  optional double unpowered_rise_rate = 11 [(dccl.field) = {
345  min: 0
346  max: 10
347  precision: 1
348  units { derived_dimensions: "velocity" }
349  }];
350 
351  optional double powered_rise_rate = 12 [(dccl.field) = {
352  min: 0
353  max: 10
354  precision: 1
355  units { derived_dimensions: "velocity" }
356  }];
357 
358  required double depth_achieved = 13 [(dccl.field) = {
359  min: 0
360  max: 100
361  precision: 1
362  units: { derived_dimensions: "length" }
363  }];
364 
365  message Measurements
366  {
367  optional double mean_depth = 1 [(dccl.field) = {
368  min: 0
369  max: 100
370  precision: 1
371  units: { derived_dimensions: "length" }
372  }];
373 
374  optional double mean_temperature = 2 [(dccl.field) = {
375  min: -1
376  max: 50
377  precision: 1
378  units { derived_dimensions: "temperature" system: "celsius" }
379  }];
380 
381  optional double mean_salinity = 3
382  [(dccl.field) = { min: 0 max: 45 precision: 1 }];
383  }
384 
385  repeated Measurements measurement = 14 [(dccl.field) = { max_repeat: 50 }];
386 
387  // location A
388  optional GeographicCoordinate start_location = 15;
389 
390  optional double duration_to_acquire_gps = 16 [(dccl.field) = {
391  min: 0
392  max: 120
393  precision: 1
394  units { base_dimensions: "T" }
395  }];
396 
397  // Did we reach seafloor?
398  optional bool bottom_dive = 17 [default = false];
399 
400  // Did we reach min depth?
401  optional bool reached_min_depth = 18 [default = false];
402 
403  // If we reached bottom, what was the bottom type
404  enum BottomType
405  {
406  HARD = 1;
407  SOFT = 2;
408  }
409 
410  optional BottomType bottom_type = 19;
411 
412  // For bottom characterization
413  optional double max_acceleration = 20 [(dccl.field) = {
414  min: 0
415  max: 100
416  precision: 1
417  units { derived_dimensions: "acceleration" }
418  }];
419 }
420 
421 message TaskPacket
422 {
423  /*
424  Actual maximum size of message: 218 bytes / 1744 bits
425  dccl.id head..........................16
426  user head..............................0
427  body................................1728
428  padding to full byte...................0
429  Allowed maximum size of message: 250 bytes / 2000 bits
430  */
431  option (dccl.msg) = {
432  id: 0x5001
433  max_bytes: 250
434  codec_version: 4
435  unit_system: "si"
436  };
437 
438  required uint32 bot_id = 1 [(dccl.field) = { min: 0 max: 255 }];
439  required uint64 start_time = 2 [(dccl.field) = {
440  codec: "dccl.time2"
441  units { prefix: "micro" derived_dimensions: "time" }
442  }];
443  required uint64 end_time = 3 [(dccl.field) = {
444  codec: "dccl.time2"
445  units { prefix: "micro" derived_dimensions: "time" }
446  }];
447  required MissionTask.TaskType type = 4;
448 
449  optional DivePacket dive = 10;
450  optional DriftPacket drift = 11;
451 }