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 = {
"example": 7.4,
},
"sensor_config": sensor_schema,
"oneOf": [
{
"type": "object",
"properties": {
"position": {
"$ref": "https://geojson.org/schema/Point.json",
},
"waypoint": {
"$ref": "https://geojson.org/schema/Point.json",
},
},
"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": [
"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": [
"latitude",
"longitude",
],
},
],
"required": [
"message_type",
"platform_ID",
......
......@@ -2010,6 +2010,81 @@
"type": "object"
},
"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": {
"autonomy_engine_plan_ID": {
"description": "Last mission plan ID (according to Autonomy Engine's mission plan number sent) executed by platform",
......@@ -2087,81 +2162,6 @@
"example": 4,
"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": {
"description": "Unique identifier for this platform",
"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