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,62 +11,80 @@ ...@@ -11,62 +11,80 @@
"payload":{ "payload":{
"message_type": "planning_configuration", "message_type": "planning_configuration",
"planning_config_ID": 1, "planning_config_ID": 1,
"exclusion_zones": [ "primitives": [
{ {
"type": "Polygon", "instruction": "stay_outside",
"coordinates": [ "feature": {
[ "type": "Feature",
[ "properties": {
-4.1777839187560915, "name": "The Rock",
50.34173405662855 "type": "exclusion_zone"
], },
[ "geometry": {
-4.1777839187560915, "type": "Polygon",
50.33820949229701 "coordinates": [
], [
[ [
-4.143667777943875, -4.1777839187560915,
50.33820949229701 50.34173405662855
], ],
[ [
-4.143667777943875, -4.1777839187560915,
50.34173405662855 50.33820949229701
], ],
[ [
-4.1777839187560915, -4.143667777943875,
50.34173405662855 50.33820949229701
],
[
-4.143667777943875,
50.34173405662855
],
[
-4.1777839187560915,
50.34173405662855
]
]
] ]
] }
] }
} },
],
"region_of_interest": [
{ {
"type": "Polygon", "instruction": "stay_inside",
"coordinates": [ "feature": {
[ "type": "Feature",
[ "properties": {
-4.1777839187560915, "name": "Survey Zone Charlie",
50.34173405662855 "type": "operating area"
], },
[ "geometry": {
-4.1777839187560915, "type": "Polygon",
50.33820949229701 "coordinates": [
], [
[ [
-4.143667777943875, -4.1777839187560915,
50.33820949229701 50.34173405662855
], ],
[ [
-4.143667777943875, -4.1777839187560915,
50.34173405662855 50.33820949229701
], ],
[ [
-4.1777839187560915, -4.143667777943875,
50.34173405662855 50.33820949229701
],
[
-4.143667777943875,
50.34173405662855
],
[
-4.1777839187560915,
50.34173405662855
]
]
] ]
] }
] }
} }
], ],
"squads": [ "squads": [
......
...@@ -11,62 +11,80 @@ ...@@ -11,62 +11,80 @@
"payload":{ "payload":{
"message_type": "planning_configuration", "message_type": "planning_configuration",
"planning_config_ID": 1, "planning_config_ID": 1,
"exclusion_zones": [ "primitives": [
{ {
"type": "Polygon", "instruction": "stay_outside",
"coordinates": [ "feature": {
[ "type": "Feature",
[ "properties": {
-4.1777839187560915, "name": "The Rock",
50.34173405662855 "type": "exclusion_zone"
], },
[ "geometry": {
-4.1777839187560915, "type": "Polygon",
50.33820949229701 "coordinates": [
], [
[ [
-4.143667777943875, -4.1777839187560915,
50.33820949229701 50.34173405662855
], ],
[ [
-4.143667777943875, -4.1777839187560915,
50.34173405662855 50.33820949229701
], ],
[ [
-4.1777839187560915, -4.143667777943875,
50.34173405662855 50.33820949229701
],
[
-4.143667777943875,
50.34173405662855
],
[
-4.1777839187560915,
50.34173405662855
]
]
] ]
] }
] }
} },
],
"region_of_interest": [
{ {
"type": "Polygon", "instruction": "stay_inside",
"coordinates": [ "feature": {
[ "type": "Feature",
[ "properties": {
-4.1777839187560915, "name": "Survey Zone Charlie",
50.34173405662855 "type": "operating area"
], },
[ "geometry": {
-4.1777839187560915, "type": "Polygon",
50.33820949229701 "coordinates": [
], [
[ [
-4.143667777943875, -4.1777839187560915,
50.33820949229701 50.34173405662855
], ],
[ [
-4.143667777943875, -4.1777839187560915,
50.34173405662855 50.33820949229701
], ],
[ [
-4.1777839187560915, -4.143667777943875,
50.34173405662855 50.33820949229701
],
[
-4.143667777943875,
50.34173405662855
],
[
-4.1777839187560915,
50.34173405662855
]
]
] ]
] }
] }
} }
], ],
"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",
"items": {
"$ref": "https://geojson.org/schema/Polygon.json",
},
"description": "Region of interest for the entire operation",
},
"exclusion_zones": {
"type": "array", "type": "array",
"items": { "items": primitive_schema,
"$ref": "https://geojson.org/schema/Polygon.json", "description": "Specification primitives",
},
"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