Verified Commit 04530bff authored by Dan Jones's avatar Dan Jones
Browse files

feat: allow position coordinates in either format

- either individual properties or geojson
- add geojson test
parent d1e33be0
{
"header":{
"message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd",
"timestamp": "2022-11-16T00:00:00Z",
"version": 2,
"source": "ecosub_c2",
"destination": "soar.planet-ocean.ecosub.ecosub-2.from_platform.platform_status",
"delivery_type": "publish",
"encoded": false
},
"payload":{
"message_type": "platform_status",
"platform_ID": "ecosub-2",
"platform_timestamp": "2022-12-21T00:00:00Z",
"status_source": "onboard_platform",
"autonomy_engine_plan_ID": 1,
"battery_remaining_capacity": 80.2,
"platform_state": "ABORT",
"mission_plan_ID": 1,
"mission_track_ID": 4,
"position": {
"type": "Point",
"coordinates": [
-10.122,
178.2,
50.0,
20
]
},
"waypoint": {
"type": "Point",
"coordinates": [
-10.5,
178.5
]
},
"heading": 90.0,
"health_status": false,
"localisation_north_error": 0,
"localisation_east_error": 0,
"usbl_fix_seconds_ago": 0,
"range_to_go": 124.3,
"sensor_config": {
"sensor_serial": "sidescan-2x",
"sensor_on": true,
"additional_data": {
"whiskers_on": true
}
},
"speed_over_ground": 4.3,
"thrust_applied": 124.3,
"water_current_velocity": "124.3NE"
}
}
...@@ -171,82 +171,82 @@ platform_status_schema = { ...@@ -171,82 +171,82 @@ platform_status_schema = {
"example": 7.4, "example": 7.4,
}, },
"sensor_config": sensor_schema, "sensor_config": sensor_schema,
"oneOf": [ },
{ "oneOf": [
"type": "object", {
"properties": { "type": "object",
"position": { "properties": {
"$ref": "https://geojson.org/schema/Point.json", "position": {
}, "$ref": "https://geojson.org/schema/Point.json",
"waypoint": { },
"$ref": "https://geojson.org/schema/Point.json", "waypoint": {
}, "$ref": "https://geojson.org/schema/Point.json",
}, },
"required": [
"position",
],
}, },
{ "required": [
"type": "object", "position",
"properties": { ],
"latitude": { },
"type": "number", {
"format": "float", "type": "object",
"description": "Latitude (Y-coordinate) in decimal degrees.", "properties": {
"example": 178.2, "latitude": {
}, "type": "number",
"longitude": { "format": "float",
"type": "number", "description": "Latitude (Y-coordinate) in decimal degrees.",
"format": "float", "example": 178.2,
"description": "Longitude (X-coordinate) in decimal degrees.", },
"example": -10.122, "longitude": {
}, "type": "number",
"depth": { "format": "float",
"type": "number", "description": "Longitude (X-coordinate) in decimal degrees.",
"format": "float", "example": -10.122,
"description": "Target depth in metres", },
"example": 50.0, "depth": {
"default": 0.0, "type": "number",
}, "format": "float",
"altitude": { "description": "Target depth in metres",
"type": "number", "example": 50.0,
"format": "float", "default": 0.0,
"description": "Target altitude in metres", },
"example": 20.0, "altitude": {
}, "type": "number",
"waypoint_latitude": { "format": "float",
"type": "number", "description": "Target altitude in metres",
"format": "float", "example": 20.0,
"description": "Latitude (Y-coordinate) in decimal degrees.", },
"example": 178.2, "waypoint_latitude": {
}, "type": "number",
"waypoint_longitude": { "format": "float",
"type": "number", "description": "Latitude (Y-coordinate) in decimal degrees.",
"format": "float", "example": 178.2,
"description": "Longitude (X-coordinate) in decimal degrees.", },
"example": -10.122, "waypoint_longitude": {
}, "type": "number",
"waypoint_depth": { "format": "float",
"type": "number", "description": "Longitude (X-coordinate) in decimal degrees.",
"format": "float", "example": -10.122,
"description": "Target depth in metres", },
"example": 50.0, "waypoint_depth": {
"default": 0.0, "type": "number",
}, "format": "float",
"waypoint_altitude": { "description": "Target depth in metres",
"type": "number", "example": 50.0,
"format": "float", "default": 0.0,
"description": "Target altitude in metres", },
"example": 20.0, "waypoint_altitude": {
}, "type": "number",
"format": "float",
"description": "Target altitude in metres",
"example": 20.0,
}, },
"required": [
"latitude",
"longitude",
],
}, },
], "required": [
}, "latitude",
"longitude",
],
},
],
"required": [ "required": [
"message_type", "message_type",
"platform_ID", "platform_ID",
......
...@@ -2010,6 +2010,81 @@ ...@@ -2010,6 +2010,81 @@
"type": "object" "type": "object"
}, },
"platform_status": { "platform_status": {
"oneOf": [
{
"properties": {
"position": {
"$ref": "#/components/schemas/geojson.org.schema.Point.json"
},
"waypoint": {
"$ref": "#/components/schemas/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"
}
],
"properties": { "properties": {
"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",
...@@ -2087,81 +2162,6 @@ ...@@ -2087,81 +2162,6 @@
"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",
......
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