diff --git a/examples/geojson/platform_status.json b/examples/geojson/platform_status.json new file mode 100644 index 0000000000000000000000000000000000000000..ea61efef3799cbe9bd218df9e0cd00d3c938c5ea --- /dev/null +++ b/examples/geojson/platform_status.json @@ -0,0 +1,54 @@ +{ + "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" + } +} diff --git a/formats/platform_status.py b/formats/platform_status.py index df4f047e90238b6e854272c1d2b3a88c10238034..47807805ec41636fc35064f96560015644c549b1 100644 --- a/formats/platform_status.py +++ b/formats/platform_status.py @@ -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", diff --git a/project/soar/swagger.json b/project/soar/swagger.json index 9c39c8e671d213765e1f83c68759a330969ac88c..2296040560007075f67cb947f325f5499f1f0fb2 100644 --- a/project/soar/swagger.json +++ b/project/soar/swagger.json @@ -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",