Verified Commit 4f981671 authored by Dan Jones's avatar Dan Jones
Browse files

refactor: implement primitive list

- geometries are geojson features
- classified with an instruction to the automation
parent b9c8980f
...@@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ...@@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Inject remote geojson schema definitions - Inject remote geojson schema definitions
- Use geojson Polygon instead of region_schema - 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-spec-validator to latest release (0.7.1)
- Upgraded openapi-schema-validator to latest release (0.6.2) - Upgraded openapi-schema-validator to latest release (0.6.2)
......
...@@ -11,8 +11,16 @@ ...@@ -11,8 +11,16 @@
"payload":{ "payload":{
"message_type": "planning_configuration", "message_type": "planning_configuration",
"planning_config_ID": 1, "planning_config_ID": 1,
"exclusion_zones": [ "primitives": [
{ {
"instruction": "stay_outside",
"feature": {
"type": "Feature",
"properties": {
"name": "The Rock",
"type": "exclusion_zone"
},
"geometry": {
"type": "Polygon", "type": "Polygon",
"coordinates": [ "coordinates": [
[ [
...@@ -39,9 +47,17 @@ ...@@ -39,9 +47,17 @@
] ]
] ]
} }
], }
"region_of_interest": [ },
{ {
"instruction": "stay_inside",
"feature": {
"type": "Feature",
"properties": {
"name": "Survey Zone Charlie",
"type": "operating area"
},
"geometry": {
"type": "Polygon", "type": "Polygon",
"coordinates": [ "coordinates": [
[ [
...@@ -68,6 +84,8 @@ ...@@ -68,6 +84,8 @@
] ]
] ]
} }
}
}
], ],
"squads": [ "squads": [
{ {
......
...@@ -11,8 +11,16 @@ ...@@ -11,8 +11,16 @@
"payload":{ "payload":{
"message_type": "planning_configuration", "message_type": "planning_configuration",
"planning_config_ID": 1, "planning_config_ID": 1,
"exclusion_zones": [ "primitives": [
{ {
"instruction": "stay_outside",
"feature": {
"type": "Feature",
"properties": {
"name": "The Rock",
"type": "exclusion_zone"
},
"geometry": {
"type": "Polygon", "type": "Polygon",
"coordinates": [ "coordinates": [
[ [
...@@ -39,9 +47,17 @@ ...@@ -39,9 +47,17 @@
] ]
] ]
} }
], }
"region_of_interest": [ },
{ {
"instruction": "stay_inside",
"feature": {
"type": "Feature",
"properties": {
"name": "Survey Zone Charlie",
"type": "operating area"
},
"geometry": {
"type": "Polygon", "type": "Polygon",
"coordinates": [ "coordinates": [
[ [
...@@ -68,6 +84,8 @@ ...@@ -68,6 +84,8 @@
] ]
] ]
} }
}
}
], ],
"squads": [ "squads": [
{ {
......
...@@ -214,6 +214,30 @@ squad_metadata_schema = { ...@@ -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 = { planning_configuration_schema = {
"type": "object", "type": "object",
"properties": { "properties": {
...@@ -229,19 +253,10 @@ planning_configuration_schema = { ...@@ -229,19 +253,10 @@ planning_configuration_schema = {
+ " configuration plan", + " configuration plan",
"example": 3, "example": 3,
}, },
"region_of_interest": { "primitives": {
"type": "array", "type": "array",
"items": { "items": primitive_schema,
"$ref": "https://geojson.org/schema/Polygon.json", "description": "Specification primitives",
},
"description": "Region of interest for the entire operation",
},
"exclusion_zones": {
"type": "array",
"items": {
"$ref": "https://geojson.org/schema/Polygon.json",
},
"description": "Exclusion zones for all platforms",
}, },
"squads": { "squads": {
"type": "array", "type": "array",
...@@ -252,7 +267,6 @@ planning_configuration_schema = { ...@@ -252,7 +267,6 @@ planning_configuration_schema = {
"message_type", "message_type",
"planning_config_ID", "planning_config_ID",
"squads", "squads",
"exclusion_zones", "primitives",
"region_of_interest",
], ],
} }
...@@ -1696,13 +1696,6 @@ ...@@ -1696,13 +1696,6 @@
}, },
"planning_configuration": { "planning_configuration": {
"properties": { "properties": {
"exclusion_zones": {
"description": "Exclusion zones for all platforms",
"items": {
"$ref": "#/components/schemas/geojson.org.schema.Polygon.json"
},
"type": "array"
},
"message_type": { "message_type": {
"description": "Type of message", "description": "Type of message",
"enum": [ "enum": [
...@@ -1716,10 +1709,30 @@ ...@@ -1716,10 +1709,30 @@
"example": 3, "example": 3,
"type": "integer" "type": "integer"
}, },
"region_of_interest": { "primitives": {
"description": "Region of interest for the entire operation", "description": "Specification primitives",
"items": { "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" "type": "array"
}, },
...@@ -1938,8 +1951,7 @@ ...@@ -1938,8 +1951,7 @@
"message_type", "message_type",
"planning_config_ID", "planning_config_ID",
"squads", "squads",
"exclusion_zones", "primitives"
"region_of_interest"
], ],
"type": "object" "type": "object"
}, },
......
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