diff --git a/CHANGELOG.md b/CHANGELOG.md index d21ae68f3e6b78e581550a2d41fb1385c95f89a3..60798f945994fd0740d2c65c0fe443cdc514fcf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,41 +7,44 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -### Changed +### Changed +- Use geojson Point for platform_status +- Add waypoint to platform_status +- Store remote schemas as committed local files + This prevents the live runtime loading untested changes - Updated header version to accept semver, branch or commit - Store remote schemas as committed local files - This prevents the live runtime loading untested changes - Refactored planning_configuration message definition - - Remove region_of_interest and exclusion_zones + - Remove region_of_interest and exclusion_zones - Add primitives array of classified geojson Features - Inject remote geojson schema definitions - Use geojson Polygon instead of region_schema - Upgraded openapi-spec-validator to latest release (0.7.1) - Upgraded openapi-schema-validator to latest release (0.6.2) -## [v1.0.0] - 2024-08-28 +## [v1.0.0] - 2024-08-28 ### Changed -- Use discover to find all unit tests -- Run tests against current format definitions -- Test that formats match saved schema +- Use discover to find all unit tests +- Run tests against current format definitions +- Test that formats match saved schema - Run python and javascript tests in CI - Refactor schema script to remove invalid definitions object automatically -- Refactor generate_schema_config script to output file on -f flag +- Refactor generate_schema_config script to output file on -f flag ### Fixed - Add `--remove-orphans` to javascript CI test docker compose arguments -## [v0.2.0] - 2024-02-06 +## [v0.2.0] - 2024-02-06 -### Added +### Added -- New alert message definition +- New alert message definition - Emergency flag in mission plan schemas -- Added additional battery and fuel fields to platform status for SPINE project +- Added additional battery and fuel fields to platform status for SPINE project ### Changed @@ -53,13 +56,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. JSON schema definitions for the SoAR project - outer wrapper MESSAGE definition -- header object +- header object - payload object - acknowledgement - mission_plan (raw and encoded) - observation (raw and encoded) - - platform_status (raw and encoded) - - planning_configuration + - platform_status (raw and encoded) + - planning_configuration Example messages matching the schema for each partner diff --git a/examples/geojson/platform_status.json b/examples/geojson/platform_status.json new file mode 100644 index 0000000000000000000000000000000000000000..1c8522f762cef4718cc96eb78781f10579052b25 --- /dev/null +++ b/examples/geojson/platform_status.json @@ -0,0 +1,38 @@ +{ + "header":{ + "message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2024-09-06T00:00:00Z", + "version": 2, + "source": "ecosub_c2", + "destination": "mas-dt.noc.slocum.unit_xxx.from_platform.platform_status", + "delivery_type": "publish", + "encoded": false + }, + "payload":{ + "message_type": "platform_status", + "platform_ID": "unit_xxx", + "platform_timestamp": "2024-09-06T00: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 + ] + } + } +} diff --git a/formats/platform_status.py b/formats/platform_status.py index 81b452f08fddecdc800e4992d046595b02642d2e..47807805ec41636fc35064f96560015644c549b1 100644 --- a/formats/platform_status.py +++ b/formats/platform_status.py @@ -72,31 +72,6 @@ platform_status_schema = { + " Engine's mission plan number sent) executed by platform", "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": { "type": "integer", "description": "Track number - stage in mission (e.g. " @@ -197,12 +172,85 @@ platform_status_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": [ "message_type", "platform_ID", "status_source", "platform_timestamp", - "latitude", - "longitude", ], } diff --git a/project/soar/swagger.json b/project/soar/swagger.json index aaee112ff84400f7bb02044ca6692dfbbcc4c049..2296040560007075f67cb947f325f5499f1f0fb2 100644 --- a/project/soar/swagger.json +++ b/project/soar/swagger.json @@ -2010,13 +2010,82 @@ "type": "object" }, "platform_status": { - "properties": { - "altitude": { - "description": "Target altitude in metres", - "example": 20.0, - "format": "float", - "type": "number" + "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", "example": 1, @@ -2034,13 +2103,6 @@ "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, @@ -2070,12 +2132,6 @@ "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, @@ -2088,12 +2144,6 @@ "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": [ @@ -2208,9 +2258,7 @@ "message_type", "platform_ID", "status_source", - "platform_timestamp", - "latitude", - "longitude" + "platform_timestamp" ], "type": "object" },