diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cbac56e2e629fcbc4c0c1e4ea316cf5c7f46a5a..1ca7624cc9d5b627302181ca2c729d14249bab9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Inject remote geojson schema definitions - Use geojson Polygon instead of region_schema +- Refactored planning_configuration message definition + - Remove region_of_interest and exclusion_zones + - Add primitives array of classified geojson Features - Upgraded openapi-spec-validator to latest release (0.7.1) - Upgraded openapi-schema-validator to latest release (0.6.2) diff --git a/examples/autonomy_engine_adapter/planning_configuration.json b/examples/autonomy_engine_adapter/planning_configuration.json index 222c3f4a6ece9ac2ddc7ee2c24a8ba98ed5487c5..a47aade99924cf2395d1de9715b5959cd4b1cc68 100644 --- a/examples/autonomy_engine_adapter/planning_configuration.json +++ b/examples/autonomy_engine_adapter/planning_configuration.json @@ -11,62 +11,80 @@ "payload":{ "message_type": "planning_configuration", "planning_config_ID": 1, - "exclusion_zones": [ + "primitives": [ { - "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_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 + ] + ] ] - ] - ] - } - ], - "region_of_interest": [ + } + } + }, { - "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": [ diff --git a/examples/gui_adapter/planning_configuration.json b/examples/gui_adapter/planning_configuration.json index 5ce2216b7fdeabbbc140e5ee7577f789a89e90eb..cc3188edbaaf793d1c23a397eb8589e5b6dfdc73 100644 --- a/examples/gui_adapter/planning_configuration.json +++ b/examples/gui_adapter/planning_configuration.json @@ -11,62 +11,80 @@ "payload":{ "message_type": "planning_configuration", "planning_config_ID": 1, - "exclusion_zones": [ + "primitives": [ { - "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_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 + ] + ] ] - ] - ] - } - ], - "region_of_interest": [ + } + } + }, { - "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": [ diff --git a/formats/planning_configuration.py b/formats/planning_configuration.py index 53a44d697c4a7ae72c1a36aebb456db335f4868c..f2a7c2a4e00a66c0a540d3ad0e7ad9d8156f86a8 100644 --- a/formats/planning_configuration.py +++ b/formats/planning_configuration.py @@ -214,6 +214,30 @@ 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": { @@ -229,19 +253,10 @@ planning_configuration_schema = { + " configuration plan", "example": 3, }, - "region_of_interest": { - "type": "array", - "items": { - "$ref": "https://geojson.org/schema/Polygon.json", - }, - "description": "Region of interest for the entire operation", - }, - "exclusion_zones": { + "primitives": { "type": "array", - "items": { - "$ref": "https://geojson.org/schema/Polygon.json", - }, - "description": "Exclusion zones for all platforms", + "items": primitive_schema, + "description": "Specification primitives", }, "squads": { "type": "array", @@ -252,7 +267,6 @@ planning_configuration_schema = { "message_type", "planning_config_ID", "squads", - "exclusion_zones", - "region_of_interest", + "primitives", ], } diff --git a/project/soar/swagger.json b/project/soar/swagger.json index e73d62e51eb3f0bad0fde2b64b088f5be9ff4b0e..b61da6349759962020675fdcedfcbdc32c563120 100644 --- a/project/soar/swagger.json +++ b/project/soar/swagger.json @@ -1696,13 +1696,6 @@ }, "planning_configuration": { "properties": { - "exclusion_zones": { - "description": "Exclusion zones for all platforms", - "items": { - "$ref": "#/components/schemas/geojson.org.schema.Polygon.json" - }, - "type": "array" - }, "message_type": { "description": "Type of message", "enum": [ @@ -1716,10 +1709,30 @@ "example": 3, "type": "integer" }, - "region_of_interest": { - "description": "Region of interest for the entire operation", + "primitives": { + "description": "Specification primitives", "items": { - "$ref": "#/components/schemas/geojson.org.schema.Polygon.json" + "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" }, @@ -1938,8 +1951,7 @@ "message_type", "planning_config_ID", "squads", - "exclusion_zones", - "region_of_interest" + "primitives" ], "type": "object" },