diff --git a/CHANGELOG.md b/CHANGELOG.md index 115775a6d01c55d1c762b53302e79a795b2b32a6..65831cc093427dafc450713776342fa0becc8b09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- Added optional primitives to squad schema + ### Changed - Refactor action schema to accept geojson.Points diff --git a/examples/mas-dt/planning_configuration.json b/examples/mas-dt/planning_configuration.json new file mode 100644 index 0000000000000000000000000000000000000000..ea4b7af462da3cfb249b4c8afd4521ea8520ddfc --- /dev/null +++ b/examples/mas-dt/planning_configuration.json @@ -0,0 +1,125 @@ +{ + "header":{ + "message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", + "timestamp": "2022-11-16T00:00:00Z", + "version": 2, + "source": "noc-c2", + "destination": "", + "delivery_type": "broadcast", + "encoded": false + }, + "payload":{ + "message_type": "planning_configuration", + "planning_config_ID": 1, + "primitives": [ + { + "instruction": "stay_outside", + "feature": { + "type": "Feature", + "properties": { + "name": "The Rock", + "type": "exclusion_zone" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -4.1777839187560915, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 + ] + ] + ] + } + } + }, + { + "instruction": "stay_inside", + "feature": { + "type": "Feature", + "properties": { + "name": "Survey Zone Charlie", + "type": "operating area" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -4.1777839187560915, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 + ] + ] + ] + } + } + } + ], + "squads": [ + { + "squad_ID": 1, + "no_of_platforms": 1, + "squad_mission_type": "profiling", + "platforms": [ + { + "operator": "noc", + "model": "slocum", + "platform_ID": "unit_xxx", + "active": true + } + ], + "primitives": [ + { + "instruction": "navigate_to", + "feature": { + "type": "Feature", + "properties": { + "name": "Target a", + "type": "target" + }, + "geometry": { + "type": "Point", + "coordinates": [ + -4.183181, + 50.335942 + ] + } + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/formats/planning_configuration.py b/formats/planning_configuration.py index 24fd18ae05c116f7d2e62c4e1e029cb2cdc90740..7fff4b5f7bba948add737d435766c5302501efc2 100644 --- a/formats/planning_configuration.py +++ b/formats/planning_configuration.py @@ -180,6 +180,28 @@ platform_schema = { ], } +primitive_schema = { + "type": "object", + "properties": { + "instruction": { + "type": "string", + "enum": [ + "stay_inside", + "stay_outside", + "navigate_to", + "follow", + "repeat", + "cover", + ], + "description": "How the associated feature should be used", + }, + "feature": { + "$ref": "https://geojson.org/schema/Feature.json", + }, + }, + "required": ["feature"], +} + squad_metadata_schema = { "type": "object", "properties": { @@ -200,11 +222,17 @@ squad_metadata_schema = { }, "squad_mission_type": { "type": "string", - "enum": ["tracking", "survey", "inspection"], + "enum": ["tracking", "survey", "inspection", "profiling"], "description": "Mission of given squad: `tracking`, `survey`" + ", `inspection`", "example": "survey", }, + "primitives": { + "type": "array", + "items": primitive_schema, + "description": "Squad primitives " + + "- includes platform group navigation instructions", + }, }, "required": [ "squad_ID", @@ -214,28 +242,6 @@ squad_metadata_schema = { ], } -primitive_schema = { - "type": "object", - "properties": { - "instruction": { - "type": "string", - "enum": [ - "stay_inside", - "stay_outside", - "navigate_to", - "follow", - "repeat", - "cover", - ], - "description": "How the associated feature should be used", - }, - "feature": { - "$ref": "https://geojson.org/schema/Feature.json", - }, - }, - "required": ["feature"], -} - planning_configuration_schema = { "type": "object", "properties": { @@ -254,7 +260,8 @@ planning_configuration_schema = { "primitives": { "type": "array", "items": primitive_schema, - "description": "Specification primitives", + "description": "Specification primitives " + + "- campaign-wide such as operating area and obstacles", }, "squads": { "type": "array", diff --git a/project/soar/swagger.json b/project/soar/swagger.json index 2ff1d4fd62cecb6b567e27c582a487011f59d76a..e76d2ff1c94467e82b7a9715f077b451543ffed1 100644 --- a/project/soar/swagger.json +++ b/project/soar/swagger.json @@ -1794,7 +1794,7 @@ "type": "integer" }, "primitives": { - "description": "Specification primitives", + "description": "Specification primitives - campaign-wide such as operating area and obstacles", "items": { "properties": { "feature": { @@ -2004,6 +2004,33 @@ }, "type": "array" }, + "primitives": { + "description": "Squad primitives - includes platform group navigation instructions", + "items": { + "properties": { + "feature": { + "$ref": "#/components/schemas/geojson.org.schema.Feature.json" + }, + "instruction": { + "description": "How the associated feature should be used", + "enum": [ + "stay_inside", + "stay_outside", + "navigate_to", + "follow", + "repeat", + "cover" + ], + "type": "string" + } + }, + "required": [ + "feature" + ], + "type": "object" + }, + "type": "array" + }, "squad_ID": { "description": "Identifier of given squad", "example": 23, @@ -2014,7 +2041,8 @@ "enum": [ "tracking", "survey", - "inspection" + "inspection", + "profiling" ], "example": "survey", "type": "string"