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

refactor: use geojson or separate properties

add waypoint
parent 795b55a6
...@@ -72,31 +72,6 @@ platform_status_schema = { ...@@ -72,31 +72,6 @@ platform_status_schema = {
+ " Engine's mission plan number sent) executed by platform", + " Engine's mission plan number sent) executed by platform",
"example": 1, "example": 1,
}, },
"latitude": {
"type": "number",
"format": "float",
"description": "Latitude (Y-coordinate) in decimal degrees.",
"example": 178.2,
},
"longitude": {
"type": "number",
"format": "float",
"description": "Longitude (X-coordinate) in decimal degrees.",
"example": -10.122,
},
"depth": {
"type": "number",
"format": "float",
"description": "Target depth in metres",
"example": 50.0,
"default": 0.0,
},
"altitude": {
"type": "number",
"format": "float",
"description": "Target altitude in metres",
"example": 20.0,
},
"mission_track_ID": { "mission_track_ID": {
"type": "integer", "type": "integer",
"description": "Track number - stage in mission (e.g. " "description": "Track number - stage in mission (e.g. "
...@@ -196,13 +171,86 @@ platform_status_schema = { ...@@ -196,13 +171,86 @@ platform_status_schema = {
"example": 7.4, "example": 7.4,
}, },
"sensor_config": sensor_schema, "sensor_config": sensor_schema,
"oneOf": [
{
"type": "object",
"properties": {
"position": {
"$ref": "https://geojson.org/schema/Point.json",
},
"waypoint": {
"$ref": "https://geojson.org/schema/Point.json",
},
},
"required": [
"position",
],
},
{
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "float",
"description": "Latitude (Y-coordinate) in decimal degrees.",
"example": 178.2,
},
"longitude": {
"type": "number",
"format": "float",
"description": "Longitude (X-coordinate) in decimal degrees.",
"example": -10.122,
},
"depth": {
"type": "number",
"format": "float",
"description": "Target depth in metres",
"example": 50.0,
"default": 0.0,
},
"altitude": {
"type": "number",
"format": "float",
"description": "Target altitude in metres",
"example": 20.0,
},
"waypoint_latitude": {
"type": "number",
"format": "float",
"description": "Latitude (Y-coordinate) in decimal degrees.",
"example": 178.2,
},
"waypoint_longitude": {
"type": "number",
"format": "float",
"description": "Longitude (X-coordinate) in decimal degrees.",
"example": -10.122,
},
"waypoint_depth": {
"type": "number",
"format": "float",
"description": "Target depth in metres",
"example": 50.0,
"default": 0.0,
},
"waypoint_altitude": {
"type": "number",
"format": "float",
"description": "Target altitude in metres",
"example": 20.0,
},
},
"required": [
"latitude",
"longitude",
],
},
],
}, },
"required": [ "required": [
"message_type", "message_type",
"platform_ID", "platform_ID",
"status_source", "status_source",
"platform_timestamp", "platform_timestamp",
"latitude",
"longitude",
], ],
} }
...@@ -2011,12 +2011,6 @@ ...@@ -2011,12 +2011,6 @@
}, },
"platform_status": { "platform_status": {
"properties": { "properties": {
"altitude": {
"description": "Target altitude in metres",
"example": 20.0,
"format": "float",
"type": "number"
},
"autonomy_engine_plan_ID": { "autonomy_engine_plan_ID": {
"description": "Last mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform", "description": "Last mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform",
"example": 1, "example": 1,
...@@ -2034,13 +2028,6 @@ ...@@ -2034,13 +2028,6 @@
"format": "float", "format": "float",
"type": "number" "type": "number"
}, },
"depth": {
"default": 0.0,
"description": "Target depth in metres",
"example": 50.0,
"format": "float",
"type": "number"
},
"endurance": { "endurance": {
"description": "Estimate of hours of operation remaining based on present output or performance", "description": "Estimate of hours of operation remaining based on present output or performance",
"example": 7.4, "example": 7.4,
...@@ -2070,12 +2057,6 @@ ...@@ -2070,12 +2057,6 @@
"example": false, "example": false,
"type": "boolean" "type": "boolean"
}, },
"latitude": {
"description": "Latitude (Y-coordinate) in decimal degrees.",
"example": 178.2,
"format": "float",
"type": "number"
},
"localisation_east_error": { "localisation_east_error": {
"description": "Difference in EAST between deadreckoningand USBL update.", "description": "Difference in EAST between deadreckoningand USBL update.",
"example": 0.000129, "example": 0.000129,
...@@ -2088,12 +2069,6 @@ ...@@ -2088,12 +2069,6 @@
"format": "float", "format": "float",
"type": "number" "type": "number"
}, },
"longitude": {
"description": "Longitude (X-coordinate) in decimal degrees.",
"example": -10.122,
"format": "float",
"type": "number"
},
"message_type": { "message_type": {
"description": "Type of message", "description": "Type of message",
"enum": [ "enum": [
...@@ -2112,6 +2087,81 @@ ...@@ -2112,6 +2087,81 @@
"example": 4, "example": 4,
"type": "integer" "type": "integer"
}, },
"oneOf": [
{
"properties": {
"position": {
"$ref": "https://geojson.org/schema/Point.json"
},
"waypoint": {
"$ref": "https://geojson.org/schema/Point.json"
}
},
"required": [
"position"
],
"type": "object"
},
{
"properties": {
"altitude": {
"description": "Target altitude in metres",
"example": 20.0,
"format": "float",
"type": "number"
},
"depth": {
"default": 0.0,
"description": "Target depth in metres",
"example": 50.0,
"format": "float",
"type": "number"
},
"latitude": {
"description": "Latitude (Y-coordinate) in decimal degrees.",
"example": 178.2,
"format": "float",
"type": "number"
},
"longitude": {
"description": "Longitude (X-coordinate) in decimal degrees.",
"example": -10.122,
"format": "float",
"type": "number"
},
"waypoint_altitude": {
"description": "Target altitude in metres",
"example": 20.0,
"format": "float",
"type": "number"
},
"waypoint_depth": {
"default": 0.0,
"description": "Target depth in metres",
"example": 50.0,
"format": "float",
"type": "number"
},
"waypoint_latitude": {
"description": "Latitude (Y-coordinate) in decimal degrees.",
"example": 178.2,
"format": "float",
"type": "number"
},
"waypoint_longitude": {
"description": "Longitude (X-coordinate) in decimal degrees.",
"example": -10.122,
"format": "float",
"type": "number"
}
},
"required": [
"latitude",
"longitude"
],
"type": "object"
}
],
"platform_ID": { "platform_ID": {
"description": "Unique identifier for this platform", "description": "Unique identifier for this platform",
"example": "reav-x-1", "example": "reav-x-1",
...@@ -2208,9 +2258,7 @@ ...@@ -2208,9 +2258,7 @@
"message_type", "message_type",
"platform_ID", "platform_ID",
"status_source", "status_source",
"platform_timestamp", "platform_timestamp"
"latitude",
"longitude"
], ],
"type": "object" "type": "object"
}, },
......
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