Verified Commit e72ccb17 authored by Dan Jones's avatar Dan Jones
Browse files

refactor: load geojson defs from published schemas

parent badd7a14
...@@ -184,20 +184,11 @@ platform_schema = { ...@@ -184,20 +184,11 @@ platform_schema = {
region_schema = { region_schema = {
"type": "object", "type": "object",
"properties": { "properties": {
"geometry_coordinates": { "geometry": {
"type": "array", "$ref": "https://geojson.org/schema/Polygon.json",
"example": [
[
[-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 - 5 points)", "description": "GeoJSON Polygon",
} }
squad_metadata_schema = { squad_metadata_schema = {
......
...@@ -17,6 +17,8 @@ from flask import Flask ...@@ -17,6 +17,8 @@ from flask import Flask
import argparse import argparse
import json import json
import os import os
import re
import requests
# Enable running on domain sub-path # Enable running on domain sub-path
...@@ -112,6 +114,93 @@ swagger_config = { ...@@ -112,6 +114,93 @@ swagger_config = {
} }
def resolve_ref(ref):
"""
Get schema URL, parse JSON
Return None if either fails
"""
try:
res = requests.get(ref)
if res.status_code == 200:
return res.json()
else:
return None
except (json.JSONDecodeError, ValueError):
return None
def rename_ref(ref):
"""
Convert remote ref URL into a name that can
be used for a local ref in the schema
Remote the URL scheme and replace / with .
"""
# remove url scheme
deschemed = re.sub(r"^[htps]*\:*[/]{2}", "", ref)
# replace / with . since the name will be in a path
return re.sub(r"[/]", ".", deschemed)
def nested_replace(source, key, value, replace_with):
"""
Find all instances of a key value pair in a nested
dictionary and replace the value with replace_with
"""
for k,v in source.items():
if k == key and v == value:
source[k] = replace_with
elif type(v) is list:
for item in v:
if type(item) is dict:
nested_replace(item, key, value, replace_with)
if type(v) is dict:
nested_replace(v, key, value, replace_with)
def inject_schema(schema, remote_ref):
"""
Given a parent schema and a remote ref
1. get the remote ref schema
2. create a local reference name (without path separators)
3. insert into components.schemas
4. replace remote references with local references
returns True if resolved and injected
"""
local_name = rename_ref(remote_ref)
local_ref = f"#/components/schemas/{local_name}"
ref_schema = resolve_ref(remote_ref)
if (ref_schema is not None):
nested_replace(schema, "$ref", remote_ref, local_ref)
schema["components"]["schemas"][local_name] = ref_schema
return True
else:
return False
def import_remote_refs():
"""
inject the following remote refs into the schema
and replace the remote refs with local refs
returns True if all schemas resolved and injected
"""
ref_imports = [
"https://geojson.org/schema/Feature.json",
"https://geojson.org/schema/FeatureCollection.json",
"https://geojson.org/schema/LineString.json",
"https://geojson.org/schema/Point.json",
"https://geojson.org/schema/Polygon.json",
]
return all([
inject_schema(swagger_config, ref)
for ref in ref_imports
])
def configure_flask(swagger_config): def configure_flask(swagger_config):
""" """
Setup a flask app, load flasgger Setup a flask app, load flasgger
...@@ -223,6 +312,8 @@ def get_options(): ...@@ -223,6 +312,8 @@ def get_options():
if __name__ == "__main__": if __name__ == "__main__":
import_remote_refs()
# Parse script args # Parse script args
config = get_options() config = get_options()
......
{ {
"components": { "components": {
"schemas": { "schemas": {
"MESSAGE": { "MESSAGE": {
"description": "Full message definition with message-metadata in `header` and different message type schemas under `payload`", "description": "Full message definition with message-metadata in `header` and different message type schemas under `payload`",
"properties": { "properties": {
"header": { "header": {
"$ref": "#/components/schemas/header" "$ref": "#/components/schemas/header"
}, },
"payload": { "payload": {
"$ref": "#/components/schemas/payload" "$ref": "#/components/schemas/payload"
} }
}, },
"required": [ "required": [
"header", "header",
"payload" "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"
], ],
"type": "object" "example": "acknowledgement",
}, "type": "string"
"acknowledgement": { },
"properties": { "platform_ID": {
"approved": { "description": "Unique identifier for this platform",
"description": "Human-in-the-loop approval.1 - Plan approved; 0 - Plan Rejected", "example": "reav-x-1",
"type": "boolean" "type": "string"
}, }
"autonomy_engine_plan_ID": { },
"description": "Mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", "required": [
"example": 1, "message_type",
"type": "integer" "autonomy_engine_plan_ID",
}, "platform_ID",
"message_type": { "approved"
"description": "Type of message", ],
"enum": [ "type": "object"
"acknowledgement" },
], "alert": {
"example": "acknowledgement", "properties": {
"type": "string" "code": {
}, "description": "Alert code",
"platform_ID": { "example": 345,
"description": "Unique identifier for this platform", "type": "integer"
"example": "reav-x-1", },
"type": "string" "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",
"required": [ "type": "string"
"message_type", },
"autonomy_engine_plan_ID", "message_type": {
"platform_ID", "description": "Type of message",
"approved" "enum": [
"alert"
], ],
"type": "object" "example": "alert",
}, "type": "string"
"alert": { },
"properties": { "platform_ID": {
"code": { "description": "Unique identifier for this platform",
"description": "Alert code", "example": "usvdecibel",
"example": 345, "type": "string"
"type": "integer" },
}, "platform_timestamp": {
"details": { "description": "Timestamp for onboard platform status message",
"description": "Detailed reason for the alert ", "example": "2022-12-21T00:00:00Z",
"example": "Discrepancy between rudder and actuator positions : Rudder Pos=10.31\u00b0, Steering Actuator Pos=28.65\u00b0, Discrepancy=18.33\u00b0", "format": "date-time",
"type": "string" "type": "string"
}, },
"message_type": { "severity": {
"description": "Type of message", "description": "Severity level of alert",
"enum": [ "enum": [
"alert" "Emergency",
], "Alarm",
"example": "alert", "Warning",
"type": "string" "Caution"
},
"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" "example": "Alarm",
}, "type": "string"
"header": { },
"discriminator": { "subsystem": {
"propertyName": "message_type" "description": "System that generated the alert",
}, "example": "Onboard Fault Monitor",
"properties": { "type": "string"
"delivery_type": { },
"default": "publish", "summary": {
"description": "To publish or broadcast this message.", "description": "High level description of the alert",
"enum": [ "example": "Steering Damage - Port Side",
"broadcast", "type": "string"
"publish" }
], },
"example": "publish", "required": [
"type": "string" "message_type",
}, "platform_ID",
"destination": { "code",
"description": "Publisher topic; What is the destination of this message", "severity"
"example": "ah1", ],
"type": "string" "type": "object"
}, },
"encoded": { "geojson.org.schema.Feature.json": {
"description": "Indicate that message raw (encoded) or decoded. Options: encoded=true, decoded=false", "$id": "https://geojson.org/schema/Feature.json",
"example": false, "$schema": "http://json-schema.org/draft-07/schema#",
"type": "boolean" "properties": {
}, "bbox": {
"message_ID": { "items": {
"description": "An identifier for the type of message received.", "type": "number"
"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" "minItems": 4,
}, "type": "array"
"mission_plan": { },
"properties": { "geometry": {
"autonomy_engine_plan_ID": { "oneOf": [
"description": "Unique identifier for this plangenerated by the Autonomy Engine", {
"example": 3, "type": "null"
"type": "integer" },
}, {
"emergency": { "properties": {
"default": false, "bbox": {
"description": "To indicate if this is an emergency. true = emergency and false = no emergency", "items": {
"example": false, "type": "number"
"type": "boolean" },
}, "minItems": 4,
"message_type": { "type": "array"
"description": "Type of message", },
"enum": [ "coordinates": {
"mission_plan" "items": {
], "type": "number"
"example": "mission_plan", },
"type": "string" "minItems": 2,
}, "type": "array"
"plan": { },
"items": { "type": {
"properties": { "enum": [
"action": { "Point"
"description": "Autonomy Engine's action from `move`, `payload`, `dive`, `send_hits`, `scanline`, `scanpoint`.", ],
"enum": [ "type": "string"
"move", }
"payload", },
"dive", "required": [
"send_hits", "type",
"scanline", "coordinates"
"scanpoint", ],
"go_home", "title": "GeoJSON Point",
"surface_now", "type": "object"
"stop_mission", },
"abort_now" {
], "properties": {
"example": "move", "bbox": {
"type": "string" "items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"minItems": 2,
"type": "array"
},
"type": {
"enum": [
"LineString"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON LineString",
"type": "object"
},
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"items": {
"type": "number"
}, },
"activate_payload": { "minItems": 2,
"description": "To activate/deactivate sensor for Autosub Hover-1 --> `MBES` sensor and for EcoSUB --> `Sidescan`", "type": "array"
"example": true, },
"type": "boolean" "minItems": 4,
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"Polygon"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON Polygon",
"type": "object"
},
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"MultiPoint"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON MultiPoint",
"type": "object"
},
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"items": {
"type": "number"
}, },
"altitude": { "minItems": 2,
"description": "Altitude of next action", "type": "array"
"example": 15.0, },
"format": "float", "minItems": 2,
"type": "number" "type": "array"
},
"type": "array"
},
"type": {
"enum": [
"MultiLineString"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON MultiLineString",
"type": "object"
},
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
}, },
"depth": { "minItems": 4,
"description": "Depth of next action", "type": "array"
"example": 15.0, },
"format": "float", "type": "array"
"type": "number" },
"type": "array"
},
"type": {
"enum": [
"MultiPolygon"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON MultiPolygon",
"type": "object"
},
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"geometries": {
"items": {
"oneOf": [
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"type": {
"enum": [
"Point"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON Point",
"type": "object"
}, },
"start_point_latitude": { {
"description": "Start point, y-coordinate", "properties": {
"example": 50.37072283932642, "bbox": {
"format": "float", "items": {
"type": "number" "type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"minItems": 2,
"type": "array"
},
"type": {
"enum": [
"LineString"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON LineString",
"type": "object"
}, },
"start_point_longitude": { {
"description": "Start point, x-coordinate", "properties": {
"example": -4.187143188645706, "bbox": {
"format": "float", "items": {
"type": "number" "type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"minItems": 4,
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"Polygon"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON Polygon",
"type": "object"
}, },
"target_waypoint_latitude": { {
"description": "Target waypoint, y-coordinate", "properties": {
"example": 50.37072283932642, "bbox": {
"format": "float", "items": {
"type": "number" "type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"MultiPoint"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON MultiPoint",
"type": "object"
}, },
"target_waypoint_longitude": { {
"description": "Target waypoint, x-coordinate", "properties": {
"example": -4.187143188645706, "bbox": {
"format": "float", "items": {
"type": "number" "type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"minItems": 2,
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"MultiLineString"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON MultiLineString",
"type": "object"
}, },
"timeout": { {
"description": "Timeout set to perform action", "properties": {
"example": 1800.0, "bbox": {
"format": "float", "items": {
"type": "number" "type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"minItems": 4,
"type": "array"
},
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"MultiPolygon"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON MultiPolygon",
"type": "object"
} }
}, ]
"required": [ },
"target_waypoint_latitude", "type": "array"
"target_waypoint_longitude"
],
"type": "object"
}, },
"type": "array" "type": {
}, "enum": [
"platform_ID": { "GeometryCollection"
"description": "Unique identifier for this platform", ],
"example": "reav-x-1", "type": "string"
"type": "string" }
} },
}, "required": [
"required": [ "type",
"message_type", "geometries"
"autonomy_engine_plan_ID", ],
"platform_ID", "title": "GeoJSON GeometryCollection",
"plan" "type": "object"
}
]
},
"id": {
"oneOf": [
{
"type": "number"
},
{
"type": "string"
}
]
},
"properties": {
"oneOf": [
{
"type": "null"
},
{
"type": "object"
}
]
},
"type": {
"enum": [
"Feature"
], ],
"type": "object" "type": "string"
}, }
"mission_plan_encoded": { },
"properties": { "required": [
"data": { "type",
"description": "encoded string. E.g. Base64 encoded", "properties",
"example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", "geometry"
"type": "string" ],
}, "title": "GeoJSON Feature",
"file_name": { "type": "object"
"description": "Name of file", },
"example": "ah1-0238126349247372.bin", "geojson.org.schema.FeatureCollection.json": {
"type": "string" "$id": "https://geojson.org/schema/FeatureCollection.json",
}, "$schema": "http://json-schema.org/draft-07/schema#",
"is_binary": { "properties": {
"description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", "bbox": {
"example": true, "items": {
"type": "boolean" "type": "number"
},
"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": [ "minItems": 4,
"data", "type": "array"
"is_binary" },
], "features": {
"type": "object" "items": {
}, "properties": {
"observation": { "bbox": {
"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": { "items": {
"properties": { "type": "number"
"latitude": { },
"description": "Identified y-coordinate of point of interest", "minItems": 4,
"example": 178.2, "type": "array"
"format": "float", },
"type": "number" "geometry": {
"oneOf": [
{
"type": "null"
},
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
}, },
"longitude": { "coordinates": {
"description": "Identified x-coordinate of point of interest", "items": {
"example": -10.122, "type": "number"
"format": "float", },
"type": "number" "minItems": 2,
"type": "array"
}, },
"quality_of_point": { "type": {
"description": "Quality/strength of points from features of interest identified by platform.", "enum": [
"example": 0.98, "Point"
"format": "float", ],
"type": "number" "type": "string"
} }
}, },
"required": [ "required": [
"latitude", "type",
"longitude" "coordinates"
], ],
"type": "object" "title": "GeoJSON Point",
}, "type": "object"
"type": "array" },
}, {
"region_surveyed": { "properties": {
"description": "Region surveyed by given platform. GEOJSON", "bbox": {
"example": "", "items": {
"nullable": true "type": "number"
} },
}, "minItems": 4,
"required": [ "type": "array"
"message_type", },
"platform_ID" "coordinates": {
], "items": {
"type": "object" "items": {
}, "type": "number"
"observation_encoded": { },
"properties": { "minItems": 2,
"data": { "type": "array"
"description": "encoded string. E.g. Base64 encoded", },
"example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", "minItems": 2,
"type": "string" "type": "array"
}, },
"file_name": { "type": {
"description": "Name of file", "enum": [
"example": "ah1-0238126349247372.bin", "LineString"
"type": "string" ],
}, "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
]
]
],
"type": "array"
} }
}, },
"type": "object" "required": [
}, "type",
"type": "array" "coordinates"
}, ],
"message_type": { "title": "GeoJSON LineString",
"description": "Type of message", "type": "object"
"enum": [ },
"planning_configuration" {
], "properties": {
"example": "planning_configuration", "bbox": {
"type": "string" "items": {
}, "type": "number"
"planning_config_ID": { },
"description": "Unique identifier tagged to version of this configuration plan", "minItems": 4,
"example": 3, "type": "array"
"type": "integer" },
}, "coordinates": {
"region_of_interest": { "items": {
"description": "Region of interest for the entire operation", "items": {
"items": { "items": {
"description": "Using GEOJSON, exact 4-point region (rectangle shaped - 5 points)", "type": "number"
"properties": { },
"geometry_coordinates": { "minItems": 2,
"example": [ "type": "array"
[ },
[ "minItems": 4,
-4.1777839187560915, "type": "array"
50.34173405662855 },
], "type": "array"
[ },
-4.1777839187560915, "type": {
50.33820949229701 "enum": [
], "Polygon"
[ ],
-4.143667777943875, "type": "string"
50.33820949229701
],
[
-4.143667777943875,
50.34173405662855
],
[
-4.1777839187560915,
50.34173405662855
]
]
],
"type": "array"
} }
}, },
"type": "object" "required": [
}, "type",
"type": "array" "coordinates"
}, ],
"squads": { "title": "GeoJSON Polygon",
"items": { "type": "object"
"properties": { },
"no_of_platforms": { {
"description": "Number of platforms", "properties": {
"example": 3, "bbox": {
"type": "integer" "items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"type": "array"
}, },
"platforms": { "type": {
"description": "Squad consists of these platforms", "enum": [
"items": { "MultiPoint"
"properties": { ],
"active": { "type": "string"
"description": "If platform is active = True, and inactive = False", }
"example": true, },
"type": "boolean" "required": [
}, "type",
"additional_data": { "coordinates"
"description": "Any addition fields/data to be added here", ],
"example": { "title": "GeoJSON MultiPoint",
"new_sensor_a": "test_sensor", "type": "object"
"range": 10.0 },
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"minItems": 2,
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"MultiLineString"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON MultiLineString",
"type": "object"
},
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"minItems": 4,
"type": "array"
},
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"MultiPolygon"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON MultiPolygon",
"type": "object"
},
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"geometries": {
"items": {
"oneOf": [
{
"properties": {
"bbox": {
"items": {
"type": "number"
}, },
"type": "object" "minItems": 4,
}, "type": "array"
"beacon_ID": { },
"description": "Unique identifier (number) for the beacon associated to this platform", "coordinates": {
"example": 2407, "items": {
"type": "number" "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": [ "minItems": 2,
"target_waypoint_latitude", "type": "array"
"target_waypoint_longitude", },
"target_depth" "type": {
"enum": [
"Point"
], ],
"type": "object" "type": "string"
}, }
"endurance_relative_to_water_speed": { },
"properties": { "required": [
"avg_battery_rating": { "type",
"description": "Battery endurance rating during standard operational speed usage (m/s)", "coordinates"
"example": 1.9, ],
"format": "float", "title": "GeoJSON Point",
"type": "number" "type": "object"
}, },
"max_battery_rating": { {
"description": "Battery endurance rating during maximum speed usage (m/s)", "properties": {
"example": 1.23, "bbox": {
"format": "float", "items": {
"type": "number" "type": "number"
},
"min_battery_rating": {
"description": "Battery endurance rating during maximum speed usage (m/s)",
"example": 3.32,
"format": "float",
"type": "number"
}
}, },
"type": "object" "minItems": 4,
}, "type": "array"
"max_velocity": { },
"description": "Maximum velocity set for platform", "coordinates": {
"example": 0.9, "items": {
"format": "float", "items": {
"type": "number" "type": "number"
}, },
"min_altitude": { "minItems": 2,
"description": "Minimum altitude set for platform", "type": "array"
"example": 15.2, },
"format": "float", "minItems": 2,
"type": "number" "type": "array"
}, },
"min_velocity": { "type": {
"description": "Minimum velocity set for platform", "enum": [
"example": 0.1, "LineString"
"format": "float", ],
"type": "number"
},
"model": {
"example": "reav",
"type": "string" "type": "string"
}, }
"operator": { },
"description": "Operator of platform", "required": [
"example": "noc", "type",
"coordinates"
],
"title": "GeoJSON LineString",
"type": "object"
},
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"minItems": 4,
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"Polygon"
],
"type": "string" "type": "string"
}, }
"platform_ID": { },
"description": "Unique identifier for this platform", "required": [
"example": "reav-x-1", "type",
"coordinates"
],
"title": "GeoJSON Polygon",
"type": "object"
},
{
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"MultiPoint"
],
"type": "string" "type": "string"
}, }
"scan_sensor": { },
"properties": { "required": [
"angle": { "type",
"description": "Angle of range of swath width (in degrees)", "coordinates"
"example": 140.0, ],
"format": "float", "title": "GeoJSON MultiPoint",
"type": "number" "type": "object"
}, },
"frequency": { {
"description": "Frequency of scanning sensor (in kHz)", "properties": {
"example": 700.0, "bbox": {
"format": "float", "items": {
"type": "number" "type": "number"
}, },
"sensor_type": { "minItems": 4,
"description": "Unique identifier for this platform", "type": "array"
"enum": [ },
"SIDESCAN", "coordinates": {
"MBES" "items": {
], "items": {
"example": "MBES", "items": {
"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": "number"
} },
"minItems": 2,
"type": "array"
},
"minItems": 2,
"type": "array"
}, },
"type": "object" "type": "array"
}, },
"target_altitude": { "type": {
"description": "Target altitude set for platform. This affects swath width", "enum": [
"example": 15.0, "MultiLineString"
"format": "float", ],
"type": "number" "type": "string"
}, }
"turning_radius": { },
"description": "Turning radius of platform (in metres)", "required": [
"example": 1.0, "type",
"format": "float", "coordinates"
"type": "number" ],
} "title": "GeoJSON MultiLineString",
"type": "object"
}, },
"required": [ {
"operator", "properties": {
"platform_ID", "bbox": {
"active", "items": {
"model" "type": "number"
], },
"type": "object" "minItems": 4,
}, "type": "array"
"type": "array" },
}, "coordinates": {
"squad_ID": { "items": {
"description": "Identifier of given squad", "items": {
"example": 23, "items": {
"type": "integer" "items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"minItems": 4,
"type": "array"
},
"type": "array"
},
"type": "array"
},
"type": {
"enum": [
"MultiPolygon"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON MultiPolygon",
"type": "object"
}
]
},
"type": "array"
}, },
"squad_mission_type": { "type": {
"description": "Mission of given squad: `tracking`, `survey`, `inspection`", "enum": [
"enum": [ "GeometryCollection"
"tracking", ],
"survey", "type": "string"
"inspection"
],
"example": "survey",
"type": "string"
} }
}, },
"required": [ "required": [
"squad_ID", "type",
"no_of_platforms", "geometries"
"platforms", ],
"squad_mission_type" "title": "GeoJSON GeometryCollection",
], "type": "object"
"type": "object" }
}, ]
"type": "array" },
} "id": {
"oneOf": [
{
"type": "number"
},
{
"type": "string"
}
]
},
"properties": {
"oneOf": [
{
"type": "null"
},
{
"type": "object"
}
]
},
"type": {
"enum": [
"Feature"
],
"type": "string"
}
},
"required": [
"type",
"properties",
"geometry"
],
"title": "GeoJSON Feature",
"type": "object"
}, },
"required": [ "type": "array"
"message_type", },
"planning_config_ID", "type": {
"squads", "enum": [
"exclusion_zones", "FeatureCollection"
"region_of_interest"
], ],
"type": "object" "type": "string"
}, }
"platform_status": { },
"properties": { "required": [
"altitude": { "type",
"description": "Target altitude in metres", "features"
"example": 20.0, ],
"format": "float", "title": "GeoJSON FeatureCollection",
"type": "object"
},
"geojson.org.schema.LineString.json": {
"$id": "https://geojson.org/schema/LineString.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"minItems": 2,
"type": "array"
},
"type": {
"enum": [
"LineString"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON LineString",
"type": "object"
},
"geojson.org.schema.Point.json": {
"$id": "https://geojson.org/schema/Point.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"type": "number"
},
"minItems": 2,
"type": "array"
},
"type": {
"enum": [
"Point"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON Point",
"type": "object"
},
"geojson.org.schema.Polygon.json": {
"$id": "https://geojson.org/schema/Polygon.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"bbox": {
"items": {
"type": "number"
},
"minItems": 4,
"type": "array"
},
"coordinates": {
"items": {
"items": {
"items": {
"type": "number" "type": "number"
}, },
"autonomy_engine_plan_ID": { "minItems": 2,
"description": "Last mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", "type": "array"
"example": 1, },
"type": "integer" "minItems": 4,
}, "type": "array"
"battery_output": { },
"description": "Battery output in kW", "type": "array"
"example": 80.2, },
"type": {
"enum": [
"Polygon"
],
"type": "string"
}
},
"required": [
"type",
"coordinates"
],
"title": "GeoJSON Polygon",
"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"
},
"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", "format": "float",
"type": "number" "type": "number"
}, },
"battery_remaining_capacity": { "depth": {
"description": "Battery remaining % provided by respective C2", "description": "Depth of next action",
"example": 80.2, "example": 15.0,
"format": "float", "format": "float",
"type": "number" "type": "number"
}, },
"depth": { "start_point_latitude": {
"default": 0.0, "description": "Start point, y-coordinate",
"description": "Target depth in metres", "example": 50.37072283932642,
"example": 50.0,
"format": "float", "format": "float",
"type": "number" "type": "number"
}, },
"endurance": { "start_point_longitude": {
"description": "Estimate of hours of operation remaining based on present output or performance", "description": "Start point, x-coordinate",
"example": 7.4, "example": -4.187143188645706,
"format": "float", "format": "float",
"type": "number" "type": "number"
}, },
"fuel_remaining_capacity": { "target_waypoint_latitude": {
"description": "Percentage remaining capacity", "description": "Target waypoint, y-coordinate",
"example": 80.2, "example": 50.37072283932642,
"format": "float", "format": "float",
"type": "number" "type": "number"
}, },
"fuel_volume": { "target_waypoint_longitude": {
"description": "Litres of liquid fuel", "description": "Target waypoint, x-coordinate",
"example": 12.5, "example": -4.187143188645706,
"format": "float", "format": "float",
"type": "number" "type": "number"
}, },
"heading": { "timeout": {
"description": "Angular distance relative to north, usually 000\u00b0 at north, clockwise through 359\u00b0, in degrees", "description": "Timeout set to perform action",
"example": 124.3, "example": 1800.0,
"format": "float", "format": "float",
"type": "number" "type": "number"
}, }
"health_status": { },
"description": "Health status where 0 is OK, 1 is platform has an ERROR", "required": [
"example": false, "target_waypoint_latitude",
"type": "boolean" "target_waypoint_longitude"
}, ],
"latitude": { "type": "object"
"description": "Latitude (Y-coordinate) in decimal degrees.", },
"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": "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"
},
"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 y-coordinate of point of interest",
"example": 178.2, "example": 178.2,
"format": "float", "format": "float",
"type": "number" "type": "number"
}, },
"localisation_east_error": { "longitude": {
"description": "Difference in EAST between deadreckoningand USBL update.", "description": "Identified x-coordinate of point of interest",
"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, "example": -10.122,
"format": "float", "format": "float",
"type": "number" "type": "number"
}, },
"message_type": { "quality_of_point": {
"description": "Type of message", "description": "Quality/strength of points from features of interest identified by platform.",
"enum": [ "example": 0.98,
"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", "format": "float",
"type": "number" "type": "number"
}, }
"sensor_config": { },
"description": "Scanning sensor on platform available to be controlled by the Autonomy Engine", "required": [
"properties": { "latitude",
"additional_data": { "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": "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": "GeoJSON Polygon",
"properties": {
"geometry": {
"$ref": "#/components/schemas/geojson.org.schema.Polygon.json"
}
},
"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": "GeoJSON Polygon",
"properties": {
"geometry": {
"$ref": "#/components/schemas/geojson.org.schema.Polygon.json"
}
},
"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", "description": "Any addition fields/data to be added here",
"example": { "example": {
"payload": [ "new_sensor_a": "test_sensor",
1.2, "range": 10.0
434
]
}, },
"type": "object" "type": "object"
}, },
"sensor_on": { "beacon_ID": {
"description": "Sensor switched on (true) or off (false)", "description": "Unique identifier (number) for the beacon associated to this platform",
"example": true, "example": 2407,
"type": "boolean" "type": "number"
}, },
"sensor_serial": { "emergency": {
"description": "serial number of sensor", "properties": {
"example": "mbes-002a", "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" "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": "object" "type": "array"
}, },
"speed_over_ground": { "squad_ID": {
"description": "Speed over ground", "description": "Identifier of given squad",
"example": 124.3, "example": 23,
"format": "float", "type": "integer"
"type": "number" },
}, "squad_mission_type": {
"status_source": { "description": "Mission of given squad: `tracking`, `survey`, `inspection`",
"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": [ "enum": [
"acoustics", "tracking",
"iridium", "survey",
"wifi", "inspection"
"starlink"
], ],
"example": "wifi", "example": "survey",
"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" "type": "string"
} }
},
"required": [
"squad_ID",
"no_of_platforms",
"platforms",
"squad_mission_type"
],
"type": "object"
}, },
"required": [ "type": "array"
"message_type", }
"platform_ID", },
"status_source", "required": [
"platform_timestamp", "message_type",
"latitude", "planning_config_ID",
"longitude" "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"
], ],
"type": "object" "example": "platform_status",
}, "type": "string"
"platform_status_encoded": { },
"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": { "properties": {
"data": { "additional_data": {
"description": "encoded string. E.g. Base64 encoded", "description": "Any addition fields/data to be added here",
"example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", "example": {
"type": "string" "payload": [
}, 1.2,
"file_name": { 434
"description": "Name of file", ]
"example": "ah1-0238126349247372.bin", },
"type": "string" "type": "object"
}, },
"is_binary": { "sensor_on": {
"description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", "description": "Sensor switched on (true) or off (false)",
"example": true, "example": true,
"type": "boolean" "type": "boolean"
}, },
"message_type": { "sensor_serial": {
"description": "Type of message", "description": "serial number of sensor",
"enum": [ "example": "mbes-002a",
"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" "type": "object"
}, },
"survey": { "speed_over_ground": {
"properties": { "description": "Speed over ground",
"latitude_A": { "example": 124.3,
"description": "Latitude of point A(intersection of normal)from waypoint A to survey line", "format": "float",
"example": 178.2, "type": "number"
"format": "float", },
"type": "number" "status_source": {
}, "description": "Indicate if this status message is from the platform or USBL",
"latitude_B": { "enum": [
"description": "Latitude of point B(intersection of normal)from waypoint B to survey line", "usbl",
"example": 178.2, "onboard_platform"
"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" "example": "usbl",
}, "type": "string"
"survey_encoded": { },
"properties": { "thrust_applied": {
"data": { "description": "Thrust applied",
"description": "encoded string. E.g. Base64 encoded", "example": 124.3,
"example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==", "format": "float",
"type": "string" "type": "number"
}, },
"file_name": { "transmission_mode": {
"description": "Name of file", "description": "Mode in which status message was transmitted when on the surface (e.g. iridium/wifi) or underwater (e.g. acoustics)",
"example": "ah1-0238126349247372.bin", "enum": [
"type": "string" "acoustics",
}, "iridium",
"is_binary": { "wifi",
"description": "true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.", "starlink"
"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" "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": "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"
}
},
"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"
}
},
"required": [
"data",
"is_binary"
],
"type": "object"
} }
}, }
"info":{ },
"description":"SoAR message protocol in schemas", "info": {
"title":"SoAR Backbone Message Formats", "description": "SoAR message protocol in schemas",
"version":"0.2" "title": "SoAR Backbone Message Formats",
}, "version": "1.0"
"openapi": "3.0.2", },
"paths": {} "openapi": "3.0.2",
"paths": {}
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment