diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a520d84ee4d256664277dab38d00704517ad341..ab6df79eb949d13943233a31b8e234f969212cfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [v0.2.0] - 2024-02-06 + +### Added + +- New alert message definition +- Emergency flag in mission plan schemas +- Added additional battery and fuel fields to platform status for SPINE project + +### Changed + +- Updated README to run tests against JS dependencies + ## [v0.1.0] - 2023-03-24 ### Added @@ -23,5 +35,6 @@ JSON schema definitions for the SoAR project Example messages matching the schema for each partner +[unreleased]: https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/compare/v0.2.0...dev +[v0.2.0]: https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/compare/v0.1.0...v0.2.0 [v0.1.0]: https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/compare/9e6ce245...v0.1.0 -[unreleased]: https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/compare/v0.1.0...dev diff --git a/README.md b/README.md index 12bf69ce85099a0219fa27269fe6c7fda188e86e..4d3b970fe534bec0d4f8bcdbc00436ec30bea09f 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Each message below will be wrapped in a `payload` field and will have a `header` * `mission_plan`: these would be two message types, i. encoded (platform-specific serialized message) and ii. parsed, human-readable message. * `platform_status`: these would be two message types, i. encoded (platform-specific serialized message) and ii. parsed, human-readable message. * `observation`: this would be desired scientific data sent by the platform +* `survey`: this would be demanded track, platform actual path, and survey line * `acknowledgement`: level of acknowledgment where an acknowledgement is sent when a message is i. received, ii. sent to the next destination (e.g. platform in the water). * `planning_configuration`: sent from the GUI to initialise the AI model (autonomy engine). @@ -68,16 +69,26 @@ eg * `soar.*.*.*.to_platform.*` - all messages outbound to platforms (hermes) * `soar.*.slocum.#` - all messages relating to a slocum platform type -## Run Docs -Run the command below and go to `http://127.0.0.1:5000` +## Run Docs & Save Schema When Updating Message Formats +1. Run the command below and go to `http://127.0.0.1:5000` ``` python3 generate_schema_config.py ``` + +2. Copy the schema generated `http://127.0.0.1:5000/soar_protocol.json` into the `backbone-message-format/project/<project_name>/swagger.json` + +3. In the json copied, remove the key `"definitions"` from the schema and save this. + ## Run Tests -Run the command below +Run both tests below: +1. Test 1 ``` python3 -m unittest tests/test_schemas.py ``` +2. Test 2 +``` +cd tests-js/docker; docker compose up --build +``` ## Quick Links 1. [Generated Swagger Docs (recommended to look at this)](https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/-/blob/dev/project/soar/swagger.json) diff --git a/examples/autonomy_engine_adapter/emergency_mission_command.json b/examples/autonomy_engine_adapter/emergency_mission_command.json new file mode 100644 index 0000000000000000000000000000000000000000..91f255e6409c5deb2bb1cc01392bdfa3b9e9a0cd --- /dev/null +++ b/examples/autonomy_engine_adapter/emergency_mission_command.json @@ -0,0 +1,24 @@ +{ + "header": { + "message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2022-11-16T00:00:00Z", + "version": 2, + "source": "gui", + "destination": "soar.noc.autosub.alr-52.to_platform.mission_plan", + "delivery_type": "publish", + "encoded": false + }, + "payload":{ + "message_type": "mission_plan", + "platform_ID": "5-ah1", + "autonomy_engine_plan_ID": 1, + "emergency": true, + "plan": [ + { + "action": "abort_now", + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706 + } + ] + } + } \ No newline at end of file diff --git a/examples/autonomy_engine_adapter/emergency_mission_plan.json b/examples/autonomy_engine_adapter/emergency_mission_plan.json new file mode 100644 index 0000000000000000000000000000000000000000..d96b125d3c928f1f6a574feb0bfdb16c0e3b81f7 --- /dev/null +++ b/examples/autonomy_engine_adapter/emergency_mission_plan.json @@ -0,0 +1,30 @@ +{ + "header": { + "message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2022-11-16T00:00:00Z", + "version": 2, + "source": "gui", + "destination": "soar.noc.autosub.alr-52.to_platform.mission_plan", + "delivery_type": "publish", + "encoded": false + }, + "payload":{ + "message_type": "mission_plan", + "platform_ID": "5-ah1", + "autonomy_engine_plan_ID": 1, + "emergency": true, + "plan": [ + { + "action": "move", + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706, + "depth": 5.0 + }, + { + "action": "abort_now", + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706 + } + ] + } + } \ No newline at end of file diff --git a/examples/autonomy_engine_adapter/mission_plan_AH1.json b/examples/autonomy_engine_adapter/mission_plan_AH1.json index 01319153d42bff4442acebd4bcc1c4e0befc48ce..063332e1fe0f91a9beb3727240c833d8c0d01620 100644 --- a/examples/autonomy_engine_adapter/mission_plan_AH1.json +++ b/examples/autonomy_engine_adapter/mission_plan_AH1.json @@ -15,40 +15,40 @@ "plan": [ { "action": "move", - "start_point_latitude": -3.007143188645706, - "start_point_longitude": 50.37072283932642, - "target_waypoint_latitude": -3.237143188645706, - "target_waypoint_longitude": 52.37072283932642, + "start_point_latitude": 50.37072283932642, + "start_point_longitude": -3.007143188645706, + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706, "depth": 0.0, "activate_payload": false, "timeout": 200 }, { "action": "dive", - "start_point_latitude": -3.237143188645706, - "start_point_longitude": 52.37072283932642, - "target_waypoint_latitude": -3.337143188645706, - "target_waypoint_longitude": 56.37072283932642, + "start_point_latitude": 52.37072283932642, + "start_point_longitude": -3.237143188645706, + "target_waypoint_latitude": 56.37072283932642, + "target_waypoint_longitude": -3.337143188645706, "altitude": 10, "activate_payload": false, "timeout": 200 }, { "action": "scanline", - "start_point_latitude": -3.337143188645706, - "start_point_longitude": 56.37072283932642, - "target_waypoint_latitude": -0.237143188645706, - "target_waypoint_longitude": 60.00000000000000, + "start_point_latitude": 56.37072283932642, + "start_point_longitude": -3.337143188645706, + "target_waypoint_latitude": 60.00000000000000, + "target_waypoint_longitude": -0.237143188645706, "altitude": 10, "activate_payload": true, "timeout": 200 }, { - "action": "climb", - "start_point_latitude": -0.237143188645706, - "start_point_longitude": 60.00000000000000, - "target_waypoint_latitude": -0.237143188645706, - "target_waypoint_longitude": 52.37072283932642, + "action": "dive", + "start_point_latitude": 60.00000000000000, + "start_point_longitude": -0.237143188645706, + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -0.237143188645706, "depth": 0.0, "activate_payload": false, "timeout": 200 diff --git a/examples/autonomy_engine_adapter/mission_plan_ECOSUB.json b/examples/autonomy_engine_adapter/mission_plan_ECOSUB.json index b9d5a8b8d927a45164edea329407ea681141a007..ad8bcba98cafe25e5ec15b86a275a21188409fd8 100644 --- a/examples/autonomy_engine_adapter/mission_plan_ECOSUB.json +++ b/examples/autonomy_engine_adapter/mission_plan_ECOSUB.json @@ -15,40 +15,40 @@ "plan": [ { "action": "move", - "start_point_latitude": -3.007143188645706, - "start_point_longitude": 50.37072283932642, - "target_waypoint_latitude": -3.237143188645706, - "target_waypoint_longitude": 52.37072283932642, + "start_point_latitude": 50.37072283932642, + "start_point_longitude": -3.007143188645706, + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706, "depth": 0.0, "activate_payload": false, "timeout": 300 }, { "action": "dive", - "start_point_latitude": -3.237143188645706, - "start_point_longitude": 52.37072283932642, - "target_waypoint_latitude": -3.337143188645706, - "target_waypoint_longitude": 56.37072283932642, + "start_point_latitude": 52.37072283932642, + "start_point_longitude": -3.237143188645706, + "target_waypoint_latitude": 56.37072283932642, + "target_waypoint_longitude": -3.337143188645706, "altitude": 10, "activate_payload": false, "timeout": 300 }, { "action": "scanline", - "start_point_latitude": -3.337143188645706, - "start_point_longitude": 56.37072283932642, - "target_waypoint_latitude": -0.237143188645706, - "target_waypoint_longitude": 60.00000000000000, + "start_point_latitude": 56.37072283932642, + "start_point_longitude": -3.337143188645706, + "target_waypoint_latitude": 60.00000000000000, + "target_waypoint_longitude": -0.237143188645706, "altitude": 10, "activate_payload": true, "timeout": 300 }, { - "action": "climb", - "start_point_latitude": -0.237143188645706, - "start_point_longitude": 60.00000000000000, - "target_waypoint_latitude": -0.237143188645706, - "target_waypoint_longitude": 52.37072283932642, + "action": "dive", + "start_point_latitude": 60.00000000000000, + "start_point_longitude": -0.237143188645706, + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -0.237143188645706, "depth": 0.0, "activate_payload": false, "timeout": 300 diff --git a/examples/autonomy_engine_adapter/mission_plan_HYDROSURV.json b/examples/autonomy_engine_adapter/mission_plan_HYDROSURV.json index 54ffbeb0e079146190796d374dba59508d8a9b49..774a9b996079ddc6ff2a1f68d1ae08f06b3cb3ff 100644 --- a/examples/autonomy_engine_adapter/mission_plan_HYDROSURV.json +++ b/examples/autonomy_engine_adapter/mission_plan_HYDROSURV.json @@ -4,26 +4,26 @@ "timestamp": "2022-11-16T00:00:00Z", "version": 2, "source": "autonomy_engine", - "destination": "soar.hydrosurv.reav-60.reav-60-1.to_platform.mission_plan", + "destination": "soar.hydrosurv.reav60.usvdecibel.to_platform.mission_plan", "delivery_type": "publish", "encoded": false }, "payload":{ "message_type": "mission_plan", - "platform_ID": "reav-60-1", + "platform_ID": "usvdecibel", "autonomy_engine_plan_ID": 1, "plan": [ { - "target_waypoint_latitude": -4.187143188645706, - "target_waypoint_longitude": 50.37072283932642 + "target_waypoint_latitude": 50.37072283932642, + "target_waypoint_longitude": -4.187143188645706 }, { - "target_waypoint_latitude": -3.187143188645706, - "target_waypoint_longitude": 51.37072283932642 + "target_waypoint_latitude": 51.37072283932642, + "target_waypoint_longitude": -3.187143188645706 }, { - "target_waypoint_latitude": -3.237143188645706, - "target_waypoint_longitude": 52.37072283932642 + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706 } ] } diff --git a/examples/autonomy_engine_adapter/planning_configuration.json b/examples/autonomy_engine_adapter/planning_configuration.json index c5a4fb7f16d61bf1ccfb1889965d90a18249a062..005fca7bee95eac72a3769a5292d72c6c21e766a 100644 --- a/examples/autonomy_engine_adapter/planning_configuration.json +++ b/examples/autonomy_engine_adapter/planning_configuration.json @@ -5,122 +5,216 @@ "version": 2, "source": "gui", "destination": "soar.all.all.all.from_platform.planning_configuration", - "delivery_type": "publish", + "delivery_type": "broadcast", "encoded": false }, "payload":{ "message_type": "planning_configuration", - "planning_config_ID": 3, + "planning_config_ID": 1, "exclusion_zones": [ { "geometry_coordinates": [ [ [ - -4.187143188645706, - 50.37072283932642 + -4.1777839187560915, + 50.34173405662855 ], [ - -4.202697005964865, - 50.368816892405874 + -4.1777839187560915, + 50.33820949229701 ], [ - -4.203156724702808, - 50.365640144076906 + -4.143667777943875, + 50.33820949229701 ], [ - -4.19449868846155, - 50.362267670845654 + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 ] ] ] } ], + "region_of_interest": [ + { + "geometry_coordinates": [ + [ + [ + -4.1777839187560915, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 + ] + ] + ] + } + ], "squads": [ { "squad_ID": 1, "no_of_platforms": 1, "squad_mission_type": "tracking", - "squad_state": "active", "platforms": [ { + "operator": "hydrosurv", "model": "reav", - "platform_ID": "reav-60-1", - "emergency": { - "additional_data": {}, - "target_waypoint_latitude": -7.432, - "target_waypoint_longitude": 50.365, - "safe_command": "go_home", - "target_depth": 10.0 - }, - "max_velocity": 0.9, - "min_altitude": 15.2, - "min_velocity": 0.1, - "additional_data": {} + "platform_ID": "usvdecibel", + "active": true } - ], - "region_of_interest": { - "geometry_coordinates": [ - [ - [ - -4.187143188645706, - 50.37072283932642 - ], - [ - -4.202697005964865, - 50.368816892405874 - ], - [ - -4.203156724702808, - 50.365640144076906 - ], - [ - -4.19449868846155, - 50.362267670845654 - ] - ] - ] - } + ] }, { "squad_ID": 2, - "no_of_platforms": 3, + "no_of_platforms": 4, "squad_mission_type": "survey", - "squad_state": "active", "platforms": [ { + "operator": "planet-ocean", "platform_ID": "ecosub-1", "model": "ecosub", + "active": true, + "beacon_ID": 10021, "emergency": { - "additional_data": {}, - "target_waypoint_latitude": -7.432, - "target_waypoint_longitude": 50.365, + "target_waypoint_latitude": 50.32933594228737, + "target_waypoint_longitude": -4.192219151149999, "safe_command": "go_home", "target_depth": 10.0 }, + "min_altitude": 5.0, "max_velocity": 0.9, - "min_altitude": 15.2, "min_velocity": 0.1, + "target_altitude": 15.0, + "turning_radius": 1.5, + "endurance_relative_to_water_speed": { + "min_battery_rating": 2.25, + "max_battery_rating": 1.23, + "avg_battery_rating": 1.9 + }, + "scan_sensor": { + "sensor_type": "SIDESCAN", + "warmup_time": 60.0, + "swath_width": 38.0, + "frequency": 700.0, + "angle": 110.0 + }, "additional_data": { - "scan_type": "DVL", - "swath_width": 10 + "new_sensor_a": "test_sensor", + "range": 10.0 } }, { + "operator": "planet-ocean", "platform_ID": "ecosub-2", "model": "ecosub", + "active": true, + "beacon_ID": 10021, "emergency": { - "additional_data": {}, - "target_waypoint_latitude": -0.432, - "target_waypoint_longitude": 20.365, + "target_waypoint_latitude": 50.32775207068519, + "target_waypoint_longitude": -4.192219151149999, "safe_command": "go_home", "target_depth": 0.0 }, + "min_altitude": 5.0, "max_velocity": 0.9, - "min_altitude": 15.2, "min_velocity": 0.1, + "target_altitude": 15.0, + "turning_radius": 1.5, + "endurance_relative_to_water_speed": { + "min_battery_rating": 2.25, + "max_battery_rating": 1.23, + "avg_battery_rating": 1.9 + }, + "scan_sensor": { + "sensor_type": "SIDESCAN", + "warmup_time": 60.0, + "swath_width": 38.0, + "frequency": 700.0, + "angle": 110.0 + }, + "additional_data": { + "new_sensor_a": "test_sensor", + "range": 10.0 + } + }, + { + "operator": "planet-ocean", + "platform_ID": "ecosub-3", + "model": "ecosub", + "active": true, + "beacon_ID": 10021, + "emergency": { + "target_waypoint_latitude": 50.326744124905844, + "target_waypoint_longitude": -4.184550412882118, + "safe_command": "go_home", + "target_depth": 0.0 + }, + "min_altitude": 5.0, + "max_velocity": 0.9, + "min_velocity": 0.1, + "target_altitude": 15.0, + "turning_radius": 1.5, + "endurance_relative_to_water_speed": { + "min_battery_rating": 2.25, + "max_battery_rating": 1.23, + "avg_battery_rating": 1.9 + }, + "scan_sensor": { + "sensor_type": "SIDESCAN", + "warmup_time": 60.0, + "swath_width": 38.0, + "frequency": 700.0, + "angle": 110.0 + }, "additional_data": { - "scan_type": "DVL", - "swath_width": 10 + "new_sensor_a": "test_sensor", + "range": 10.0 + } + }, + { + "operator": "planet-ocean", + "platform_ID": "ecosub-4", + "model": "ecosub", + "active": true, + "beacon_ID": 10021, + "emergency": { + "target_waypoint_latitude": 50.32616814629094, + "target_waypoint_longitude": -4.188610333142037, + "safe_command": "go_home", + "target_depth": 0.0 + }, + "min_altitude": 5.0, + "max_velocity": 0.9, + "min_velocity": 0.1, + "target_altitude": 15.0, + "turning_radius": 1.5, + "scan_sensor": { + "sensor_type": "SIDESCAN", + "warmup_time": 60.0, + "swath_width": 38.0, + "frequency": 700.0, + "angle": 110.0 + }, + "additional_data": { + "new_sensor_a": "test_sensor", + "range": 10.0 } } ] @@ -129,23 +223,39 @@ "squad_ID": 3, "no_of_platforms": 1, "squad_mission_type": "inspection", - "squad_state": "active", "platforms": [ { + "operator": "noc", "platform_ID": "ah-1", "model": "autosub", + "active": true, + "beacon_ID": 2407, "emergency": { - "additional_data": {}, - "target_waypoint_latitude": 20.432, - "target_waypoint_longitude": 50.365, + "target_waypoint_latitude": 50.3342284629413, + "target_waypoint_longitude": -4.19759350502369, "safe_command": "abort_now", "target_depth": 0.0 }, + "min_altitude": 5.0, "max_velocity": 0.9, - "min_altitude": 15.2, "min_velocity": 0.1, + "target_altitude": 15.0, + "turning_radius": 1.5, + "endurance_relative_to_water_speed": { + "min_battery_rating": 2.25, + "max_battery_rating": 1.23, + "avg_battery_rating": 1.9 + }, + "scan_sensor": { + "sensor_type": "SIDESCAN", + "warmup_time": 60.0, + "swath_width": 38.0, + "frequency": 700.0, + "angle": 110.0 + }, "additional_data": { - "scan_type": "MBES" + "new_sensor_a": "test_sensor", + "range": 10.0 } } ] diff --git a/examples/autonomy_engine_adapter/survey.json b/examples/autonomy_engine_adapter/survey.json new file mode 100644 index 0000000000000000000000000000000000000000..21ee23f9f4b6ef155fb8830abc6f1d647027ddf0 --- /dev/null +++ b/examples/autonomy_engine_adapter/survey.json @@ -0,0 +1,28 @@ +{ + "header": { + "message_ID": "e1237003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2023-03-16T00:00:00Z", + "version": 2, + "source": "ecosub.ecosub-c2", + "destination": "soar.planet-ocean.ecosub.ecosub-2.from_platform.survey", + "delivery_type": "publish", + "encoded": false + }, + "payload": { + "message_type": "survey", + "timestamp": "2026-12-21T00:00:00Z", + "latitude_A": 188.1, + "longitude_A": -10.122, + "latitude_B": 178.2, + "longitude_B": -10.122, + "latitude_C": 177.9, + "longitude_C": -10.122, + "latitude_D": 178.2, + "longitude_D": -11.122, + "latitude_E": 179.2, + "longitude_E": -11.122, + "platform_ID": "ecosub-2", + "track_ID": 12 + } +} + \ No newline at end of file diff --git a/examples/autonomy_engine_adapter/survey_encoded.json b/examples/autonomy_engine_adapter/survey_encoded.json new file mode 100644 index 0000000000000000000000000000000000000000..19eaf7b6c9871c3e9b503e05bcb588bb3934208b --- /dev/null +++ b/examples/autonomy_engine_adapter/survey_encoded.json @@ -0,0 +1,19 @@ +{ + "header": { + "message_ID": "t1237003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2023-03-16T00:00:00Z", + "version": 2, + "source": "hermes.ecosub-2", + "destination": "soar.noc.autosub.alr-52.from_platform.survey_encoded", + "delivery_type": "publish", + "encoded": true + }, + "payload": { + "message_type": "survey_encoded", + "data": "HWYFBAAD+zwBySUAAAADVek72v1N2lUAAAAA9P2cP166ab+9cg==", + "file_name": "ecosub2-survey-data_03837434286438.sbd", + "mime_type": "application/gzip", + "is_binary": true + } + } + \ No newline at end of file diff --git a/examples/ecosub_adapter/mission_plan.json b/examples/ecosub_adapter/mission_plan.json index b9d5a8b8d927a45164edea329407ea681141a007..ad8bcba98cafe25e5ec15b86a275a21188409fd8 100644 --- a/examples/ecosub_adapter/mission_plan.json +++ b/examples/ecosub_adapter/mission_plan.json @@ -15,40 +15,40 @@ "plan": [ { "action": "move", - "start_point_latitude": -3.007143188645706, - "start_point_longitude": 50.37072283932642, - "target_waypoint_latitude": -3.237143188645706, - "target_waypoint_longitude": 52.37072283932642, + "start_point_latitude": 50.37072283932642, + "start_point_longitude": -3.007143188645706, + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706, "depth": 0.0, "activate_payload": false, "timeout": 300 }, { "action": "dive", - "start_point_latitude": -3.237143188645706, - "start_point_longitude": 52.37072283932642, - "target_waypoint_latitude": -3.337143188645706, - "target_waypoint_longitude": 56.37072283932642, + "start_point_latitude": 52.37072283932642, + "start_point_longitude": -3.237143188645706, + "target_waypoint_latitude": 56.37072283932642, + "target_waypoint_longitude": -3.337143188645706, "altitude": 10, "activate_payload": false, "timeout": 300 }, { "action": "scanline", - "start_point_latitude": -3.337143188645706, - "start_point_longitude": 56.37072283932642, - "target_waypoint_latitude": -0.237143188645706, - "target_waypoint_longitude": 60.00000000000000, + "start_point_latitude": 56.37072283932642, + "start_point_longitude": -3.337143188645706, + "target_waypoint_latitude": 60.00000000000000, + "target_waypoint_longitude": -0.237143188645706, "altitude": 10, "activate_payload": true, "timeout": 300 }, { - "action": "climb", - "start_point_latitude": -0.237143188645706, - "start_point_longitude": 60.00000000000000, - "target_waypoint_latitude": -0.237143188645706, - "target_waypoint_longitude": 52.37072283932642, + "action": "dive", + "start_point_latitude": 60.00000000000000, + "start_point_longitude": -0.237143188645706, + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -0.237143188645706, "depth": 0.0, "activate_payload": false, "timeout": 300 diff --git a/examples/ecosub_adapter/survey.json b/examples/ecosub_adapter/survey.json new file mode 100644 index 0000000000000000000000000000000000000000..21ee23f9f4b6ef155fb8830abc6f1d647027ddf0 --- /dev/null +++ b/examples/ecosub_adapter/survey.json @@ -0,0 +1,28 @@ +{ + "header": { + "message_ID": "e1237003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2023-03-16T00:00:00Z", + "version": 2, + "source": "ecosub.ecosub-c2", + "destination": "soar.planet-ocean.ecosub.ecosub-2.from_platform.survey", + "delivery_type": "publish", + "encoded": false + }, + "payload": { + "message_type": "survey", + "timestamp": "2026-12-21T00:00:00Z", + "latitude_A": 188.1, + "longitude_A": -10.122, + "latitude_B": 178.2, + "longitude_B": -10.122, + "latitude_C": 177.9, + "longitude_C": -10.122, + "latitude_D": 178.2, + "longitude_D": -11.122, + "latitude_E": 179.2, + "longitude_E": -11.122, + "platform_ID": "ecosub-2", + "track_ID": 12 + } +} + \ No newline at end of file diff --git a/examples/ecosub_adapter/survey_encoded.json b/examples/ecosub_adapter/survey_encoded.json new file mode 100644 index 0000000000000000000000000000000000000000..19eaf7b6c9871c3e9b503e05bcb588bb3934208b --- /dev/null +++ b/examples/ecosub_adapter/survey_encoded.json @@ -0,0 +1,19 @@ +{ + "header": { + "message_ID": "t1237003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2023-03-16T00:00:00Z", + "version": 2, + "source": "hermes.ecosub-2", + "destination": "soar.noc.autosub.alr-52.from_platform.survey_encoded", + "delivery_type": "publish", + "encoded": true + }, + "payload": { + "message_type": "survey_encoded", + "data": "HWYFBAAD+zwBySUAAAADVek72v1N2lUAAAAA9P2cP166ab+9cg==", + "file_name": "ecosub2-survey-data_03837434286438.sbd", + "mime_type": "application/gzip", + "is_binary": true + } + } + \ No newline at end of file diff --git a/examples/gui_adapter/emergency_mission_command.json b/examples/gui_adapter/emergency_mission_command.json new file mode 100644 index 0000000000000000000000000000000000000000..91f255e6409c5deb2bb1cc01392bdfa3b9e9a0cd --- /dev/null +++ b/examples/gui_adapter/emergency_mission_command.json @@ -0,0 +1,24 @@ +{ + "header": { + "message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2022-11-16T00:00:00Z", + "version": 2, + "source": "gui", + "destination": "soar.noc.autosub.alr-52.to_platform.mission_plan", + "delivery_type": "publish", + "encoded": false + }, + "payload":{ + "message_type": "mission_plan", + "platform_ID": "5-ah1", + "autonomy_engine_plan_ID": 1, + "emergency": true, + "plan": [ + { + "action": "abort_now", + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706 + } + ] + } + } \ No newline at end of file diff --git a/examples/gui_adapter/emergency_mission_plan.json b/examples/gui_adapter/emergency_mission_plan.json new file mode 100644 index 0000000000000000000000000000000000000000..d96b125d3c928f1f6a574feb0bfdb16c0e3b81f7 --- /dev/null +++ b/examples/gui_adapter/emergency_mission_plan.json @@ -0,0 +1,30 @@ +{ + "header": { + "message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2022-11-16T00:00:00Z", + "version": 2, + "source": "gui", + "destination": "soar.noc.autosub.alr-52.to_platform.mission_plan", + "delivery_type": "publish", + "encoded": false + }, + "payload":{ + "message_type": "mission_plan", + "platform_ID": "5-ah1", + "autonomy_engine_plan_ID": 1, + "emergency": true, + "plan": [ + { + "action": "move", + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706, + "depth": 5.0 + }, + { + "action": "abort_now", + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706 + } + ] + } + } \ No newline at end of file diff --git a/examples/gui_adapter/planning_configuration.json b/examples/gui_adapter/planning_configuration.json index 319d9bda8fcf3e95382d4d801c7a556e6af0f52d..9c04569473fd56579e6e0bdf565ee88702aba341 100644 --- a/examples/gui_adapter/planning_configuration.json +++ b/examples/gui_adapter/planning_configuration.json @@ -10,114 +10,223 @@ }, "payload":{ "message_type": "planning_configuration", - "planning_config_ID": 3, + "planning_config_ID": 1, "exclusion_zones": [ { "geometry_coordinates": [ [ [ - -4.187143188645706, - 50.37072283932642 + -4.1777839187560915, + 50.34173405662855 ], [ - -4.202697005964865, - 50.368816892405874 + -4.1777839187560915, + 50.33820949229701 ], [ - -4.203156724702808, - 50.365640144076906 + -4.143667777943875, + 50.33820949229701 ], [ - -4.19449868846155, - 50.362267670845654 + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 ] ] ] } ], + "region_of_interest": [ + { + "geometry_coordinates": [ + [ + [ + -4.1777839187560915, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 + ] + ] + ] + } + ], "squads": [ { "squad_ID": 1, "no_of_platforms": 1, "squad_mission_type": "tracking", - "squad_state": "active", "platforms": [ { - "model": "reav", - "platform_ID": "reav-60-1", + "operator": "hydrosurv", + "model": "reav60", + "platform_ID": "usvdecibel", + "active": true, "emergency": { - "target_waypoint_latitude": -7.432, - "target_waypoint_longitude": 50.365, + "target_waypoint_latitude": 50.33611100020795, + "target_waypoint_longitude": -4.189772466767039, "safe_command": "go_home", "target_depth": 10.0 }, + "min_altitude": 0.0, "max_velocity": 0.9, - "min_altitude": 15.2, - "min_velocity": 0.1 + "min_velocity": 0.1, + "target_altitude": 0.0, + "endurance_relative_to_water_speed": { + "min_battery_rating": 2.25, + "max_battery_rating": 1.23, + "avg_battery_rating": 1.9 + }, + "additional_data": {} } - ], - "region_of_interest": { - "geometry_coordinates": [ - [ - [ - -4.187143188645706, - 50.37072283932642 - ], - [ - -4.202697005964865, - 50.368816892405874 - ], - [ - -4.203156724702808, - 50.365640144076906 - ], - [ - -4.19449868846155, - 50.362267670845654 - ] - ] - ] - } + ] }, { "squad_ID": 2, - "no_of_platforms": 3, + "no_of_platforms": 4, "squad_mission_type": "survey", - "squad_state": "active", "platforms": [ { - "platform_ID": "ecosub-2", + "operator": "planet-ocean", + "platform_ID": "ecosub-1", "model": "ecosub", + "active": true, + "beacon_ID": 10021, "emergency": { - "target_waypoint_latitude": -7.432, - "target_waypoint_longitude": 50.365, + "target_waypoint_latitude": 50.32933594228737, + "target_waypoint_longitude": -4.192219151149999, "safe_command": "go_home", "target_depth": 10.0 }, + "min_altitude": 5.0, "max_velocity": 0.9, - "min_altitude": 15.2, "min_velocity": 0.1, + "target_altitude": 15.0, + "turning_radius": 1.5, + "endurance_relative_to_water_speed": { + "min_battery_rating": 2.25, + "max_battery_rating": 1.23, + "avg_battery_rating": 1.9 + }, + "scan_sensor": { + "sensor_type": "SIDESCAN", + "swath_width": 38.0, + "frequency": 700.0, + "angle": 110.0 + }, "additional_data": { - "scan_type": "DVL", - "swath_width": 10 + "new_sensor_a": "test_sensor", + "range": 10.0 } }, { - "platform_ID": "ecosub-5", + "operator": "planet-ocean", + "platform_ID": "ecosub-2", "model": "ecosub", + "active": true, + "beacon_ID": 10021, "emergency": { - "additional_data": {}, - "target_waypoint_latitude": -0.432, - "target_waypoint_longitude": 20.365, + "target_waypoint_latitude": 50.32775207068519, + "target_waypoint_longitude": -4.192219151149999, "safe_command": "go_home", "target_depth": 0.0 }, + "min_altitude": 5.0, "max_velocity": 0.9, - "min_altitude": 15.2, "min_velocity": 0.1, + "target_altitude": 15.0, + "turning_radius": 1.5, + "endurance_relative_to_water_speed": { + "min_battery_rating": 2.25, + "max_battery_rating": 1.23, + "avg_battery_rating": 1.9 + }, + "scan_sensor": { + "sensor_type": "SIDESCAN", + "swath_width": 38.0, + "frequency": 700.0, + "angle": 110.0 + }, + "additional_data": { + "new_sensor_a": "test_sensor", + "range": 10.0 + } + }, + { + "operator": "planet-ocean", + "platform_ID": "ecosub-3", + "model": "ecosub", + "active": true, + "beacon_ID": 10021, + "emergency": { + "target_waypoint_latitude": 50.326744124905844, + "target_waypoint_longitude": -4.184550412882118, + "safe_command": "go_home", + "target_depth": 0.0 + }, + "min_altitude": 5.0, + "max_velocity": 0.9, + "min_velocity": 0.1, + "target_altitude": 15.0, + "turning_radius": 1.5, + "endurance_relative_to_water_speed": { + "min_battery_rating": 2.25, + "max_battery_rating": 1.23, + "avg_battery_rating": 1.9 + }, + "scan_sensor": { + "sensor_type": "SIDESCAN", + "swath_width": 38.0, + "frequency": 700.0, + "angle": 110.0 + }, "additional_data": { - "scan_type": "DVL", - "swath_width": 10 + "new_sensor_a": "test_sensor", + "range": 10.0 + } + }, + { + "operator": "planet-ocean", + "platform_ID": "ecosub-4", + "model": "ecosub", + "active": true, + "beacon_ID": 10021, + "emergency": { + "target_waypoint_latitude": 50.32616814629094, + "target_waypoint_longitude": -4.188610333142037, + "safe_command": "go_home", + "target_depth": 0.0 + }, + "min_altitude": 5.0, + "max_velocity": 0.9, + "min_velocity": 0.1, + "target_altitude": 15.0, + "turning_radius": 1.5, + "scan_sensor": { + "sensor_type": "SIDESCAN", + "swath_width": 38.0, + "frequency": 700.0, + "angle": 110.0 + }, + "additional_data": { + "new_sensor_a": "test_sensor", + "range": 10.0 } } ] @@ -126,23 +235,38 @@ "squad_ID": 3, "no_of_platforms": 1, "squad_mission_type": "inspection", - "squad_state": "active", "platforms": [ { - "platform_ID": "139-ah-1", + "operator": "noc", + "platform_ID": "ah-1", "model": "autosub", + "active": true, + "beacon_ID": 2407, "emergency": { - "additional_data": {}, - "target_waypoint_latitude": 20.432, - "target_waypoint_longitude": 50.365, + "target_waypoint_latitude": 50.3342284629413, + "target_waypoint_longitude": -4.19759350502369, "safe_command": "abort_now", "target_depth": 0.0 }, + "min_altitude": 5.0, "max_velocity": 0.9, - "min_altitude": 15.2, "min_velocity": 0.1, + "target_altitude": 15.0, + "turning_radius": 1.5, + "endurance_relative_to_water_speed": { + "min_battery_rating": 2.25, + "max_battery_rating": 1.23, + "avg_battery_rating": 1.9 + }, + "scan_sensor": { + "sensor_type": "SIDESCAN", + "swath_width": 38.0, + "frequency": 700.0, + "angle": 110.0 + }, "additional_data": { - "scan_type": "MBES" + "new_sensor_a": "test_sensor", + "range": 10.0 } } ] diff --git a/examples/hydrosurv_adapter/acknowledgement.json b/examples/hydrosurv_adapter/acknowledgement.json index 0c130c46fc818d5fd913ed703c04e9341872b3c1..23c1028b712c08f0015b8db8ccdf1a1896684a51 100644 --- a/examples/hydrosurv_adapter/acknowledgement.json +++ b/examples/hydrosurv_adapter/acknowledgement.json @@ -4,14 +4,14 @@ "timestamp": "2022-11-16T00:00:00Z", "version": 1, "source": "hydrosurv_adapter", - "destination": "soar.hydrosurv.reav-60.reav-60-1.from_platform.acknowledgement", + "destination": "soar.hydrosurv.reav60.usvdecibel.from_platform.acknowledgement", "delivery_type": "publish", "encoded": false }, "payload":{ "message_type": "acknowledgement", "autonomy_engine_plan_ID": 1, - "platform_ID": "reav-60-1", + "platform_ID": "usvdecibel", "approved": false } } \ No newline at end of file diff --git a/examples/hydrosurv_adapter/alert.json b/examples/hydrosurv_adapter/alert.json new file mode 100644 index 0000000000000000000000000000000000000000..9abbbbbe47d4c840e786488cb4f0117424e4fafa --- /dev/null +++ b/examples/hydrosurv_adapter/alert.json @@ -0,0 +1,21 @@ +{ + "header": { + "message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2022-11-16T00:00:00Z", + "version": 1, + "source": "hydrosurv_adapter", + "destination": "soar.hydrosurv.reav60.usvdecibel.from_platform.alert", + "delivery_type": "publish", + "encoded": false + }, + "payload": { + "message_type": "alert", + "platform_ID": "usvdecibel", + "code": 345, + "platform_timestamp": "2022-12-21T00:00:00Z", + "subsystem": "Onboard Fault Monitor", + "summary": "Steering Damage - Port Side", + "details": "Discrepancy between rudder and actuator positions : Rudder Pos=10.31°, Steering Actuator Pos=28.65°, Discrepancy=18.33°", + "severity": "Alarm" + } +} \ No newline at end of file diff --git a/examples/hydrosurv_adapter/mission_plan.json b/examples/hydrosurv_adapter/mission_plan.json index 54ffbeb0e079146190796d374dba59508d8a9b49..774a9b996079ddc6ff2a1f68d1ae08f06b3cb3ff 100644 --- a/examples/hydrosurv_adapter/mission_plan.json +++ b/examples/hydrosurv_adapter/mission_plan.json @@ -4,26 +4,26 @@ "timestamp": "2022-11-16T00:00:00Z", "version": 2, "source": "autonomy_engine", - "destination": "soar.hydrosurv.reav-60.reav-60-1.to_platform.mission_plan", + "destination": "soar.hydrosurv.reav60.usvdecibel.to_platform.mission_plan", "delivery_type": "publish", "encoded": false }, "payload":{ "message_type": "mission_plan", - "platform_ID": "reav-60-1", + "platform_ID": "usvdecibel", "autonomy_engine_plan_ID": 1, "plan": [ { - "target_waypoint_latitude": -4.187143188645706, - "target_waypoint_longitude": 50.37072283932642 + "target_waypoint_latitude": 50.37072283932642, + "target_waypoint_longitude": -4.187143188645706 }, { - "target_waypoint_latitude": -3.187143188645706, - "target_waypoint_longitude": 51.37072283932642 + "target_waypoint_latitude": 51.37072283932642, + "target_waypoint_longitude": -3.187143188645706 }, { - "target_waypoint_latitude": -3.237143188645706, - "target_waypoint_longitude": 52.37072283932642 + "target_waypoint_latitude": 52.37072283932642, + "target_waypoint_longitude": -3.237143188645706 } ] } diff --git a/examples/hydrosurv_adapter/platform_status.json b/examples/hydrosurv_adapter/platform_status.json index 72c30dd2857c30db3994a9b61fc781915f668e94..193e12a2791e73088c6282623d0b1a0dfe2ab90f 100644 --- a/examples/hydrosurv_adapter/platform_status.json +++ b/examples/hydrosurv_adapter/platform_status.json @@ -1,25 +1,29 @@ { - "header":{ + "header": { "message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", "timestamp": "2022-11-16T00:00:00Z", "version": 2, "source": "hydrosurv_adapter", - "destination": "soar.hydrosurv.reav-60.reav-60-1.from_platform.platform_status", + "destination": "soar.hydrosurv.reav60.usvdecibel.from_platform.platform_status", "delivery_type": "publish", "encoded": false }, - "payload":{ + "payload": { "message_type": "platform_status", "autonomy_engine_plan_ID": 1, "status_source": "onboard_platform", "battery_remaining_capacity": 80.2, + "battery_output": 3.8, + "fuel_volume": 13.2, + "fuel_remaining_capacity": 65.3, + "endurance": 3.4, "heading": 310.0, "health_status": false, "latitude": 178.2, "longitude": -10.122, "mission_plan_ID": 1, "mission_track_ID": 4, - "platform_ID": "reav-60-1", + "platform_ID": "usvdecibel", "platform_state": "ABORT", "platform_timestamp": "2022-12-21T00:00:00Z", "speed_over_ground": 4.5, diff --git a/formats/__init__.py b/formats/__init__.py index e7e9b0006c0178a09b011dff9ec343b9b1e6a637..96c6be008d8b1895aed1f89f92272359f4a0dcd1 100644 --- a/formats/__init__.py +++ b/formats/__init__.py @@ -44,7 +44,7 @@ message_header = { "encoded": { "type": "boolean", "description": "Indicate that message raw (encoded) or decoded. " - + "Options: encoded=True, decoded=False", + + "Options: encoded=true, decoded=false", "example": False, }, "delivery_type": { diff --git a/formats/alert.py b/formats/alert.py new file mode 100644 index 0000000000000000000000000000000000000000..bfdc287da53cca7366be0094e07922577d31f92e --- /dev/null +++ b/formats/alert.py @@ -0,0 +1,58 @@ +""" + schemas: Alert message sent on fault detection +""" +alert_schema = { + "type": "object", + "properties": { + "message_type": { + "type": "string", + "description": "Type of message", + "example": "alert", + "enum": ["alert"], + }, + "code": { + "type": "integer", + "description": "Alert code", + "example": 345, + }, + "platform_ID": { + "type": "string", + "description": "Unique identifier for this platform", + "example": "usvdecibel", + }, + "platform_timestamp": { + "type": "string", + "format": "date-time", + "description": "Timestamp for onboard platform status message", + "example": "2022-12-21T00:00:00Z", + }, + "subsystem": { + "type": "string", + "description": "System that generated the alert", + "example": "Onboard Fault Monitor", + }, + "summary": { + "type": "string", + "description": "High level description of the alert", + "example": "Steering Damage - Port Side", + }, + "details": { + "type": "string", + "description": "Detailed reason for the alert ", + "example": "Discrepancy between rudder and actuator positions" + + " : Rudder Pos=10.31°, Steering Actuator Pos=28.65°, Discrepancy=18.33°", + }, + "severity": { + "type": "string", + "description": "Severity level of alert", + "example": "Alarm", + "enum": ["Emergency", "Alarm", "Warning", "Caution"], + }, + }, + "required": [ + "message_type", + "platform_ID", + "code", + "severity", + ], +} diff --git a/formats/encoded.py b/formats/encoded.py index 8d6d700686a0db7797b070a28a73f46cd04a91c7..e6bb57418526233593878c6788ff7b8982baf70d 100644 --- a/formats/encoded.py +++ b/formats/encoded.py @@ -32,8 +32,8 @@ encoded_schema = { "is_binary": { "type": "boolean", "description": ( - "True if the data field contains binary format data encoded as base64." - + " False if the data field contains ascii content such as NMEA." + "true if the data field contains binary format data encoded as base64." + + " false if the data field contains ascii content such as NMEA." ), "example": True, }, diff --git a/formats/mission_plan.py b/formats/mission_plan.py index 4a97375a42b304a73a026bc9de8a4add7b5e0fcd..f62e823239d1106de2ebec06a331138e54f19fe3 100644 --- a/formats/mission_plan.py +++ b/formats/mission_plan.py @@ -11,31 +11,43 @@ action_schema = { "type": "string", "description": "Autonomy Engine's action from `move`, `payload`," + " `dive`, `send_hits`, `scanline`, `scanpoint`.", + "enum": [ + "move", + "payload", + "dive", + "send_hits", + "scanline", + "scanpoint", + "go_home", + "surface_now", + "stop_mission", + "abort_now", + ], "example": "move", }, "start_point_latitude": { "type": "number", "format": "float", - "description": "Start point, x-coordinate", - "example": -4.187143188645706, + "description": "Start point, y-coordinate", + "example": 50.37072283932642, }, "start_point_longitude": { "type": "number", "format": "float", - "description": "Start point, y-coordinate", - "example": 50.37072283932642, + "description": "Start point, x-coordinate", + "example": -4.187143188645706, }, "target_waypoint_latitude": { "type": "number", "format": "float", - "description": "Target waypoint, x-coordinate", - "example": -4.187143188645706, + "description": "Target waypoint, y-coordinate", + "example": 50.37072283932642, }, "target_waypoint_longitude": { "type": "number", "format": "float", - "description": "Target waypoint, y-coordinate", - "example": 50.37072283932642, + "description": "Target waypoint, x-coordinate", + "example": -4.187143188645706, }, "altitude": { "type": "number", @@ -88,6 +100,13 @@ mission_plan_schema = { "description": "Unique identifier for this platform", "example": "reav-x-1", }, + "emergency": { + "type": "boolean", + "description": "To indicate if this is an emergency. " + + "true = emergency and false = no emergency", + "default": False, + "example": False, + }, "plan": { "type": "array", "items": action_schema, diff --git a/formats/mission_plan_encoded.py b/formats/mission_plan_encoded.py index bc32ab4f0921816ca33ccbd6a327c6403973ba6d..62f89088c47d44d7d8b894fbafd15139015d2a6c 100644 --- a/formats/mission_plan_encoded.py +++ b/formats/mission_plan_encoded.py @@ -1,6 +1,7 @@ from formats.encoded import encoded_schema +from copy import deepcopy -mission_plan_encoded_schema = encoded_schema +mission_plan_encoded_schema = deepcopy(encoded_schema) mission_plan_encoded_schema["properties"]["message_type"]["enum"] = [ "mission_plan_encoded" diff --git a/formats/observation.py b/formats/observation.py index 4ecf017e13cbc202897e688dbf84cbbc3d6e46bd..9a65d4bd12c171c1151c9905d0dbc76d7cae7f33 100644 --- a/formats/observation.py +++ b/formats/observation.py @@ -9,13 +9,13 @@ hits_schema = { "latitude": { "type": "number", "format": "float", - "description": "Identified x-coordinate of point of interest", + "description": "Identified y-coordinate of point of interest", "example": 178.2, }, "longitude": { "type": "number", "format": "float", - "description": "Identified y-coordinate of point of interest", + "description": "Identified x-coordinate of point of interest", "example": -10.122, }, "quality_of_point": { diff --git a/formats/observation_encoded.py b/formats/observation_encoded.py index 257c21a7a55703f0cc55cc69da6bb4a62d606576..520758bf381fd63a4df758180fe2c792ed309666 100644 --- a/formats/observation_encoded.py +++ b/formats/observation_encoded.py @@ -1,6 +1,7 @@ from formats.encoded import encoded_schema +from copy import deepcopy -observation_encoded_schema = encoded_schema +observation_encoded_schema = deepcopy(encoded_schema) observation_encoded_schema["properties"]["message_type"]["enum"] = [ "observation_encoded" diff --git a/formats/planning_configuration.py b/formats/planning_configuration.py index c741b6c8d42bc9e0460c83a86ea55c7c5ab7a5af..6a16e4272451365426cdd29874361db193bba0de 100644 --- a/formats/planning_configuration.py +++ b/formats/planning_configuration.py @@ -8,7 +8,7 @@ emergency_schema = { "properties": { "safe_command": { "type": "string", - "enum": ["go_home", "abort_now", "stop_mission"], + "enum": ["go_home", "abort_now", "stop_now", "surface_now"], "description": "Command/Action that is native to respective" + " partner's platform/C2", "example": "go_home", @@ -16,14 +16,14 @@ emergency_schema = { "target_waypoint_latitude": { "type": "number", "format": "float", - "description": "X-coordinate safe place for respective platform", - "example": -7.432, + "description": "Y-coordinate safe place for respective platform", + "example": 50.365, }, "target_waypoint_longitude": { "type": "number", "format": "float", - "description": "Y-coordinate safe place for respective platform", - "example": 50.365, + "description": "X-coordinate safe place for respective platform", + "example": -7.432, }, "target_depth": { "type": "number", @@ -32,11 +32,6 @@ emergency_schema = { + " . If platform to NOT stay at depth, key in `0.0`", "example": 10.0, }, - "additional_data": { - "type": "object", - "description": "Any addition fields/data to be added here", - "example": {}, - }, }, "required": [ "target_waypoint_latitude", @@ -45,10 +40,80 @@ emergency_schema = { ], } +endurance_relative_water_speed_schema = { + "type": "object", + "properties": { + "min_battery_rating": { + "type": "number", + "format": "float", + "description": "Battery endurance rating during maximum speed usage (m/s)", + "example": 3.32, + }, + "max_battery_rating": { + "type": "number", + "format": "float", + "description": "Battery endurance rating during maximum speed usage (m/s)", + "example": 1.23, + }, + "avg_battery_rating": { + "type": "number", + "format": "float", + "description": ( + "Battery endurance rating during standard operational" + + " speed usage (m/s)" + ), + "example": 1.9, + }, + }, +} + + +scan_sensor_schema = { + "type": "object", + "properties": { + "sensor_type": { + "type": "string", + "description": "Unique identifier for this platform", + "example": "MBES", + "enum": ["SIDESCAN", "MBES"], + }, + "warmup_time": { + "type": "number", + "format": "float", + "description": "Warmup time (seconds) for sensor to start up.", + "example": 180.0, + }, + "swath_width": { + "type": "number", + "format": "float", + "description": "Function of `target_altitude` for the platform's " + + "swath width (in metres)", + "example": 38.0, + }, + "frequency": { + "type": "number", + "format": "float", + "description": "Frequency of scanning sensor (in kHz)", + "example": 700.0, + }, + "angle": { + "type": "number", + "format": "float", + "description": "Angle of range of swath width (in degrees)", + "example": 140.0, + }, + }, +} + platform_schema = { "type": "object", "properties": { + "operator": { + "type": "string", + "description": "Operator of platform", + "example": "noc", + }, "platform_ID": { "type": "string", "description": "Unique identifier for this platform", @@ -58,38 +123,61 @@ platform_schema = { "type": "string", "example": "reav", }, + "beacon_ID": { + "type": "number", + "description": "Unique identifier (number) for the beacon " + + "associated to this platform", + "example": 2407, + }, + "active": { + "type": "boolean", + "description": "If platform is active = True, and inactive = False", + "example": True, + }, "emergency": emergency_schema, "min_altitude": { "type": "number", "format": "float", - "description": "Minimum altitude set for squad.", + "description": "Minimum altitude set for platform", "example": 15.2, }, "min_velocity": { "type": "number", "format": "float", - "description": "Minimum velocity set for squad.", + "description": "Minimum velocity set for platform", "example": 0.1, }, "max_velocity": { "type": "number", "format": "float", - "description": "Maximum altitude set for squad.", + "description": "Maximum velocity set for platform", "example": 0.9, }, + "target_altitude": { + "type": "number", + "format": "float", + "description": "Target altitude set for platform. This affects swath width", + "example": 15.0, + }, + "turning_radius": { + "type": "number", + "format": "float", + "description": "Turning radius of platform (in metres)", + "example": 1.0, + }, + "endurance_relative_to_water_speed": endurance_relative_water_speed_schema, + "scan_sensor": scan_sensor_schema, "additional_data": { "description": "Any addition fields/data to be added here", - "example": {"swath_width": 10.0, "scan_type": "DVL"}, + "example": {"new_sensor_a": "test_sensor", "range": 10.0}, "type": "object", }, }, "required": [ + "operator", "platform_ID", + "active", "model", - "emergency", - "min_altitude", - "min_velocity", - "max_velocity", ], } @@ -97,18 +185,19 @@ region_schema = { "type": "object", "properties": { "geometry_coordinates": { - "type": "array", # TODO: Check if config defn is right. + "type": "array", "example": [ [ - [-4.187143188645706, 50.37072283932642], - [-4.202697005964865, 50.368816892405874], - [-4.203156724702808, 50.365640144076906], - [-4.19449868846155, 50.362267670845654], + [-4.1777839187560915, 50.34173405662855], + [-4.1777839187560915, 50.33820949229701], + [-4.143667777943875, 50.33820949229701], + [-4.143667777943875, 50.34173405662855], + [-4.1777839187560915, 50.34173405662855], ] ], }, }, - "description": "Using GEOJSON, exact 4-point region (rectangle shaped)", + "description": "Using GEOJSON, exact 4-point region (rectangle shaped - 5 points)", } squad_metadata_schema = { @@ -136,19 +225,12 @@ squad_metadata_schema = { + ", `inspection`", "example": "survey", }, - "squad_state": { - "type": "string", - "description": "In execution, Waiting.. <define further>", - "example": False, - }, - "region_of_interest": region_schema, }, "required": [ "squad_ID", "no_of_platforms", "platforms", "squad_mission_type", - "squad_state", ], } @@ -167,6 +249,11 @@ planning_configuration_schema = { + " configuration plan", "example": 3, }, + "region_of_interest": { + "type": "array", + "items": region_schema, + "description": "Region of interest for the entire operation", + }, "exclusion_zones": { "type": "array", "items": region_schema, @@ -182,5 +269,6 @@ planning_configuration_schema = { "planning_config_ID", "squads", "exclusion_zones", + "region_of_interest", ], } diff --git a/formats/platform_status.py b/formats/platform_status.py index f0e0cb6a0ca1558bb4e16a9bdf5c72f6e7ad7189..81b452f08fddecdc800e4992d046595b02642d2e 100644 --- a/formats/platform_status.py +++ b/formats/platform_status.py @@ -14,7 +14,7 @@ sensor_schema = { }, "sensor_on": { "type": "boolean", - "description": "Sensor switched on (True) or off (False)", + "description": "Sensor switched on (true) or off (false)", "example": True, }, "additional_data": { @@ -75,13 +75,13 @@ platform_status_schema = { "latitude": { "type": "number", "format": "float", - "description": "Latitude in decimal degrees.", + "description": "Latitude (Y-coordinate) in decimal degrees.", "example": 178.2, }, "longitude": { "type": "number", "format": "float", - "description": "Longitude in decimal degrees.", + "description": "Longitude (X-coordinate) in decimal degrees.", "example": -10.122, }, "depth": { @@ -170,6 +170,31 @@ platform_status_schema = { "description": "Battery remaining % provided by respective C2", "example": 80.2, }, + "battery_output": { + "type": "number", + "format": "float", + "description": "Battery output in kW", + "example": 80.2, + }, + "fuel_remaining_capacity": { + "type": "number", + "format": "float", + "description": "Percentage remaining capacity", + "example": 80.2, + }, + "fuel_volume": { + "type": "number", + "format": "float", + "description": "Litres of liquid fuel", + "example": 12.5, + }, + "endurance": { + "type": "number", + "format": "float", + "description": "Estimate of hours of operation remaining " + + "based on present output or performance", + "example": 7.4, + }, "sensor_config": sensor_schema, }, "required": [ diff --git a/formats/platform_status_encoded.py b/formats/platform_status_encoded.py index 23b54a9a9cb28f228c4781a481c7318c294185dc..fcca15903929f67b350b7716560e447d65951276 100644 --- a/formats/platform_status_encoded.py +++ b/formats/platform_status_encoded.py @@ -1,6 +1,7 @@ from formats.encoded import encoded_schema +from copy import deepcopy -platform_status_encoded_schema = encoded_schema +platform_status_encoded_schema = deepcopy(encoded_schema) platform_status_encoded_schema["properties"]["message_type"]["enum"] = [ "platform_status_encoded" diff --git a/formats/survey.py b/formats/survey.py new file mode 100644 index 0000000000000000000000000000000000000000..32c2b0d7fe95602167e0f83d395f2c1d5d82ef69 --- /dev/null +++ b/formats/survey.py @@ -0,0 +1,129 @@ +""" + schema: Survey Message that is decoded sent by platforms + to track progress +""" + +survey_schema = { + "type": "object", + "properties": { + "message_type": { + "type": "string", + "description": "Type of message", + "example": "survey", + "enum": ["survey"], + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "Timestamp for onboard message", + "example": "2022-12-21T00:00:00Z", + }, + "latitude_A": { + "type": "number", + "format": "float", + "description": ( + "Latitude of point A(intersection of normal)" + + "from waypoint A to survey line" + ), + "example": 178.2, + }, + "longitude_A": { + "type": "number", + "format": "float", + "description": ( + "Longitude of point A(intersection of normal)" + + "from waypoint A to survey line" + ), + "example": -10.122, + }, + "latitude_B": { + "type": "number", + "format": "float", + "description": ( + "Latitude of point B(intersection of normal)" + + "from waypoint B to survey line" + ), + "example": 178.2, + }, + "longitude_B": { + "type": "number", + "format": "float", + "description": ( + "Longitude of point B(intersection of normal)" + + "from waypoint B to survey line" + ), + "example": -10.122, + }, + "latitude_C": { + "type": "number", + "format": "float", + "description": ( + "Latitude of point C(intersection of normal)" + + "from waypoint C to survey line" + ), + "example": 178.2, + }, + "longitude_C": { + "type": "number", + "format": "float", + "description": ( + "Longitude of point C(intersection of normal)" + + "from waypoint C to survey line" + ), + "example": -10.122, + }, + "latitude_D": { + "type": "number", + "format": "float", + "description": ( + "Latitude of point D(intersection of normal)" + + "from waypoint D to survey line" + ), + "example": 178.2, + }, + "longitude_D": { + "type": "number", + "format": "float", + "description": ( + "Longitude of point D(intersection of normal)" + + "from waypoint D to survey line" + ), + "example": -10.122, + }, + "latitude_E": { + "type": "number", + "format": "float", + "description": ( + "Latitude of point E(intersection of normal)" + + "from waypoint E to survey line" + ), + "example": 178.2, + }, + "longitude_E": { + "type": "number", + "format": "float", + "description": ( + "Longitude of point E(intersection of normal)" + + "from waypoint E to survey line" + ), + "example": -10.122, + }, + "platform_ID": { + "type": "string", + "description": "Unique identifier for this platform", + "example": "ecosub-2", + }, + "track_ID": { + "type": "integer", + "description": "Track number of action(s) currently executed by platform", + "example": 1, + }, + }, + "required": [ + "latitude_A", + "longitude_A", + "latitude_B", + "longitude_B", + "platform_ID", + ], +} diff --git a/formats/survey_encoded.py b/formats/survey_encoded.py new file mode 100644 index 0000000000000000000000000000000000000000..218c8cfc1818ebf07d430d91df1b50ee4eaeb8ce --- /dev/null +++ b/formats/survey_encoded.py @@ -0,0 +1,11 @@ +""" + schema: Survey Message that is encoded sent by platforms + to track progress +""" +from formats.encoded import encoded_schema +from copy import deepcopy + +survey_encoded_schema = deepcopy(encoded_schema) + +survey_encoded_schema["properties"]["message_type"]["enum"] = ["survey_encoded"] +survey_encoded_schema["properties"]["message_type"]["example"] = "survey_encoded" diff --git a/generate_schema_config.py b/generate_schema_config.py index 52fd78655834b32c75115b766d97cb664bde9712..123de907cd461abfb03702e5c6f61f7ff25c5795 100644 --- a/generate_schema_config.py +++ b/generate_schema_config.py @@ -6,7 +6,10 @@ from formats.observation_encoded import observation_encoded_schema from formats.planning_configuration import planning_configuration_schema from formats.platform_status import platform_status_schema from formats.platform_status_encoded import platform_status_encoded_schema +from formats.survey import survey_schema +from formats.survey_encoded import survey_encoded_schema from formats.acknowledgement import acknowledgement_schema +from formats.alert import alert_schema from flasgger import Swagger from flask import Flask @@ -53,6 +56,7 @@ swagger_config = { "discriminator": { "propertyName": "message_type", "mapping": { + "alert": "#/components/schemas/alert", "mission_plan": "#/components/schemas/mission_plan", "mission_plan_encoded": "#/components/schemas/" + "mission_plan_encoded", @@ -65,9 +69,12 @@ swagger_config = { "platform_status_encoded": "#/components/schemas/" + "platform_status_encoded", "acknowledgement": "#/components/schemas/acknowledgement", + "survey": "#/components/schemas/survey", + "survey_encoded": "#/components/schemas/" + "survey_encoded", }, }, "oneOf": [ + {"$ref": "#/components/schemas/alert"}, {"$ref": "#/components/schemas/acknowledgement"}, {"$ref": "#/components/schemas/mission_plan"}, {"$ref": "#/components/schemas/mission_plan_encoded"}, @@ -76,6 +83,8 @@ swagger_config = { {"$ref": "#/components/schemas/planning_configuration"}, {"$ref": "#/components/schemas/platform_status"}, {"$ref": "#/components/schemas/platform_status_encoded"}, + {"$ref": "#/components/schemas/survey"}, + {"$ref": "#/components/schemas/survey_encoded"}, ], }, "header": message_header, @@ -86,7 +95,10 @@ swagger_config = { "planning_configuration": planning_configuration_schema, "platform_status": platform_status_schema, "platform_status_encoded": platform_status_encoded_schema, + "survey": survey_schema, + "survey_encoded": survey_encoded_schema, "acknowledgement": acknowledgement_schema, + "alert": alert_schema, } }, } diff --git a/project/soar/swagger.json b/project/soar/swagger.json index 21820ba31d36ee6e833382f917c4013da6f2c018..008b966e586c38fd30c86114d10215e654add9a4 100644 --- a/project/soar/swagger.json +++ b/project/soar/swagger.json @@ -1,772 +1,974 @@ { - "components":{ - "schemas":{ - "MESSAGE":{ - "description":"Full message definition with message-metadata in `header` and different message type schemas under `payload`", - "properties":{ - "header":{ - "$ref":"#/components/schemas/header" - }, - "payload":{ - "$ref":"#/components/schemas/payload" + "components": { + "schemas": { + "MESSAGE": { + "description": "Full message definition with message-metadata in `header` and different message type schemas under `payload`", + "properties": { + "header": { + "$ref": "#/components/schemas/header" + }, + "payload": { + "$ref": "#/components/schemas/payload" } }, - "required":[ + "required": [ "header", "payload" ], - "type":"object" + "type": "object" }, - "acknowledgement":{ - "properties":{ - "approved":{ - "description":"Human-in-the-loop approval.1 - Plan approved; 0 - Plan Rejected", - "type":"boolean" - }, - "autonomy_engine_plan_ID":{ - "description":"Mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", - "example":1, - "type":"integer" - }, - "message_type":{ - "description":"Type of message", - "enum":[ + "acknowledgement": { + "properties": { + "approved": { + "description": "Human-in-the-loop approval.1 - Plan approved; 0 - Plan Rejected", + "type": "boolean" + }, + "autonomy_engine_plan_ID": { + "description": "Mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", + "example": 1, + "type": "integer" + }, + "message_type": { + "description": "Type of message", + "enum": [ "acknowledgement" ], - "example":"acknowledgement", - "type":"string" + "example": "acknowledgement", + "type": "string" }, - "platform_ID":{ - "description":"Unique identifier for this platform", - "example":"reav-x-1", - "type":"string" + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "reav-x-1", + "type": "string" } }, - "required":[ + "required": [ "message_type", "autonomy_engine_plan_ID", "platform_ID", "approved" ], - "type":"object" + "type": "object" }, - "header":{ - "discriminator":{ - "propertyName":"message_type" + "alert": { + "properties": { + "code": { + "description": "Alert code", + "example": 345, + "type": "integer" + }, + "details": { + "description": "Detailed reason for the alert ", + "example": "Discrepancy between rudder and actuator positions : Rudder Pos=10.31\u00b0, Steering Actuator Pos=28.65\u00b0, Discrepancy=18.33\u00b0", + "type": "string" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "alert" + ], + "example": "alert", + "type": "string" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "usvdecibel", + "type": "string" + }, + "platform_timestamp": { + "description": "Timestamp for onboard platform status message", + "example": "2022-12-21T00:00:00Z", + "format": "date-time", + "type": "string" + }, + "severity": { + "description": "Severity level of alert", + "enum": [ + "Emergency", + "Alarm", + "Warning", + "Caution" + ], + "example": "Alarm", + "type": "string" + }, + "subsystem": { + "description": "System that generated the alert", + "example": "Onboard Fault Monitor", + "type": "string" + }, + "summary": { + "description": "High level description of the alert", + "example": "Steering Damage - Port Side", + "type": "string" + } }, - "properties":{ - "delivery_type":{ - "default":"publish", - "description":"To publish or broadcast this message.", - "enum":[ + "required": [ + "message_type", + "platform_ID", + "code", + "severity" + ], + "type": "object" + }, + "header": { + "discriminator": { + "propertyName": "message_type" + }, + "properties": { + "delivery_type": { + "default": "publish", + "description": "To publish or broadcast this message.", + "enum": [ "broadcast", "publish" ], - "example":"publish", - "type":"string" - }, - "destination":{ - "description":"Publisher topic; What is the destination of this message", - "example":"ah1", - "type":"string" - }, - "encoded":{ - "description":"Indicate that message raw (encoded) or decoded. Options: encoded=True, decoded=False", - "example":false, - "type":"boolean" - }, - "message_ID":{ - "description":"An identifier for the type of message received.", - "example":"b427003c-0000-11aa-a1eb-bvcdfghjgfdd", - "type":"string" - }, - "source":{ - "description":"The sender; Where is this message from", - "example":"autonomy_engine", - "type":"string" - }, - "timestamp":{ - "description":"Timestamp of message", - "example":"2022-11-16T00:00:00Z", - "format":"date-time", - "type":"string" - }, - "version":{ - "description":"Version of comms backbone message format protocol", - "example":2.0, - "format":"float", - "type":"number" + "example": "publish", + "type": "string" + }, + "destination": { + "description": "Publisher topic; What is the destination of this message", + "example": "ah1", + "type": "string" + }, + "encoded": { + "description": "Indicate that message raw (encoded) or decoded. Options: encoded=true, decoded=false", + "example": false, + "type": "boolean" + }, + "message_ID": { + "description": "An identifier for the type of message received.", + "example": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", + "type": "string" + }, + "source": { + "description": "The sender; Where is this message from", + "example": "autonomy_engine", + "type": "string" + }, + "timestamp": { + "description": "Timestamp of message", + "example": "2022-11-16T00:00:00Z", + "format": "date-time", + "type": "string" + }, + "version": { + "description": "Version of comms backbone message format protocol", + "example": 2.0, + "format": "float", + "type": "number" } }, - "type":"object" + "type": "object" }, - "mission_plan":{ - "properties":{ - "autonomy_engine_plan_ID":{ - "description":"Unique identifier for this plangenerated by the Autonomy Engine", - "example":3, - "type":"integer" - }, - "message_type":{ - "description":"Type of message", - "enum":[ + "mission_plan": { + "properties": { + "autonomy_engine_plan_ID": { + "description": "Unique identifier for this plangenerated by the Autonomy Engine", + "example": 3, + "type": "integer" + }, + "emergency": { + "default": false, + "description": "To indicate if this is an emergency. true = emergency and false = no emergency", + "example": false, + "type": "boolean" + }, + "message_type": { + "description": "Type of message", + "enum": [ "mission_plan" ], - "example":"mission_plan", - "type":"string" - }, - "plan":{ - "items":{ - "properties":{ - "action":{ - "description":"Autonomy Engine's action from `move`, `payload`, `dive`, `send_hits`, `scanline`, `scanpoint`.", - "example":"move", - "type":"string" + "example": "mission_plan", + "type": "string" + }, + "plan": { + "items": { + "properties": { + "action": { + "description": "Autonomy Engine's action from `move`, `payload`, `dive`, `send_hits`, `scanline`, `scanpoint`.", + "enum": [ + "move", + "payload", + "dive", + "send_hits", + "scanline", + "scanpoint", + "go_home", + "surface_now", + "stop_mission", + "abort_now" + ], + "example": "move", + "type": "string" }, - "activate_payload":{ - "description":"To activate/deactivate sensor for Autosub Hover-1 --> `MBES` sensor and for EcoSUB --> `Sidescan`", - "example":true, - "type":"boolean" + "activate_payload": { + "description": "To activate/deactivate sensor for Autosub Hover-1 --> `MBES` sensor and for EcoSUB --> `Sidescan`", + "example": true, + "type": "boolean" }, - "altitude":{ - "description":"Altitude of next action", - "example":15.0, - "format":"float", - "type":"number" + "altitude": { + "description": "Altitude of next action", + "example": 15.0, + "format": "float", + "type": "number" }, - "depth":{ - "description":"Depth of next action", - "example":15.0, - "format":"float", - "type":"number" + "depth": { + "description": "Depth of next action", + "example": 15.0, + "format": "float", + "type": "number" }, - "start_point_latitude":{ - "description":"Start point, x-coordinate", - "example":-4.187143188645706, - "format":"float", - "type":"number" + "start_point_latitude": { + "description": "Start point, y-coordinate", + "example": 50.37072283932642, + "format": "float", + "type": "number" }, - "start_point_longitude":{ - "description":"Start point, y-coordinate", - "example":50.37072283932642, - "format":"float", - "type":"number" + "start_point_longitude": { + "description": "Start point, x-coordinate", + "example": -4.187143188645706, + "format": "float", + "type": "number" }, - "target_waypoint_latitude":{ - "description":"Target waypoint, x-coordinate", - "example":-4.187143188645706, - "format":"float", - "type":"number" + "target_waypoint_latitude": { + "description": "Target waypoint, y-coordinate", + "example": 50.37072283932642, + "format": "float", + "type": "number" }, - "target_waypoint_longitude":{ - "description":"Target waypoint, y-coordinate", - "example":50.37072283932642, - "format":"float", - "type":"number" + "target_waypoint_longitude": { + "description": "Target waypoint, x-coordinate", + "example": -4.187143188645706, + "format": "float", + "type": "number" }, - "timeout":{ - "description":"Timeout set to perform action", - "example":1800.0, - "format":"float", - "type":"number" + "timeout": { + "description": "Timeout set to perform action", + "example": 1800.0, + "format": "float", + "type": "number" } }, - "required":[ + "required": [ "target_waypoint_latitude", "target_waypoint_longitude" ], - "type":"object" + "type": "object" }, - "type":"array" + "type": "array" }, - "platform_ID":{ - "description":"Unique identifier for this platform", - "example":"reav-x-1", - "type":"string" + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "reav-x-1", + "type": "string" } }, - "required":[ + "required": [ "message_type", "autonomy_engine_plan_ID", "platform_ID", "plan" ], - "type":"object" + "type": "object" }, - "mission_plan_encoded":{ - "properties":{ - "data":{ - "description":"encoded string. E.g. Base64 encoded", - "example":"SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", - "type":"string" - }, - "file_name":{ - "description":"Name of file", - "example":"ah1-0238126349247372.bin", - "type":"string" - }, - "is_binary":{ - "description":"True if the data field contains binary format data encoded as base64. False if the data field contains ascii content such as NMEA.", - "example":true, - "type":"boolean" - }, - "message_type":{ - "description":"Type of message", - "enum":[ + "mission_plan_encoded": { + "properties": { + "data": { + "description": "encoded string. E.g. Base64 encoded", + "example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type": "string" + }, + "file_name": { + "description": "Name of file", + "example": "ah1-0238126349247372.bin", + "type": "string" + }, + "is_binary": { + "description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", + "example": true, + "type": "boolean" + }, + "message_type": { + "description": "Type of message", + "enum": [ "mission_plan_encoded" ], - "example":"mission_plan_encoded", - "type":"string" + "example": "mission_plan_encoded", + "type": "string" }, - "mime_type":{ - "description":"MIME type", - "example":"application/gzip", - "type":"string" + "mime_type": { + "description": "MIME type", + "example": "application/gzip", + "type": "string" } }, - "required":[ + "required": [ "data", "is_binary" ], - "type":"object" + "type": "object" }, - "observation":{ - "properties":{ - "additional_data":{ - "description":"Placeholder field for any additional data", - "example":{ - "sensor_payload":false + "observation": { + "properties": { + "additional_data": { + "description": "Placeholder field for any additional data", + "example": { + "sensor_payload": false } }, - "message_type":{ - "description":"Type of message", - "enum":[ + "message_type": { + "description": "Type of message", + "enum": [ "observation" ], - "example":"observation", - "type":"string" - }, - "platform_ID":{ - "description":"Unique identifier for this platform", - "example":"reav-x-1", - "type":"string" - }, - "points_of_interest":{ - "description":"Points from features of interest identified by platform if any found.", - "items":{ - "properties":{ - "latitude":{ - "description":"Identified x-coordinate of point of interest", - "example":178.2, - "format":"float", - "type":"number" + "example": "observation", + "type": "string" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "reav-x-1", + "type": "string" + }, + "points_of_interest": { + "description": "Points from features of interest identified by platform if any found.", + "items": { + "properties": { + "latitude": { + "description": "Identified y-coordinate of point of interest", + "example": 178.2, + "format": "float", + "type": "number" }, - "longitude":{ - "description":"Identified y-coordinate of point of interest", - "example":-10.122, - "format":"float", - "type":"number" + "longitude": { + "description": "Identified x-coordinate of point of interest", + "example": -10.122, + "format": "float", + "type": "number" }, - "quality_of_point":{ - "description":"Quality/strength of points from features of interest identified by platform.", - "example":0.98, - "format":"float", - "type":"number" + "quality_of_point": { + "description": "Quality/strength of points from features of interest identified by platform.", + "example": 0.98, + "format": "float", + "type": "number" } }, - "required":[ + "required": [ "latitude", "longitude" ], - "type":"object" + "type": "object" }, - "type":"array" + "type": "array" }, - "region_surveyed":{ - "description":"Region surveyed by given platform. GEOJSON", - "example":"", - "nullable":true + "region_surveyed": { + "description": "Region surveyed by given platform. GEOJSON", + "example": "", + "nullable": true } }, - "required":[ + "required": [ "message_type", "platform_ID" ], - "type":"object" + "type": "object" }, - "observation_encoded":{ - "properties":{ - "data":{ - "description":"encoded string. E.g. Base64 encoded", - "example":"SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", - "type":"string" - }, - "file_name":{ - "description":"Name of file", - "example":"ah1-0238126349247372.bin", - "type":"string" - }, - "is_binary":{ - "description":"True if the data field contains binary format data encoded as base64. False if the data field contains ascii content such as NMEA.", - "example":true, - "type":"boolean" - }, - "message_type":{ - "description":"Type of message", - "enum":[ + "observation_encoded": { + "properties": { + "data": { + "description": "encoded string. E.g. Base64 encoded", + "example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type": "string" + }, + "file_name": { + "description": "Name of file", + "example": "ah1-0238126349247372.bin", + "type": "string" + }, + "is_binary": { + "description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", + "example": true, + "type": "boolean" + }, + "message_type": { + "description": "Type of message", + "enum": [ "observation_encoded" ], - "example":"observation_encoded", - "type":"string" + "example": "observation_encoded", + "type": "string" }, - "mime_type":{ - "description":"MIME type", - "example":"application/gzip", - "type":"string" + "mime_type": { + "description": "MIME type", + "example": "application/gzip", + "type": "string" } }, - "required":[ + "required": [ "data", "is_binary" ], - "type":"object" + "type": "object" }, - "payload":{ - "discriminator":{ - "mapping":{ - "acknowledgement":"#/components/schemas/acknowledgement", - "mission_plan":"#/components/schemas/mission_plan", - "mission_plan_encoded":"#/components/schemas/mission_plan_encoded", - "observation":"#/components/schemas/observation", - "observation_encoded":"#/components/schemas/observation_encoded", - "planning_configuration":"#/components/schemas/planning_configuration", - "platform_status":"#/components/schemas/platform_status", - "platform_status_encoded":"#/components/schemas/platform_status_encoded" - }, - "propertyName":"message_type" + "payload": { + "discriminator": { + "mapping": { + "acknowledgement": "#/components/schemas/acknowledgement", + "alert": "#/components/schemas/alert", + "mission_plan": "#/components/schemas/mission_plan", + "mission_plan_encoded": "#/components/schemas/mission_plan_encoded", + "observation": "#/components/schemas/observation", + "observation_encoded": "#/components/schemas/observation_encoded", + "planning_configuration": "#/components/schemas/planning_configuration", + "platform_status": "#/components/schemas/platform_status", + "platform_status_encoded": "#/components/schemas/platform_status_encoded", + "survey": "#/components/schemas/survey", + "survey_encoded": "#/components/schemas/survey_encoded" + }, + "propertyName": "message_type" }, - "oneOf":[ + "oneOf": [ { - "$ref":"#/components/schemas/acknowledgement" + "$ref": "#/components/schemas/alert" }, { - "$ref":"#/components/schemas/mission_plan" + "$ref": "#/components/schemas/acknowledgement" }, { - "$ref":"#/components/schemas/mission_plan_encoded" + "$ref": "#/components/schemas/mission_plan" }, { - "$ref":"#/components/schemas/observation" + "$ref": "#/components/schemas/mission_plan_encoded" }, { - "$ref":"#/components/schemas/observation_encoded" + "$ref": "#/components/schemas/observation" }, { - "$ref":"#/components/schemas/planning_configuration" + "$ref": "#/components/schemas/observation_encoded" }, { - "$ref":"#/components/schemas/platform_status" + "$ref": "#/components/schemas/planning_configuration" }, { - "$ref":"#/components/schemas/platform_status_encoded" + "$ref": "#/components/schemas/platform_status" + }, + { + "$ref": "#/components/schemas/platform_status_encoded" + }, + { + "$ref": "#/components/schemas/survey" + }, + { + "$ref": "#/components/schemas/survey_encoded" } ] }, - "planning_configuration":{ - "properties":{ - "exclusion_zones":{ - "description":"Exclusion zones for all platforms", - "items":{ - "description":"Using GEOJSON, exact 4-point region (rectangle shaped)", - "properties":{ - "geometry_coordinates":{ - "example":[ + "planning_configuration": { + "properties": { + "exclusion_zones": { + "description": "Exclusion zones for all platforms", + "items": { + "description": "Using GEOJSON, exact 4-point region (rectangle shaped - 5 points)", + "properties": { + "geometry_coordinates": { + "example": [ [ [ - -4.187143188645706, - 50.37072283932642 + -4.1777839187560915, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.33820949229701 ], [ - -4.202697005964865, - 50.368816892405874 + -4.143667777943875, + 50.33820949229701 ], [ - -4.203156724702808, - 50.365640144076906 + -4.143667777943875, + 50.34173405662855 ], [ - -4.19449868846155, - 50.362267670845654 + -4.1777839187560915, + 50.34173405662855 ] ] ], - "type":"array" + "type": "array" } }, - "type":"object" + "type": "object" }, - "type":"array" + "type": "array" }, - "message_type":{ - "description":"Type of message", - "enum":[ + "message_type": { + "description": "Type of message", + "enum": [ "planning_configuration" ], - "example":"planning_configuration", - "type":"string" - }, - "planning_config_ID":{ - "description":"Unique identifier tagged to version of this configuration plan", - "example":3, - "type":"integer" - }, - "squads":{ - "items":{ - "properties":{ - "no_of_platforms":{ - "description":"Number of platforms", - "example":3, - "type":"integer" + "example": "planning_configuration", + "type": "string" + }, + "planning_config_ID": { + "description": "Unique identifier tagged to version of this configuration plan", + "example": 3, + "type": "integer" + }, + "region_of_interest": { + "description": "Region of interest for the entire operation", + "items": { + "description": "Using GEOJSON, exact 4-point region (rectangle shaped - 5 points)", + "properties": { + "geometry_coordinates": { + "example": [ + [ + [ + -4.1777839187560915, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 + ] + ] + ], + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "squads": { + "items": { + "properties": { + "no_of_platforms": { + "description": "Number of platforms", + "example": 3, + "type": "integer" }, - "platforms":{ - "description":"Squad consists of these platforms", - "items":{ - "properties":{ - "additional_data":{ - "description":"Any addition fields/data to be added here", - "example":{ - "scan_type":"DVL", - "swath_width":10.0 + "platforms": { + "description": "Squad consists of these platforms", + "items": { + "properties": { + "active": { + "description": "If platform is active = True, and inactive = False", + "example": true, + "type": "boolean" + }, + "additional_data": { + "description": "Any addition fields/data to be added here", + "example": { + "new_sensor_a": "test_sensor", + "range": 10.0 }, - "type":"object" + "type": "object" }, - "emergency":{ - "properties":{ - "additional_data":{ - "type": "object", - "description":"Any addition fields/data to be added here", - "example":{ - - } - }, - "safe_command":{ - "description":"Command/Action that is native to respective partner's platform/C2", - "enum":[ + "beacon_ID": { + "description": "Unique identifier (number) for the beacon associated to this platform", + "example": 2407, + "type": "number" + }, + "emergency": { + "properties": { + "safe_command": { + "description": "Command/Action that is native to respective partner's platform/C2", + "enum": [ "go_home", "abort_now", - "stop_mission" + "stop_now", + "surface_now" ], - "example":"go_home", - "type":"string" + "example": "go_home", + "type": "string" }, - "target_depth":{ - "description":"Z-coordinate safe place for respective platform . If platform to NOT stay at depth, key in `0.0`", - "example":10.0, - "format":"float", - "type":"number" + "target_depth": { + "description": "Z-coordinate safe place for respective platform . If platform to NOT stay at depth, key in `0.0`", + "example": 10.0, + "format": "float", + "type": "number" }, - "target_waypoint_latitude":{ - "description":"X-coordinate safe place for respective platform", - "example":-7.432, - "format":"float", - "type":"number" + "target_waypoint_latitude": { + "description": "Y-coordinate safe place for respective platform", + "example": 50.365, + "format": "float", + "type": "number" }, - "target_waypoint_longitude":{ - "description":"Y-coordinate safe place for respective platform", - "example":50.365, - "format":"float", - "type":"number" + "target_waypoint_longitude": { + "description": "X-coordinate safe place for respective platform", + "example": -7.432, + "format": "float", + "type": "number" } }, - "required":[ + "required": [ "target_waypoint_latitude", "target_waypoint_longitude", "target_depth" ], - "type":"object" + "type": "object" + }, + "endurance_relative_to_water_speed": { + "properties": { + "avg_battery_rating": { + "description": "Battery endurance rating during standard operational speed usage (m/s)", + "example": 1.9, + "format": "float", + "type": "number" + }, + "max_battery_rating": { + "description": "Battery endurance rating during maximum speed usage (m/s)", + "example": 1.23, + "format": "float", + "type": "number" + }, + "min_battery_rating": { + "description": "Battery endurance rating during maximum speed usage (m/s)", + "example": 3.32, + "format": "float", + "type": "number" + } + }, + "type": "object" + }, + "max_velocity": { + "description": "Maximum velocity set for platform", + "example": 0.9, + "format": "float", + "type": "number" }, - "max_velocity":{ - "description":"Maximum altitude set for squad.", - "example":0.9, - "format":"float", - "type":"number" + "min_altitude": { + "description": "Minimum altitude set for platform", + "example": 15.2, + "format": "float", + "type": "number" }, - "min_altitude":{ - "description":"Minimum altitude set for squad.", - "example":15.2, - "format":"float", - "type":"number" + "min_velocity": { + "description": "Minimum velocity set for platform", + "example": 0.1, + "format": "float", + "type": "number" }, - "min_velocity":{ - "description":"Minimum velocity set for squad.", - "example":0.1, - "format":"float", - "type":"number" + "model": { + "example": "reav", + "type": "string" }, - "model":{ - "example":"reav", - "type":"string" + "operator": { + "description": "Operator of platform", + "example": "noc", + "type": "string" }, - "platform_ID":{ - "description":"Unique identifier for this platform", - "example":"reav-x-1", - "type":"string" + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "reav-x-1", + "type": "string" + }, + "scan_sensor": { + "properties": { + "angle": { + "description": "Angle of range of swath width (in degrees)", + "example": 140.0, + "format": "float", + "type": "number" + }, + "frequency": { + "description": "Frequency of scanning sensor (in kHz)", + "example": 700.0, + "format": "float", + "type": "number" + }, + "sensor_type": { + "description": "Unique identifier for this platform", + "enum": [ + "SIDESCAN", + "MBES" + ], + "example": "MBES", + "type": "string" + }, + "swath_width": { + "description": "Function of `target_altitude` for the platform's swath width (in metres)", + "example": 38.0, + "format": "float", + "type": "number" + }, + "warmup_time": { + "description": "Warmup time (seconds) for sensor to start up.", + "example": 180.0, + "format": "float", + "type": "number" + } + }, + "type": "object" + }, + "target_altitude": { + "description": "Target altitude set for platform. This affects swath width", + "example": 15.0, + "format": "float", + "type": "number" + }, + "turning_radius": { + "description": "Turning radius of platform (in metres)", + "example": 1.0, + "format": "float", + "type": "number" } }, - "required":[ + "required": [ + "operator", "platform_ID", - "model", - "emergency", - "min_altitude", - "min_velocity", - "max_velocity" + "active", + "model" ], - "type":"object" + "type": "object" }, - "type":"array" + "type": "array" }, - "region_of_interest":{ - "description":"Using GEOJSON, exact 4-point region (rectangle shaped)", - "properties":{ - "geometry_coordinates":{ - "example":[ - [ - [ - -4.187143188645706, - 50.37072283932642 - ], - [ - -4.202697005964865, - 50.368816892405874 - ], - [ - -4.203156724702808, - 50.365640144076906 - ], - [ - -4.19449868846155, - 50.362267670845654 - ] - ] - ], - "type":"array" - } - }, - "type":"object" + "squad_ID": { + "description": "Identifier of given squad", + "example": 23, + "type": "integer" }, - "squad_ID":{ - "description":"Identifier of given squad", - "example":23, - "type":"integer" - }, - "squad_mission_type":{ - "description":"Mission of given squad: `tracking`, `survey`, `inspection`", - "enum":[ + "squad_mission_type": { + "description": "Mission of given squad: `tracking`, `survey`, `inspection`", + "enum": [ "tracking", "survey", "inspection" ], - "example":"survey", - "type":"string" - }, - "squad_state":{ - "description":"In execution, Waiting.. <define further>", - "example":false, - "type":"string" + "example": "survey", + "type": "string" } }, - "required":[ + "required": [ "squad_ID", "no_of_platforms", "platforms", - "squad_mission_type", - "squad_state" + "squad_mission_type" ], - "type":"object" + "type": "object" }, - "type":"array" + "type": "array" } }, - "required":[ + "required": [ "message_type", "planning_config_ID", "squads", - "exclusion_zones" + "exclusion_zones", + "region_of_interest" ], - "type":"object" + "type": "object" }, - "platform_status":{ - "properties":{ - "altitude":{ - "description":"Target altitude in metres", - "example":20.0, - "format":"float", - "type":"number" - }, - "autonomy_engine_plan_ID":{ - "description":"Last mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", - "example":1, - "type":"integer" - }, - "battery_remaining_capacity":{ - "description":"Battery remaining % provided by respective C2", - "example":80.2, - "format":"float", - "type":"number" - }, - "depth":{ - "default":0.0, - "description":"Target depth in metres", - "example":50.0, - "format":"float", - "type":"number" - }, - "heading":{ - "description":"Angular distance relative to north, usually 000\u00b0 at north, clockwise through 359\u00b0, in degrees", - "example":124.3, - "format":"float", - "type":"number" - }, - "health_status":{ - "description":"Health status where 0 is OK, 1 is platform has an ERROR", - "example":false, - "type":"boolean" - }, - "latitude":{ - "description":"Latitude in decimal degrees.", - "example":178.2, - "format":"float", - "type":"number" - }, - "localisation_east_error":{ - "description":"Difference in EAST between deadreckoningand USBL update.", - "example":0.000129, - "format":"float", - "type":"number" - }, - "localisation_north_error":{ - "description":"Difference in NORTH between deadreckoning and USBL update.", - "example":0.000129, - "format":"float", - "type":"number" - }, - "longitude":{ - "description":"Longitude in decimal degrees.", - "example":-10.122, - "format":"float", - "type":"number" - }, - "message_type":{ - "description":"Type of message", - "enum":[ + "platform_status": { + "properties": { + "altitude": { + "description": "Target altitude in metres", + "example": 20.0, + "format": "float", + "type": "number" + }, + "autonomy_engine_plan_ID": { + "description": "Last mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", + "example": 1, + "type": "integer" + }, + "battery_output": { + "description": "Battery output in kW", + "example": 80.2, + "format": "float", + "type": "number" + }, + "battery_remaining_capacity": { + "description": "Battery remaining % provided by respective C2", + "example": 80.2, + "format": "float", + "type": "number" + }, + "depth": { + "default": 0.0, + "description": "Target depth in metres", + "example": 50.0, + "format": "float", + "type": "number" + }, + "endurance": { + "description": "Estimate of hours of operation remaining based on present output or performance", + "example": 7.4, + "format": "float", + "type": "number" + }, + "fuel_remaining_capacity": { + "description": "Percentage remaining capacity", + "example": 80.2, + "format": "float", + "type": "number" + }, + "fuel_volume": { + "description": "Litres of liquid fuel", + "example": 12.5, + "format": "float", + "type": "number" + }, + "heading": { + "description": "Angular distance relative to north, usually 000\u00b0 at north, clockwise through 359\u00b0, in degrees", + "example": 124.3, + "format": "float", + "type": "number" + }, + "health_status": { + "description": "Health status where 0 is OK, 1 is platform has an ERROR", + "example": false, + "type": "boolean" + }, + "latitude": { + "description": "Latitude (Y-coordinate) in decimal degrees.", + "example": 178.2, + "format": "float", + "type": "number" + }, + "localisation_east_error": { + "description": "Difference in EAST between deadreckoningand USBL update.", + "example": 0.000129, + "format": "float", + "type": "number" + }, + "localisation_north_error": { + "description": "Difference in NORTH between deadreckoning and USBL update.", + "example": 0.000129, + "format": "float", + "type": "number" + }, + "longitude": { + "description": "Longitude (X-coordinate) in decimal degrees.", + "example": -10.122, + "format": "float", + "type": "number" + }, + "message_type": { + "description": "Type of message", + "enum": [ "platform_status" ], - "example":"platform_status", - "type":"string" - }, - "mission_plan_ID":{ - "description":"Mission plan ID according to platform-C2 system", - "example":1, - "type":"integer" - }, - "mission_track_ID":{ - "description":"Track number - stage in mission (e.g. 4 --> Waypoint 3 to Waypoint 4)", - "example":4, - "type":"integer" - }, - "platform_ID":{ - "description":"Unique identifier for this platform", - "example":"reav-x-1", - "type":"string" - }, - "platform_state":{ - "description":"Current state executed by platform. E.g. STOP, IDLE, ABORT.", - "example":"ABORT", - "type":"string" - }, - "platform_timestamp":{ - "description":"Timestamp for onboard platform status message", - "example":"2022-12-21T00:00:00Z", - "format":"date-time", - "type":"string" - }, - "range_to_go":{ - "description":"Estimated distance to reach next waypoint", - "example":124.3, - "format":"float", - "type":"number" - }, - "sensor_config":{ - "description":"Scanning sensor on platform available to be controlled by the Autonomy Engine", - "properties":{ - "additional_data":{ - "description":"Any addition fields/data to be added here", - "example":{ - "payload":[ + "example": "platform_status", + "type": "string" + }, + "mission_plan_ID": { + "description": "Mission plan ID according to platform-C2 system", + "example": 1, + "type": "integer" + }, + "mission_track_ID": { + "description": "Track number - stage in mission (e.g. 4 --> Waypoint 3 to Waypoint 4)", + "example": 4, + "type": "integer" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "reav-x-1", + "type": "string" + }, + "platform_state": { + "description": "Current state executed by platform. E.g. STOP, IDLE, ABORT.", + "example": "ABORT", + "type": "string" + }, + "platform_timestamp": { + "description": "Timestamp for onboard platform status message", + "example": "2022-12-21T00:00:00Z", + "format": "date-time", + "type": "string" + }, + "range_to_go": { + "description": "Estimated distance to reach next waypoint", + "example": 124.3, + "format": "float", + "type": "number" + }, + "sensor_config": { + "description": "Scanning sensor on platform available to be controlled by the Autonomy Engine", + "properties": { + "additional_data": { + "description": "Any addition fields/data to be added here", + "example": { + "payload": [ 1.2, 434 ] }, - "type":"object" + "type": "object" }, - "sensor_on":{ - "description":"Sensor switched on (True) or off (False)", - "example":true, - "type":"boolean" + "sensor_on": { + "description": "Sensor switched on (true) or off (false)", + "example": true, + "type": "boolean" }, - "sensor_serial":{ - "description":"serial number of sensor", - "example":"mbes-002a", - "type":"string" + "sensor_serial": { + "description": "serial number of sensor", + "example": "mbes-002a", + "type": "string" } }, - "type":"object" + "type": "object" }, - "speed_over_ground":{ - "description":"Speed over ground", - "example":124.3, - "format":"float", - "type":"number" + "speed_over_ground": { + "description": "Speed over ground", + "example": 124.3, + "format": "float", + "type": "number" }, - "status_source":{ - "description":"Indicate if this status message is from the platform or USBL", - "enum":[ + "status_source": { + "description": "Indicate if this status message is from the platform or USBL", + "enum": [ "usbl", "onboard_platform" ], - "example":"usbl", - "type":"string" - }, - "thrust_applied":{ - "description":"Thrust applied", - "example":124.3, - "format":"float", - "type":"number" - }, - "transmission_mode":{ - "description":"Mode in which status message was transmitted when on the surface (e.g. iridium/wifi) or underwater (e.g. acoustics)", - "enum":[ + "example": "usbl", + "type": "string" + }, + "thrust_applied": { + "description": "Thrust applied", + "example": 124.3, + "format": "float", + "type": "number" + }, + "transmission_mode": { + "description": "Mode in which status message was transmitted when on the surface (e.g. iridium/wifi) or underwater (e.g. acoustics)", + "enum": [ "acoustics", "iridium", "wifi", "starlink" ], - "example":"wifi", - "type":"string" - }, - "usbl_fix_seconds_ago":{ - "description":"USBL Fix received x second ago.", - "example":10.0, - "format":"float", - "type":"number" - }, - "water_current_velocity":{ - "description":"Water current magnitude and direction", - "example":"124.3NE", - "type":"string" + "example": "wifi", + "type": "string" + }, + "usbl_fix_seconds_ago": { + "description": "USBL Fix received x second ago.", + "example": 10.0, + "format": "float", + "type": "number" + }, + "water_current_velocity": { + "description": "Water current magnitude and direction", + "example": "124.3NE", + "type": "string" } }, - "required":[ + "required": [ "message_type", "platform_ID", "status_source", @@ -774,54 +976,185 @@ "latitude", "longitude" ], - "type":"object" + "type": "object" }, - "platform_status_encoded":{ - "properties":{ - "data":{ - "description":"encoded string. E.g. Base64 encoded", - "example":"SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", - "type":"string" - }, - "file_name":{ - "description":"Name of file", - "example":"ah1-0238126349247372.bin", - "type":"string" - }, - "is_binary":{ - "description":"True if the data field contains binary format data encoded as base64. False if the data field contains ascii content such as NMEA.", - "example":true, - "type":"boolean" - }, - "message_type":{ - "description":"Type of message", - "enum":[ + "platform_status_encoded": { + "properties": { + "data": { + "description": "encoded string. E.g. Base64 encoded", + "example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type": "string" + }, + "file_name": { + "description": "Name of file", + "example": "ah1-0238126349247372.bin", + "type": "string" + }, + "is_binary": { + "description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", + "example": true, + "type": "boolean" + }, + "message_type": { + "description": "Type of message", + "enum": [ "platform_status_encoded" ], - "example":"platform_status_encoded", - "type":"string" + "example": "platform_status_encoded", + "type": "string" + }, + "mime_type": { + "description": "MIME type", + "example": "application/gzip", + "type": "string" + } + }, + "required": [ + "data", + "is_binary" + ], + "type": "object" + }, + "survey": { + "properties": { + "latitude_A": { + "description": "Latitude of point A(intersection of normal)from waypoint A to survey line", + "example": 178.2, + "format": "float", + "type": "number" + }, + "latitude_B": { + "description": "Latitude of point B(intersection of normal)from waypoint B to survey line", + "example": 178.2, + "format": "float", + "type": "number" + }, + "latitude_C": { + "description": "Latitude of point C(intersection of normal)from waypoint C to survey line", + "example": 178.2, + "format": "float", + "type": "number" + }, + "latitude_D": { + "description": "Latitude of point D(intersection of normal)from waypoint D to survey line", + "example": 178.2, + "format": "float", + "type": "number" + }, + "latitude_E": { + "description": "Latitude of point E(intersection of normal)from waypoint E to survey line", + "example": 178.2, + "format": "float", + "type": "number" + }, + "longitude_A": { + "description": "Longitude of point A(intersection of normal)from waypoint A to survey line", + "example": -10.122, + "format": "float", + "type": "number" + }, + "longitude_B": { + "description": "Longitude of point B(intersection of normal)from waypoint B to survey line", + "example": -10.122, + "format": "float", + "type": "number" + }, + "longitude_C": { + "description": "Longitude of point C(intersection of normal)from waypoint C to survey line", + "example": -10.122, + "format": "float", + "type": "number" + }, + "longitude_D": { + "description": "Longitude of point D(intersection of normal)from waypoint D to survey line", + "example": -10.122, + "format": "float", + "type": "number" + }, + "longitude_E": { + "description": "Longitude of point E(intersection of normal)from waypoint E to survey line", + "example": -10.122, + "format": "float", + "type": "number" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "survey" + ], + "example": "survey", + "type": "string" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "ecosub-2", + "type": "string" + }, + "timestamp": { + "description": "Timestamp for onboard message", + "example": "2022-12-21T00:00:00Z", + "format": "date-time", + "type": "string" + }, + "track_ID": { + "description": "Track number of action(s) currently executed by platform", + "example": 1, + "type": "integer" + } + }, + "required": [ + "latitude_A", + "longitude_A", + "latitude_B", + "longitude_B", + "platform_ID" + ], + "type": "object" + }, + "survey_encoded": { + "properties": { + "data": { + "description": "encoded string. E.g. Base64 encoded", + "example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type": "string" + }, + "file_name": { + "description": "Name of file", + "example": "ah1-0238126349247372.bin", + "type": "string" + }, + "is_binary": { + "description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", + "example": true, + "type": "boolean" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "survey_encoded" + ], + "example": "survey_encoded", + "type": "string" }, - "mime_type":{ - "description":"MIME type", - "example":"application/gzip", - "type":"string" + "mime_type": { + "description": "MIME type", + "example": "application/gzip", + "type": "string" } }, - "required":[ + "required": [ "data", "is_binary" ], - "type":"object" + "type": "object" } } }, "info":{ "description":"SoAR message protocol in schemas", "title":"SoAR Backbone Message Formats", - "version":"1.0" + "version":"0.2" }, - "openapi":"3.0.2", - "paths":{ - - } + "openapi": "3.0.2", + "paths": {} } \ No newline at end of file diff --git a/setup.py b/setup.py index 89b507e33b21ac851f7fa76e65e422df0beff55a..172035dfc7b61d5e5f071d9f9269d0b2b839507a 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( - version="0.1.0", + version="0.2.0", name="backbone_message_format", python_requires=">=3.8", packages=["backbone_formats", "soar_schema"], diff --git a/tests-js/soar-examples.test.js b/tests-js/soar-examples.test.js index bfced46fedb212c916e5363f7680f33813e4c137..22abf84943060b2f7d3e63235e8ce7fb0cf91dd7 100644 --- a/tests-js/soar-examples.test.js +++ b/tests-js/soar-examples.test.js @@ -11,6 +11,9 @@ const validateSchema = (schema) => { const validator = new OpenAPISchemaValidator({ version: 3 }); let validation = validator.validate(schema); validation.valid = (validation.errors.length === 0); + if (!validation.valid) { + console.log('errors', validation.errors); + } return validation; }; diff --git a/tests/fixtures/schemas.py b/tests/fixtures/schemas.py index dcc6ac34602bbfcfbb73ac284e7202bae6fb3b9c..33f724e6848a6c175f0be7975dd066bfc0cf8027 100644 --- a/tests/fixtures/schemas.py +++ b/tests/fixtures/schemas.py @@ -35,7 +35,7 @@ message_header = { "encoded": { "type": "boolean", "description": "Indicate that message raw (encoded) or decoded. " - + "Options: encoded=True, decoded=False", + + "Options: encoded=true, decoded=false", "example": False, }, "delivery_type": { @@ -165,6 +165,13 @@ mission_plan_schema = { "description": "Unique identifier for this platform", "example": "reav-x-1", }, + "emergency": { + "default": False, + "description": "To indicate if this is an emergency. " + + "true = emergency and false = no emergency", + "example": False, + "type": "boolean", + }, "plan": { "type": "array", "items": action_schema, @@ -243,7 +250,7 @@ emergency_schema = { "properties": { "safe_command": { "type": "string", - "enum": ["go_home", "abort_now", "stop_mission"], + "enum": ["go_home", "abort_now", "stop_now", "surface_now"], "description": "Command/Action that is native to respective" + " partner's platform/C2", "example": "go_home", @@ -252,13 +259,13 @@ emergency_schema = { "type": "number", "format": "float", "description": "X-coordinate safe place for respective platform", - "example": -7.432, + "example": 50.365, }, "target_waypoint_longitude": { "type": "number", "format": "float", "description": "Y-coordinate safe place for respective platform", - "example": 50.365, + "example": -7.432, }, "target_depth": { "type": "number", @@ -308,7 +315,7 @@ platform_schema = { "max_velocity": { "type": "number", "format": "float", - "description": "Maximum altitude set for squad.", + "description": "Maximum velocity set for squad.", "example": 0.9, }, "additional_data": { @@ -430,7 +437,7 @@ sensor_schema = { }, "sensor_on": { "type": "boolean", - "description": "Sensor switched on (True) or off (False)", + "description": "Sensor switched on (true) or off (false)", "example": True, }, "additional_data": { @@ -447,6 +454,7 @@ platform_status_schema = { "type": "string", "description": "Type of message", "example": "platform_status", + "enum": ["platform_status"], }, "platform_ID": { "type": "string", @@ -479,7 +487,7 @@ platform_status_schema = { "description": "Current state executed by platform. E.g. " + "STOP, IDLE, ABORT.", "example": "ABORT", - }, + }, # TODO: Define enum with potential STATES of each platform "autonomy_engine_plan_ID": { "type": "integer", "description": "Last mission plan ID (according to Autonomy" @@ -489,13 +497,13 @@ platform_status_schema = { "latitude": { "type": "number", "format": "float", - "description": "Latitude in decimal degrees.", + "description": "Latitude (Y-coordinate) in decimal degrees.", "example": 178.2, }, "longitude": { "type": "number", "format": "float", - "description": "Longitude in decimal degrees.", + "description": "Longitude (X-coordinate) in decimal degrees.", "example": -10.122, }, "depth": { @@ -509,7 +517,7 @@ platform_status_schema = { "type": "number", "format": "float", "description": "Target altitude in metres", - "example": 20, + "example": 20.0, }, "mission_track_ID": { "type": "integer", @@ -535,7 +543,7 @@ platform_status_schema = { "example": 124.3, }, "water_current_velocity": { - "format": "string", + "type": "string", "description": "Water current magnitude and direction", "example": "124.3NE", }, @@ -554,8 +562,8 @@ platform_status_schema = { }, "health_status": { "type": "boolean", - "description": "Health status where 0 is OK, 1 is platform" - + " has an ERROR", + "description": "Health status where 0 is OK, 1 is platform has" + + " an ERROR", "example": False, }, "localisation_north_error": { @@ -569,7 +577,7 @@ platform_status_schema = { "type": "number", "format": "float", "description": "Difference in EAST between deadreckoning" - + " and USBL update.", + + "and USBL update.", "example": 0.000129, }, "usbl_fix_seconds_ago": { @@ -584,6 +592,37 @@ platform_status_schema = { "description": "Battery remaining % provided by respective C2", "example": 80.2, }, + # Battery power (kw / float) + "battery_output": { # changed from battery_power + "type": "number", + "format": "float", + "description": "Battery output in kW", + "example": 80.2, + }, + # Bunkers remaining capacity (litres, float) + # Bunkers percentage full (percentage, float) + # battery_remaining_capacity is % full if we want both these fields + # these names are going to cause confusion + "fuel_remaining_capacity": { + "type": "number", + "format": "float", + "description": "Percentage remaining capacity", + "example": 80.2, + }, + "fuel_volume": { + "type": "number", + "format": "float", + "description": "Litres of liquid fuel", + "example": 12.5, + }, + # Endurance (hours, float) + "endurance": { + "type": "number", + "format": "float", + "description": "Estimate of hours of operation remaining " + + "based on present output or performance", + "example": 7.4, + }, "sensor_config": sensor_schema, }, "required": [ @@ -595,3 +634,59 @@ platform_status_schema = { "longitude", ], } + +alert_schema = { + "type": "object", + "properties": { + "message_type": { + "type": "string", + "description": "Type of message", + "example": "alert", + "enum": ["alert"], + }, + "code": { # changed from alert_ID because reasons + "type": "integer", + "description": "Alert code", + "example": 345, + }, + "platform_ID": { + "type": "string", + "description": "Unique identifier for this platform", + "example": "usvdecibel", + }, + "platform_timestamp": { + "type": "string", + "format": "date-time", + "description": "Timestamp for onboard platform status message", + "example": "2022-12-21T00:00:00Z", + }, + "subsystem": { # changed from suggested "source" could be device / subsystem or something + "type": "string", + "description": "System that generated the alert", + "example": "Onboard Fault Monitor", + }, + "summary": { + "type": "string", + "description": "High level description of the alert", + "example": "Steering Damage - Port Side", + }, + "details": { + "type": "string", + "description": "Detailed reason for the alert ", + "example": "Discrepancy between rudder and actuator positions" + + " : Rudder Pos=10.31°, Steering Actuator Pos=28.65°, Discrepancy=18.33°", + }, + "severity": { + "type": "string", + "description": "Severity level of alert", + "example": "Alarm", + "enum": ["Emergency", "Alarm", "Warning", "Caution"], + }, + }, + "required": [ + "message_type", + "platform_ID", + "code", + "severity", + ], +} diff --git a/tests/fixtures/swagger.json b/tests/fixtures/swagger.json index a1db4bff435b9686156a7372002b2bb7823302bb..fe7ffe6e39906186ce2208756da5750c8d6e90b3 100644 --- a/tests/fixtures/swagger.json +++ b/tests/fixtures/swagger.json @@ -1,663 +1,1159 @@ { "components": { - "schemas": { - "MESSAGE": { - "description": "Full message definition with message-metadata in `header` and different message type schemas under `payload`", - "properties": { - "header": { - "$ref": "#/components/schemas/header" - }, - "payload": { - "$ref": "#/components/schemas/payload" - } - }, - "required": [ - "header", - "payload" - ], - "type": "object" - }, - "acknowledgement": { - "properties": { - "approved": { - "type": "boolean", - "description": "Human-in-the-loop approval. 1 - Plan approved; 0 - Plan Rejected", - "example": 1 - }, - "autonomy_engine_plan_ID": { - "type": "integer", - "description": "Mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", - "example": 1 - }, - "message_type": { - "description": "Type of message", - "type": "string", - "example": "acknowledgement" - }, - "platform_ID": { - "type": "string", - "description": "Unique identifier for this platform", - "example": "reav-x-1" - } + "schemas": { + "MESSAGE": { + "description": "Full message definition with message-metadata in `header` and different message type schemas under `payload`", + "properties": { + "header": { + "$ref": "#/components/schemas/header" + }, + "payload": { + "$ref": "#/components/schemas/payload" + } + }, + "required": [ + "header", + "payload" + ], + "type": "object" }, - "required": [ - "message_type", - "autonomy_engine_plan_ID", - "platform_ID", - "approved" - ], - "type": "object" - }, - "header": { - "discriminator": { - "propertyName": "message_type" + "acknowledgement": { + "properties": { + "approved": { + "description": "Human-in-the-loop approval.1 - Plan approved; 0 - Plan Rejected", + "type": "boolean" + }, + "autonomy_engine_plan_ID": { + "description": "Mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", + "example": 1, + "type": "integer" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "acknowledgement" + ], + "example": "acknowledgement", + "type": "string" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "reav-x-1", + "type": "string" + } + }, + "required": [ + "message_type", + "autonomy_engine_plan_ID", + "platform_ID", + "approved" + ], + "type": "object" }, - "properties": { - "delivery_type": { - "default": "publish", - "description": "To publish or broadcast this message.", - "enum": [ - "broadcast", - "publish" - ], - "example": "publish", - "type": "string" - }, - "destination": { - "description": "Publisher topic; What is the destination of this message", - "example": "ah1", - "type": "string" - }, - "encoded": { - "description": "Indicate that message raw (encoded) or decoded. Options: encoded=True, decoded=False", - "example": false, - "type": "boolean" - }, - "message_ID": { - "description": "An identifier for the type of message received.", - "example": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", - "type": "string" - }, - "source": { - "description": "The sender; Where is this message from", - "example": "autonomy_engine", - "type": "string" - }, - "timestamp": { - "description": "Timestamp of message", - "example": "2022-11-16T00:00:00Z", - "format": "date-time", - "type": "string" - }, - "version": { - "description": "Version of comms backbone message format protocol", - "example": 2.0, - "format": "float", - "type": "number" - } + "alert": { + "properties": { + "code": { + "description": "Alert code", + "example": 345, + "type": "integer" + }, + "details": { + "description": "Detailed reason for the alert ", + "example": "Discrepancy between rudder and actuator positions : Rudder Pos=10.31\u00b0, Steering Actuator Pos=28.65\u00b0, Discrepancy=18.33\u00b0", + "type": "string" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "alert" + ], + "example": "alert", + "type": "string" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "usvdecibel", + "type": "string" + }, + "platform_timestamp": { + "description": "Timestamp for onboard platform status message", + "example": "2022-12-21T00:00:00Z", + "format": "date-time", + "type": "string" + }, + "severity": { + "description": "Severity level of alert", + "enum": [ + "Emergency", + "Alarm", + "Warning", + "Caution" + ], + "example": "Alarm", + "type": "string" + }, + "subsystem": { + "description": "System that generated the alert", + "example": "Onboard Fault Monitor", + "type": "string" + }, + "summary": { + "description": "High level description of the alert", + "example": "Steering Damage - Port Side", + "type": "string" + } + }, + "required": [ + "message_type", + "platform_ID", + "code", + "severity" + ], + "type": "object" }, - "type": "object" - }, - "mission_plan": { - "properties": { - "autonomy_engine_plan_ID": { - "description": "Unique identifier for this plangenerated by the Autonomy Engine", - "example": 3, - "type": "integer" - }, - "message_type": { - "description": "Type of message", - "example": "mission_plan", - "type": "string" - }, - "plan": { - "items": { - "properties": { - "action": { - "description": "Autonomy Engine's action from `move`, `payload`, `dive`, `send_hits`, `scanline`, `scanpoint`.", - "example": "move", - "type": "string" - }, - "activate_payload": { - "description": "To activate/deactivate sensor for Autosub Hover-1 --> `MBES` sensor and for EcoSUB --> `Sidescan`", - "example": true, - "type": "boolean" - }, - "timeout": { - "description": "Timeout set to perform action", - "example": 1800.0, - "format": "float", - "type": "number" - }, - "altitude": { - "description": "Altitude of next action", - "example": 15.0, - "format": "float", - "type": "number" - }, - "depth": { - "description": "Depth of next action", - "example": 15.0, - "format": "float", - "type": "number" - }, - "target_waypoint_latitude": { - "description": "Next waypoint, x-coordinate", - "example": -4.187143188645706, - "format": "float", - "type": "number" - }, - "target_waypoint_longitude": { - "description": "Next waypoint, y-coordinate", - "example": 50.37072283932642, - "format": "float", - "type": "number" - } - }, - "required": [ - "target_waypoint_latitude", - "target_waypoint_longitude" - ], - "type": "object" - }, - "type": "array" - }, - "platform_ID": { - "description": "Unique identifier for this platform", - "example": "reav-x-1", - "type": "string" - } + "header": { + "discriminator": { + "propertyName": "message_type" + }, + "properties": { + "delivery_type": { + "default": "publish", + "description": "To publish or broadcast this message.", + "enum": [ + "broadcast", + "publish" + ], + "example": "publish", + "type": "string" + }, + "destination": { + "description": "Publisher topic; What is the destination of this message", + "example": "ah1", + "type": "string" + }, + "encoded": { + "description": "Indicate that message raw (encoded) or decoded. Options: encoded=true, decoded=false", + "example": false, + "type": "boolean" + }, + "message_ID": { + "description": "An identifier for the type of message received.", + "example": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", + "type": "string" + }, + "source": { + "description": "The sender; Where is this message from", + "example": "autonomy_engine", + "type": "string" + }, + "timestamp": { + "description": "Timestamp of message", + "example": "2022-11-16T00:00:00Z", + "format": "date-time", + "type": "string" + }, + "version": { + "description": "Version of comms backbone message format protocol", + "example": 2.0, + "format": "float", + "type": "number" + } + }, + "type": "object" }, - "required": [ - "message_type", - "autonomy_engine_plan_ID", - "platform_ID", - "plan" - ], - "type": "object" - }, - "observation": { - "properties": { - "additional_data": { - "description": "Placeholder field for any additional data", - "example": { - "sensor_payload": false - } - }, - "message_type": { - "description": "Type of message", - "example": "observation", - "type": "string" - }, - "platform_ID": { - "description": "Unique identifier for this platform", - "example": "reav-x-1", - "type": "string" - }, - "points_of_interest": { - "description": "Points from features of interest identified by platform if any found.", - "items": { - "properties": { - "latitude": { - "description": "Identified x-coordinate of point of interest", - "example": 178.2, - "format": "float", - "type": "number" - }, - "longitude": { - "description": "Identified y-coordinate of point of interest", - "example": -10.122, - "format": "float", - "type": "number" - }, - "quality_of_point": { - "description": "Quality/strength of points from features of interest identified by platform.", - "example": 0.98, - "format": "float", - "type": "number" - } - }, - "required": [ - "latitude", - "longitude" - ], - "type": "object" - }, - "type": "array" - }, - "region_surveyed": { - "description": "Region surveyed by given platform. GEOJSON", - "example": "" - } + "mission_plan": { + "properties": { + "autonomy_engine_plan_ID": { + "description": "Unique identifier for this plangenerated by the Autonomy Engine", + "example": 3, + "type": "integer" + }, + "emergency": { + "default": false, + "description": "To indicate if this is an emergency. true = emergency and false = no emergency", + "example": false, + "type": "boolean" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "mission_plan" + ], + "example": "mission_plan", + "type": "string" + }, + "plan": { + "items": { + "properties": { + "action": { + "description": "Autonomy Engine's action from `move`, `payload`, `dive`, `send_hits`, `scanline`, `scanpoint`.", + "enum": [ + "move", + "payload", + "dive", + "send_hits", + "scanline", + "scanpoint", + "go_home", + "surface_now", + "stop_mission", + "abort_now" + ], + "example": "move", + "type": "string" + }, + "activate_payload": { + "description": "To activate/deactivate sensor for Autosub Hover-1 --> `MBES` sensor and for EcoSUB --> `Sidescan`", + "example": true, + "type": "boolean" + }, + "altitude": { + "description": "Altitude of next action", + "example": 15.0, + "format": "float", + "type": "number" + }, + "depth": { + "description": "Depth of next action", + "example": 15.0, + "format": "float", + "type": "number" + }, + "start_point_latitude": { + "description": "Start point, y-coordinate", + "example": 50.37072283932642, + "format": "float", + "type": "number" + }, + "start_point_longitude": { + "description": "Start point, x-coordinate", + "example": -4.187143188645706, + "format": "float", + "type": "number" + }, + "target_waypoint_latitude": { + "description": "Target waypoint, y-coordinate", + "example": 50.37072283932642, + "format": "float", + "type": "number" + }, + "target_waypoint_longitude": { + "description": "Target waypoint, x-coordinate", + "example": -4.187143188645706, + "format": "float", + "type": "number" + }, + "timeout": { + "description": "Timeout set to perform action", + "example": 1800.0, + "format": "float", + "type": "number" + } + }, + "required": [ + "target_waypoint_latitude", + "target_waypoint_longitude" + ], + "type": "object" + }, + "type": "array" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "reav-x-1", + "type": "string" + } + }, + "required": [ + "message_type", + "autonomy_engine_plan_ID", + "platform_ID", + "plan" + ], + "type": "object" }, - "required": [ - "message_type", - "platform_ID" - ], - "type": "object" - }, - "payload": { - "discriminator": { - "mapping": { - "acknowledgement": "#/components/schemas/acknowledgement", - "mission_plan": "#/components/schemas/mission_plan", - "observation": "#/components/schemas/observation", - "planning_configuration": "#/components/schemas/planning_configuration", - "platform_status": "#/components/schemas/platform_status" - }, - "propertyName": "message_type" + "mission_plan_encoded": { + "properties": { + "data": { + "description": "encoded string. E.g. Base64 encoded", + "example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type": "string" + }, + "file_name": { + "description": "Name of file", + "example": "ah1-0238126349247372.bin", + "type": "string" + }, + "is_binary": { + "description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", + "example": true, + "type": "boolean" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "mission_plan_encoded" + ], + "example": "mission_plan_encoded", + "type": "string" + }, + "mime_type": { + "description": "MIME type", + "example": "application/gzip", + "type": "string" + } + }, + "required": [ + "data", + "is_binary" + ], + "type": "object" }, - "oneOf": [ - { - "$ref": "#/components/schemas/acknowledgement" - }, - { - "$ref": "#/components/schemas/mission_plan" - }, - { - "$ref": "#/components/schemas/observation" - }, - { - "$ref": "#/components/schemas/planning_configuration" - }, - { - "$ref": "#/components/schemas/platform_status" - } - ] - }, - "planning_configuration": { - "properties": { - "exclusion_zones": { - "description": "Exclusion zones for all platforms", - "items": { - "description": "Using GEOJSON, exact 4-point region (rectangle shaped)", - "properties": { - "geometry_coordinates": { - "example": [ - [ - [ - -4.187143188645706, - 50.37072283932642 - ], - [ - -4.202697005964865, - 50.368816892405874 - ], - [ - -4.203156724702808, - 50.365640144076906 - ], - [ - -4.19449868846155, - 50.362267670845654 - ] - ] - ], - "type": "array" - } - }, - "type": "object" - }, - "type": "array" - }, - "message_type": { - "description": "Type of message", - "example": "planning_configuration", - "type": "string" - }, - "planning_config_ID": { - "description": "Unique identifier tagged to version of this configuration plan", - "example": 3, - "type": "integer" - }, - "squads": { - "items": { - "properties": { - "no_of_platforms": { - "description": "Number of platforms", - "example": 3, - "type": "integer" - }, - "platforms": { - "description": "Squad consists of these platforms", - "items": { + "observation": { + "properties": { + "additional_data": { + "description": "Placeholder field for any additional data", + "example": { + "sensor_payload": false + } + }, + "message_type": { + "description": "Type of message", + "enum": [ + "observation" + ], + "example": "observation", + "type": "string" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "reav-x-1", + "type": "string" + }, + "points_of_interest": { + "description": "Points from features of interest identified by platform if any found.", + "items": { "properties": { - "additional_data": { - "description": "Any addition fields/data to be added here", - "example": { - "scan_type": "DVL", - "swath_width": 10.0 - } - }, - "emergency": { - "properties": { - "additional_data": { - "description": "Any addition fields/data to be added here", - "example": {} - }, - "target_waypoint_latitude": { - "description": "X-coordinate safe place for respective platform", - "example": -7.432, - "format": "float", - "type": "number" - }, - "target_waypoint_longitude": { - "description": "Y-coordinate safe place for respective platform", - "example": 50.365, - "format": "float", - "type": "number" - }, - "safe_command": { - "description": "Command/Action that is native to respective partner's platform/C2", - "enum": [ - "go_home", - "abort_now", - "stop_mission" - ], - "example": "go_home", - "type": "string" - }, - "target_depth": { - "description": "Z-coordinate safe place for respective platform . If platform to NOT stay at depth, key in `0.0`", - "example": 10.0, - "format": "float", - "type": "number" - } - }, - "required": [ - "target_waypoint_latitude", - "target_waypoint_longitude", - "target_depth" - ], - "type": "object" - }, - "max_velocity": { - "description": "Maximum altitude set for squad.", - "example": 0.9, - "format": "float", - "type": "number" - }, - "min_altitude": { - "description": "Minimum altitude set for squad.", - "example": 15.2, - "format": "float", - "type": "number" - }, - "min_velocity": { - "description": "Minimum velocity set for squad.", - "example": 0.1, - "format": "float", - "type": "number" - }, - "model": { - "example": "reav", - "type": "string" - }, - "platform_ID": { - "description": "Unique identifier for this platform", - "example": "reav-x-1", - "type": "string" - } + "latitude": { + "description": "Identified y-coordinate of point of interest", + "example": 178.2, + "format": "float", + "type": "number" + }, + "longitude": { + "description": "Identified x-coordinate of point of interest", + "example": -10.122, + "format": "float", + "type": "number" + }, + "quality_of_point": { + "description": "Quality/strength of points from features of interest identified by platform.", + "example": 0.98, + "format": "float", + "type": "number" + } }, "required": [ - "platform_ID", - "model", - "emergency", - "min_altitude", - "min_velocity", - "max_velocity" + "latitude", + "longitude" ], "type": "object" - }, - "type": "array" - }, - "region_of_interest": { - "description": "Using GEOJSON, exact 4-point region (rectangle shaped)", - "properties": { - "geometry_coordinates": { - "example": [ - [ - [ - -4.187143188645706, - 50.37072283932642 + }, + "type": "array" + }, + "region_surveyed": { + "description": "Region surveyed by given platform. GEOJSON", + "example": "", + "nullable": true + } + }, + "required": [ + "message_type", + "platform_ID" + ], + "type": "object" + }, + "observation_encoded": { + "properties": { + "data": { + "description": "encoded string. E.g. Base64 encoded", + "example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type": "string" + }, + "file_name": { + "description": "Name of file", + "example": "ah1-0238126349247372.bin", + "type": "string" + }, + "is_binary": { + "description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", + "example": true, + "type": "boolean" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "observation_encoded" + ], + "example": "observation_encoded", + "type": "string" + }, + "mime_type": { + "description": "MIME type", + "example": "application/gzip", + "type": "string" + } + }, + "required": [ + "data", + "is_binary" + ], + "type": "object" + }, + "payload": { + "discriminator": { + "mapping": { + "acknowledgement": "#/components/schemas/acknowledgement", + "alert": "#/components/schemas/alert", + "mission_plan": "#/components/schemas/mission_plan", + "mission_plan_encoded": "#/components/schemas/mission_plan_encoded", + "observation": "#/components/schemas/observation", + "observation_encoded": "#/components/schemas/observation_encoded", + "planning_configuration": "#/components/schemas/planning_configuration", + "platform_status": "#/components/schemas/platform_status", + "platform_status_encoded": "#/components/schemas/platform_status_encoded", + "survey": "#/components/schemas/survey", + "survey_encoded": "#/components/schemas/survey_encoded" + }, + "propertyName": "message_type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/alert" + }, + { + "$ref": "#/components/schemas/acknowledgement" + }, + { + "$ref": "#/components/schemas/mission_plan" + }, + { + "$ref": "#/components/schemas/mission_plan_encoded" + }, + { + "$ref": "#/components/schemas/observation" + }, + { + "$ref": "#/components/schemas/observation_encoded" + }, + { + "$ref": "#/components/schemas/planning_configuration" + }, + { + "$ref": "#/components/schemas/platform_status" + }, + { + "$ref": "#/components/schemas/platform_status_encoded" + }, + { + "$ref": "#/components/schemas/survey" + }, + { + "$ref": "#/components/schemas/survey_encoded" + } + ] + }, + "planning_configuration": { + "properties": { + "exclusion_zones": { + "description": "Exclusion zones for all platforms", + "items": { + "description": "Using GEOJSON, exact 4-point region (rectangle shaped - 5 points)", + "properties": { + "geometry_coordinates": { + "example": [ + [ + [ + -4.1777839187560915, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 + ] + ] ], - [ - -4.202697005964865, - 50.368816892405874 + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "planning_configuration" + ], + "example": "planning_configuration", + "type": "string" + }, + "planning_config_ID": { + "description": "Unique identifier tagged to version of this configuration plan", + "example": 3, + "type": "integer" + }, + "region_of_interest": { + "description": "Region of interest for the entire operation", + "items": { + "description": "Using GEOJSON, exact 4-point region (rectangle shaped - 5 points)", + "properties": { + "geometry_coordinates": { + "example": [ + [ + [ + -4.1777839187560915, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 + ] + ] ], - [ - -4.203156724702808, - 50.365640144076906 + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "squads": { + "items": { + "properties": { + "no_of_platforms": { + "description": "Number of platforms", + "example": 3, + "type": "integer" + }, + "platforms": { + "description": "Squad consists of these platforms", + "items": { + "properties": { + "active": { + "description": "If platform is active = True, and inactive = False", + "example": true, + "type": "boolean" + }, + "additional_data": { + "description": "Any addition fields/data to be added here", + "example": { + "new_sensor_a": "test_sensor", + "range": 10.0 + }, + "type": "object" + }, + "beacon_ID": { + "description": "Unique identifier (number) for the beacon associated to this platform", + "example": 2407, + "type": "number" + }, + "emergency": { + "properties": { + "safe_command": { + "description": "Command/Action that is native to respective partner's platform/C2", + "enum": [ + "go_home", + "abort_now", + "stop_now", + "surface_now" + ], + "example": "go_home", + "type": "string" + }, + "target_depth": { + "description": "Z-coordinate safe place for respective platform . If platform to NOT stay at depth, key in `0.0`", + "example": 10.0, + "format": "float", + "type": "number" + }, + "target_waypoint_latitude": { + "description": "Y-coordinate safe place for respective platform", + "example": 50.365, + "format": "float", + "type": "number" + }, + "target_waypoint_longitude": { + "description": "X-coordinate safe place for respective platform", + "example": -7.432, + "format": "float", + "type": "number" + } + }, + "required": [ + "target_waypoint_latitude", + "target_waypoint_longitude", + "target_depth" + ], + "type": "object" + }, + "endurance_relative_to_water_speed": { + "properties": { + "avg_battery_rating": { + "description": "Battery endurance rating during standard operational speed usage (m/s)", + "example": 1.9, + "format": "float", + "type": "number" + }, + "max_battery_rating": { + "description": "Battery endurance rating during maximum speed usage (m/s)", + "example": 1.23, + "format": "float", + "type": "number" + }, + "min_battery_rating": { + "description": "Battery endurance rating during maximum speed usage (m/s)", + "example": 3.32, + "format": "float", + "type": "number" + } + }, + "type": "object" + }, + "max_velocity": { + "description": "Maximum velocity set for platform", + "example": 0.9, + "format": "float", + "type": "number" + }, + "min_altitude": { + "description": "Minimum altitude set for platform", + "example": 15.2, + "format": "float", + "type": "number" + }, + "min_velocity": { + "description": "Minimum velocity set for platform", + "example": 0.1, + "format": "float", + "type": "number" + }, + "model": { + "example": "reav", + "type": "string" + }, + "operator": { + "description": "Operator of platform", + "example": "noc", + "type": "string" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "reav-x-1", + "type": "string" + }, + "scan_sensor": { + "properties": { + "angle": { + "description": "Angle of range of swath width (in degrees)", + "example": 140.0, + "format": "float", + "type": "number" + }, + "frequency": { + "description": "Frequency of scanning sensor (in kHz)", + "example": 700.0, + "format": "float", + "type": "number" + }, + "sensor_type": { + "description": "Unique identifier for this platform", + "enum": [ + "SIDESCAN", + "MBES" + ], + "example": "MBES", + "type": "string" + }, + "swath_width": { + "description": "Function of `target_altitude` for the platform's swath width (in metres)", + "example": 38.0, + "format": "float", + "type": "number" + }, + "warmup_time": { + "description": "Warmup time (seconds) for sensor to start up.", + "example": 180.0, + "format": "float", + "type": "number" + } + }, + "type": "object" + }, + "target_altitude": { + "description": "Target altitude set for platform. This affects swath width", + "example": 15.0, + "format": "float", + "type": "number" + }, + "turning_radius": { + "description": "Turning radius of platform (in metres)", + "example": 1.0, + "format": "float", + "type": "number" + } + }, + "required": [ + "operator", + "platform_ID", + "active", + "model" + ], + "type": "object" + }, + "type": "array" + }, + "squad_ID": { + "description": "Identifier of given squad", + "example": 23, + "type": "integer" + }, + "squad_mission_type": { + "description": "Mission of given squad: `tracking`, `survey`, `inspection`", + "enum": [ + "tracking", + "survey", + "inspection" ], - [ - -4.19449868846155, - 50.362267670845654 + "example": "survey", + "type": "string" + } + }, + "required": [ + "squad_ID", + "no_of_platforms", + "platforms", + "squad_mission_type" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "message_type", + "planning_config_ID", + "squads", + "exclusion_zones", + "region_of_interest" + ], + "type": "object" + }, + "platform_status": { + "properties": { + "altitude": { + "description": "Target altitude in metres", + "example": 20.0, + "format": "float", + "type": "number" + }, + "autonomy_engine_plan_ID": { + "description": "Last mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", + "example": 1, + "type": "integer" + }, + "battery_output": { + "description": "Battery output in kW", + "example": 80.2, + "format": "float", + "type": "number" + }, + "battery_remaining_capacity": { + "description": "Battery remaining % provided by respective C2", + "example": 80.2, + "format": "float", + "type": "number" + }, + "depth": { + "default": 0.0, + "description": "Target depth in metres", + "example": 50.0, + "format": "float", + "type": "number" + }, + "endurance": { + "description": "Estimate of hours of operation remaining based on present output or performance", + "example": 7.4, + "format": "float", + "type": "number" + }, + "fuel_remaining_capacity": { + "description": "Percentage remaining capacity", + "example": 80.2, + "format": "float", + "type": "number" + }, + "fuel_volume": { + "description": "Litres of liquid fuel", + "example": 12.5, + "format": "float", + "type": "number" + }, + "heading": { + "description": "Angular distance relative to north, usually 000\u00b0 at north, clockwise through 359\u00b0, in degrees", + "example": 124.3, + "format": "float", + "type": "number" + }, + "health_status": { + "description": "Health status where 0 is OK, 1 is platform has an ERROR", + "example": false, + "type": "boolean" + }, + "latitude": { + "description": "Latitude (Y-coordinate) in decimal degrees.", + "example": 178.2, + "format": "float", + "type": "number" + }, + "localisation_east_error": { + "description": "Difference in EAST between deadreckoningand USBL update.", + "example": 0.000129, + "format": "float", + "type": "number" + }, + "localisation_north_error": { + "description": "Difference in NORTH between deadreckoning and USBL update.", + "example": 0.000129, + "format": "float", + "type": "number" + }, + "longitude": { + "description": "Longitude (X-coordinate) in decimal degrees.", + "example": -10.122, + "format": "float", + "type": "number" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "platform_status" + ], + "example": "platform_status", + "type": "string" + }, + "mission_plan_ID": { + "description": "Mission plan ID according to platform-C2 system", + "example": 1, + "type": "integer" + }, + "mission_track_ID": { + "description": "Track number - stage in mission (e.g. 4 --> Waypoint 3 to Waypoint 4)", + "example": 4, + "type": "integer" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "reav-x-1", + "type": "string" + }, + "platform_state": { + "description": "Current state executed by platform. E.g. STOP, IDLE, ABORT.", + "example": "ABORT", + "type": "string" + }, + "platform_timestamp": { + "description": "Timestamp for onboard platform status message", + "example": "2022-12-21T00:00:00Z", + "format": "date-time", + "type": "string" + }, + "range_to_go": { + "description": "Estimated distance to reach next waypoint", + "example": 124.3, + "format": "float", + "type": "number" + }, + "sensor_config": { + "description": "Scanning sensor on platform available to be controlled by the Autonomy Engine", + "properties": { + "additional_data": { + "description": "Any addition fields/data to be added here", + "example": { + "payload": [ + 1.2, + 434 ] - ] - ], - "type": "array" + }, + "type": "object" + }, + "sensor_on": { + "description": "Sensor switched on (true) or off (false)", + "example": true, + "type": "boolean" + }, + "sensor_serial": { + "description": "serial number of sensor", + "example": "mbes-002a", + "type": "string" } - }, - "type": "object" - }, - "squad_ID": { - "description": "Identifier of given squad", - "example": 23, - "type": "integer" - }, - "squad_mission_type": { - "description": "Mission of given squad: `tracking`, `survey`, `inspection`", - "enum": [ - "tracking", - "survey", - "inspection" - ], - "example": "survey", - "type": "string" - }, - "squad_state": { - "description": "In execution, Waiting.. <define further>", - "example": false, - "type": "string" - } - }, - "required": [ - "squad_ID", - "no_of_platforms", - "platforms", - "squad_mission_type", - "squad_state" - ], - "type": "object" - }, - "type": "array" - } + }, + "type": "object" + }, + "speed_over_ground": { + "description": "Speed over ground", + "example": 124.3, + "format": "float", + "type": "number" + }, + "status_source": { + "description": "Indicate if this status message is from the platform or USBL", + "enum": [ + "usbl", + "onboard_platform" + ], + "example": "usbl", + "type": "string" + }, + "thrust_applied": { + "description": "Thrust applied", + "example": 124.3, + "format": "float", + "type": "number" + }, + "transmission_mode": { + "description": "Mode in which status message was transmitted when on the surface (e.g. iridium/wifi) or underwater (e.g. acoustics)", + "enum": [ + "acoustics", + "iridium", + "wifi", + "starlink" + ], + "example": "wifi", + "type": "string" + }, + "usbl_fix_seconds_ago": { + "description": "USBL Fix received x second ago.", + "example": 10.0, + "format": "float", + "type": "number" + }, + "water_current_velocity": { + "description": "Water current magnitude and direction", + "example": "124.3NE", + "type": "string" + } + }, + "required": [ + "message_type", + "platform_ID", + "status_source", + "platform_timestamp", + "latitude", + "longitude" + ], + "type": "object" }, - "required": [ - "message_type", - "planning_config_ID", - "squads", - "exclusion_zones" - ], - "type": "object" - }, - "platform_status": { - "properties": { - "altitude": { - "description": "Target altitude in metres", - "example": 20, - "format": "float", - "type": "number" - }, - "autonomy_engine_plan_ID": { - "description": "Last mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", - "example": 1, - "type": "integer" - }, - "battery_remaining_capacity": { - "description": "Battery remaining % provided by respective C2", - "example": 80.2, - "format": "float", - "type": "number" - }, - "depth": { - "default": 0.0, - "description": "Target depth in metres", - "example": 50.0, - "format": "float", - "type": "number" - }, - "heading": { - "description": "Angular distance relative to north, usually 000\u00b0 at north, clockwise through 359\u00b0, in degrees", - "example": 124.3, - "format": "float", - "type": "number" - }, - "health_status": { - "description": "Health status where 0 is OK, 1 is platform has an ERROR", - "example": false, - "type": "boolean" - }, - "latitude": { - "description": "Latitude in decimal degrees.", - "example": 178.2, - "format": "float", - "type": "number" - }, - "localisation_error": { - "description": "Difference in NORTH between deadreckoning and USBL update.", - "example": 0.000129, - "format": "float", - "type": "number" - }, - "longitude": { - "description": "Longitude in decimal degrees.", - "example": -10.122, - "format": "float", - "type": "number" - }, - "message_type": { - "description": "Type of message", - "example": "platform_status", - "type": "string" - }, - "mission_plan_ID": { - "description": "Mission plan ID according to platform-C2 system", - "example": 1, - "type": "integer" - }, - "mission_track_ID": { - "description": "Track number - stage in mission (e.g. 4 --> Waypoint 3 to Waypoint 4)", - "example": 4, - "type": "integer" - }, - "platform_ID": { - "description": "Unique identifier for this platform", - "example": "reav-x-1", - "type": "string" - }, - "platform_state": { - "description": "Current state executed by platform. E.g. STOP, IDLE, ABORT.", - "example": "ABORT", - "type": "string" - }, - "platform_timestamp": { - "description": "Timestamp for onboard platform status message", - "example": "2022-12-21T00:00:00Z", - "format": "date-time", - "type": "string" - }, - "range_to_go": { - "description": "Estimated distance to reach next waypoint", - "example": 124.3, - "format": "float", - "type": "number" - }, - "sensor_config": { - "description": "Scanning sensor on platform available to be controlled by the Autonomy Engine", - "properties": { - "additional_data": { - "description": "Any addition fields/data to be added here", - "example": { - "payload": [ - 1.2, - 434 - ] - } - }, - "sensor_on": { - "description": "Sensor switched on (True) or off (False)", - "example": true, - "type": "boolean" - }, - "sensor_serial": { - "description": "serial number of sensor", - "example": "mbes-002a", - "type": "string" + "platform_status_encoded": { + "properties": { + "data": { + "description": "encoded string. E.g. Base64 encoded", + "example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type": "string" + }, + "file_name": { + "description": "Name of file", + "example": "ah1-0238126349247372.bin", + "type": "string" + }, + "is_binary": { + "description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", + "example": true, + "type": "boolean" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "platform_status_encoded" + ], + "example": "platform_status_encoded", + "type": "string" + }, + "mime_type": { + "description": "MIME type", + "example": "application/gzip", + "type": "string" } - }, - "type": "object" - }, - "speed_over_ground": { - "description": "Speed over ground", - "example": 124.3, - "format": "float", - "type": "number" - }, - "status_source": { - "description": "Indicate if this status message is from the platform or USBL", - "enum": [ - "usbl", - "onboard_platform" - ], - "example": "usbl", - "type": "string" - }, - "thrust_applied": { - "description": "Thrust applied", - "example": 124.3, - "format": "float", - "type": "number" - }, - "transmission_mode": { - "description": "Mode in which status message was transmitted when on the surface (e.g. iridium/wifi) or underwater (e.g. acoustics)", - "enum": [ - "acoustics", - "iridium", - "wifi", - "starlink" - ], - "example": "wifi", - "type": "string" - }, - "usbl_fix_seconds_ago": { - "description": "USBL Fix received x second ago.", - "example": 10.0, - "format": "float", - "type": "number" - }, - "water_current_velocity": { - "description": "Water current magnitude and direction", - "example": "124.3NE", - "format": "string" - } + }, + "required": [ + "data", + "is_binary" + ], + "type": "object" }, - "required": [ - "message_type", - "platform_ID", - "status_source", - "platform_timestamp", - "latitude", - "longitude" - ], - "type": "object" - } - } + "survey": { + "properties": { + "latitude_A": { + "description": "Latitude of point A(intersection of normal)from waypoint A to survey line", + "example": 178.2, + "format": "float", + "type": "number" + }, + "latitude_B": { + "description": "Latitude of point B(intersection of normal)from waypoint B to survey line", + "example": 178.2, + "format": "float", + "type": "number" + }, + "latitude_C": { + "description": "Latitude of point C(intersection of normal)from waypoint C to survey line", + "example": 178.2, + "format": "float", + "type": "number" + }, + "latitude_D": { + "description": "Latitude of point D(intersection of normal)from waypoint D to survey line", + "example": 178.2, + "format": "float", + "type": "number" + }, + "latitude_E": { + "description": "Latitude of point E(intersection of normal)from waypoint E to survey line", + "example": 178.2, + "format": "float", + "type": "number" + }, + "longitude_A": { + "description": "Longitude of point A(intersection of normal)from waypoint A to survey line", + "example": -10.122, + "format": "float", + "type": "number" + }, + "longitude_B": { + "description": "Longitude of point B(intersection of normal)from waypoint B to survey line", + "example": -10.122, + "format": "float", + "type": "number" + }, + "longitude_C": { + "description": "Longitude of point C(intersection of normal)from waypoint C to survey line", + "example": -10.122, + "format": "float", + "type": "number" + }, + "longitude_D": { + "description": "Longitude of point D(intersection of normal)from waypoint D to survey line", + "example": -10.122, + "format": "float", + "type": "number" + }, + "longitude_E": { + "description": "Longitude of point E(intersection of normal)from waypoint E to survey line", + "example": -10.122, + "format": "float", + "type": "number" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "survey" + ], + "example": "survey", + "type": "string" + }, + "platform_ID": { + "description": "Unique identifier for this platform", + "example": "ecosub-2", + "type": "string" + }, + "timestamp": { + "description": "Timestamp for onboard message", + "example": "2022-12-21T00:00:00Z", + "format": "date-time", + "type": "string" + }, + "track_ID": { + "description": "Track number of action(s) currently executed by platform", + "example": 1, + "type": "integer" + } + }, + "required": [ + "latitude_A", + "longitude_A", + "latitude_B", + "longitude_B", + "platform_ID" + ], + "type": "object" + }, + "survey_encoded": { + "properties": { + "data": { + "description": "encoded string. E.g. Base64 encoded", + "example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type": "string" + }, + "file_name": { + "description": "Name of file", + "example": "ah1-0238126349247372.bin", + "type": "string" + }, + "is_binary": { + "description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", + "example": true, + "type": "boolean" + }, + "message_type": { + "description": "Type of message", + "enum": [ + "survey_encoded" + ], + "example": "survey_encoded", + "type": "string" + }, + "mime_type": { + "description": "MIME type", + "example": "application/gzip", + "type": "string" + } + }, + "required": [ + "data", + "is_binary" + ], + "type": "object" + } + } }, - "info": { - "description": "SoAR message protocol in schemas", - "title": "SoAR Backbone Message Formats", - "version": "1.0" + "info":{ + "description":"SoAR message protocol in schemas", + "title":"SoAR Backbone Message Formats", + "version":"0.2" }, "openapi": "3.0.2", "paths": {}