From 04128aa8bb1a84cc829b3453b71526d43c7ca168 Mon Sep 17 00:00:00 2001 From: Trishna Saeharaseelan <trishna.saeharaseelan@noc.ac.uk> Date: Thu, 16 Mar 2023 15:47:46 +0000 Subject: [PATCH] feat: support binary payload --- .../mission_plan_encoded.json | 17 + .../observation_encoded.json | 17 + .../platform_status_encoded.json | 17 + .../ecosub_adapter/observation_encoded.json | 17 + formats/encoded.py | 45 + generate_schema_config.py | 13 + project/soar/swagger.json | 1521 +++++++++-------- 7 files changed, 956 insertions(+), 691 deletions(-) create mode 100644 examples/autonomy_engine_adapter/mission_plan_encoded.json create mode 100644 examples/autonomy_engine_adapter/observation_encoded.json create mode 100644 examples/autonomy_engine_adapter/platform_status_encoded.json create mode 100644 examples/ecosub_adapter/observation_encoded.json create mode 100644 formats/encoded.py diff --git a/examples/autonomy_engine_adapter/mission_plan_encoded.json b/examples/autonomy_engine_adapter/mission_plan_encoded.json new file mode 100644 index 0000000..e0a213a --- /dev/null +++ b/examples/autonomy_engine_adapter/mission_plan_encoded.json @@ -0,0 +1,17 @@ +{ + "header": { + "message_ID": "t1237003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2023-03-16T00:00:00Z", + "version": 2, + "source": "autonomy_engine", + "destination": "soar.hermes.autosub.alr-52.send.mission_plan_encoded", + "delivery_type": "publish", + "encoded": true + }, + "payload": { + "message_type": "mission_plan_encoded", + "data": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBlB/tRYQW3nez5HWYFBAAD+zwBySUAAAADVek72v1N2lUQAAAABAQAAAAAAAAAAAAAAAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "file_name": "ah1_03837434286438.sbd", + "is_binary": true + } +} diff --git a/examples/autonomy_engine_adapter/observation_encoded.json b/examples/autonomy_engine_adapter/observation_encoded.json new file mode 100644 index 0000000..5305a1f --- /dev/null +++ b/examples/autonomy_engine_adapter/observation_encoded.json @@ -0,0 +1,17 @@ +{ + "header": { + "message_ID": "e1237003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2023-03-16T00:00:00Z", + "version": 2, + "source": "hermes.ecosub2", + "destination": "soar.planet-ocean.ecosub.ecosub-2.receive.observation_encoded", + "delivery_type": "publish", + "encoded": true + }, + "payload": { + "message_type": "observation_encoded", + "data": "T1N2lUQAAAABAQAAAAAAAAAAAAAAAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "file_name": "ecosub1_200002114.txt", + "is_binary": true + } +} diff --git a/examples/autonomy_engine_adapter/platform_status_encoded.json b/examples/autonomy_engine_adapter/platform_status_encoded.json new file mode 100644 index 0000000..52ec489 --- /dev/null +++ b/examples/autonomy_engine_adapter/platform_status_encoded.json @@ -0,0 +1,17 @@ +{ + "header": { + "message_ID": "t1237003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2023-03-16T00:00:00Z", + "version": 2, + "source": "hermes.ah1", + "destination": "soar.noc.autosub.alr-52.receive.platform_status_encoded", + "delivery_type": "publish", + "encoded": true + }, + "payload": { + "message_type": "platform_status_encoded", + "data": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBlB/tRYQW3nez5HWYFBAAD+zwBySUAAAADVek72v1N2lUQAAAABAQAAAAAAAAAAAAAAAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "file_name": "ah1_03837434286438.sbd", + "is_binary": true + } +} diff --git a/examples/ecosub_adapter/observation_encoded.json b/examples/ecosub_adapter/observation_encoded.json new file mode 100644 index 0000000..5305a1f --- /dev/null +++ b/examples/ecosub_adapter/observation_encoded.json @@ -0,0 +1,17 @@ +{ + "header": { + "message_ID": "e1237003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2023-03-16T00:00:00Z", + "version": 2, + "source": "hermes.ecosub2", + "destination": "soar.planet-ocean.ecosub.ecosub-2.receive.observation_encoded", + "delivery_type": "publish", + "encoded": true + }, + "payload": { + "message_type": "observation_encoded", + "data": "T1N2lUQAAAABAQAAAAAAAAAAAAAAAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "file_name": "ecosub1_200002114.txt", + "is_binary": true + } +} diff --git a/formats/encoded.py b/formats/encoded.py new file mode 100644 index 0000000..0b93dbc --- /dev/null +++ b/formats/encoded.py @@ -0,0 +1,45 @@ +""" + schemas: Encoded (compiled) type messages that are applicable to compiled + platform statuses and observations (from the platform), and compiled + mission plans (to the platform). This encoded schema is applicable to the + different message types: mission_plan_encoded, observation_encoded, and + platform_status_encoded. +""" + +encoded_schema = { + "type": "object", + "properties": { + "message_type": { + "type": "string", + "description": "Type of message", + "example": "mission_plan", + "enum": [ + "mission_plan_encoded", + "observation_encoded", + "platform_status_encoded", + ], + }, + "data": { + "type": "string", + "description": "Base64 encoded string", + "example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcB" + + "AAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + }, + "file_name": { + "type": "string", + "description": "Name of file", + "example": "ah1-0238126349247372.bin", + }, + "mime_type": { + "type": "string", + "description": "MIME type", + "example": "", # TODO: Add example + }, + "is_binary": { + "type": "boolean", + "description": "Base64 encrypted binary data", + "example": True, + }, + }, + "required": ["data", "is_binary"], +} diff --git a/generate_schema_config.py b/generate_schema_config.py index 68e3992..51f081f 100644 --- a/generate_schema_config.py +++ b/generate_schema_config.py @@ -1,4 +1,5 @@ from formats import message_header +from formats.encoded import encoded_schema from formats.mission_plan import mission_plan_schema from formats.observation import observation_schema from formats.planning_configuration import planning_configuration_schema @@ -51,26 +52,38 @@ swagger_config = { "propertyName": "message_type", "mapping": { "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", "acknowledgement": "#/components/schemas/acknowledgement", }, }, "oneOf": [ {"$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"}, ], }, "header": message_header, "mission_plan": mission_plan_schema, + "mission_plan_encoded": encoded_schema, "observation": observation_schema, + "observation_encoded": encoded_schema, "planning_configuration": planning_configuration_schema, "platform_status": platform_status_schema, + "platform_status_encoded": encoded_schema, "acknowledgement": acknowledgement_schema, } }, diff --git a/project/soar/swagger.json b/project/soar/swagger.json index e9fc054..d11b8f2 100644 --- a/project/soar/swagger.json +++ b/project/soar/swagger.json @@ -1,693 +1,832 @@ { - "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":{ - "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", - "example":"acknowledgement", - "type":"string", - "enum": ["acknowledgement"] - }, - "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" - }, - "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" - }, - "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", - "enum": ["mission_plan"] - }, - "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" - }, - "start_point_latitude":{ - "description":"Start point, x-coordinate", - "example":-4.187143188645706, - "format":"float", - "type":"number" - }, - "start_point_longitude":{ - "description":"Start point, y-coordinate", - "example":50.37072283932642, - "format":"float", - "type":"number" - }, - "target_waypoint_latitude":{ - "description":"Target waypoint, x-coordinate", - "example":-4.187143188645706, - "format":"float", - "type":"number" - }, - "target_waypoint_longitude":{ - "description":"Target 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" - } - }, - "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", - "enum": ["observation"] - }, - "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":"", - "nullable":true - } - }, - "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" - }, - "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", - "enum": ["planning_configuration"] - }, - "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":{ - "properties":{ - "additional_specs":{ - "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":{ - - }, - "type":"object" - }, - "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" - }, - "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" - } - }, - "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" - } - }, - "required":[ - "platform_ID", - "model", - "emergency", - "min_altitude", - "min_velocity", - "max_velocity" - ], - "type":"object" - }, - "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_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" - } - }, - "required":[ - "message_type", - "planning_config_ID", - "squads", - "exclusion_zones" - ], - "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", - "example":"platform_status", - "type":"string", - "enum": ["platform_status"] - }, - "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" - }, - "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" - }, - "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" - } - } - }, - "info":{ - "description":"SoAR message protocol in schemas", - "title":"SoAR Backbone Message Formats", - "version":"1.0" - }, - "openapi":"3.0.2", - "paths":{ - - } + "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":{ + "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" + }, + "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" + }, + "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" + ], + "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" + }, + "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, x-coordinate", + "example":-4.187143188645706, + "format":"float", + "type":"number" + }, + "start_point_longitude":{ + "description":"Start point, y-coordinate", + "example":50.37072283932642, + "format":"float", + "type":"number" + }, + "target_waypoint_latitude":{ + "description":"Target waypoint, x-coordinate", + "example":-4.187143188645706, + "format":"float", + "type":"number" + }, + "target_waypoint_longitude":{ + "description":"Target waypoint, y-coordinate", + "example":50.37072283932642, + "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" + }, + "mission_plan_encoded":{ + "properties":{ + "data":{ + "description":"Base64 encoded string", + "example":"SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type":"string" + }, + "file_name":{ + "description":"Name of file", + "example":"ah1-0238126349247372.bin", + "type":"string" + }, + "is_binary":{ + "description":"Base64 encrypted binary data", + "example":true, + "type":"boolean" + }, + "message_type":{ + "description":"Type of message", + "enum":[ + "mission_plan_encoded", + "observation_encoded", + "platform_status_encoded" + ], + "example":"mission_plan", + "type":"string" + }, + "mime_type":{ + "description":"MIME type", + "example":"", + "type":"string" + } + }, + "required":[ + "data", + "is_binary" + ], + "type":"object" + }, + "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":{ + "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":"", + "nullable":true + } + }, + "required":[ + "message_type", + "platform_ID" + ], + "type":"object" + }, + "observation_encoded":{ + "properties":{ + "data":{ + "description":"Base64 encoded string", + "example":"SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type":"string" + }, + "file_name":{ + "description":"Name of file", + "example":"ah1-0238126349247372.bin", + "type":"string" + }, + "is_binary":{ + "description":"Base64 encrypted binary data", + "example":true, + "type":"boolean" + }, + "message_type":{ + "description":"Type of message", + "enum":[ + "mission_plan_encoded", + "observation_encoded", + "platform_status_encoded" + ], + "example":"mission_plan", + "type":"string" + }, + "mime_type":{ + "description":"MIME type", + "example":"", + "type":"string" + } + }, + "required":[ + "data", + "is_binary" + ], + "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" + }, + "oneOf":[ + { + "$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" + } + ] + }, + "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", + "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" + }, + "platforms":{ + "description":"Squad consists of these platforms", + "items":{ + "properties":{ + "additional_specs":{ + "description":"Any addition fields/data to be added here", + "example":{ + "scan_type":"DVL", + "swath_width":10.0 + }, + "type":"object" + }, + "emergency":{ + "properties":{ + "additional_data":{ + "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":[ + "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" + }, + "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" + } + }, + "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" + } + }, + "required":[ + "platform_ID", + "model", + "emergency", + "min_altitude", + "min_velocity", + "max_velocity" + ], + "type":"object" + }, + "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_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" + } + }, + "required":[ + "message_type", + "planning_config_ID", + "squads", + "exclusion_zones" + ], + "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" + ], + "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" + }, + "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" + }, + "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" + }, + "platform_status_encoded":{ + "properties":{ + "data":{ + "description":"Base64 encoded string", + "example":"SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", + "type":"string" + }, + "file_name":{ + "description":"Name of file", + "example":"ah1-0238126349247372.bin", + "type":"string" + }, + "is_binary":{ + "description":"Base64 encrypted binary data", + "example":true, + "type":"boolean" + }, + "message_type":{ + "description":"Type of message", + "enum":[ + "mission_plan_encoded", + "observation_encoded", + "platform_status_encoded" + ], + "example":"mission_plan", + "type":"string" + }, + "mime_type":{ + "description":"MIME type", + "example":"", + "type":"string" + } + }, + "required":[ + "data", + "is_binary" + ], + "type":"object" + } + } + }, + "info":{ + "description":"SoAR message protocol in schemas", + "title":"SoAR Backbone Message Formats", + "version":"1.0" + }, + "openapi":"3.0.2", + "paths":{ + + } } \ No newline at end of file -- GitLab