Commit 95cfc66d authored by Dan Jones's avatar Dan Jones
Browse files

Merge branch '77-add-optional-primitives-per-squad-to-planning-configuration' into '67-mas-dt'

Resolve "Add optional primitives per squad to planning configuration"

See merge request !47
3 merge requests!59Release v2.0.0,!47Resolve "Add optional primitives per squad to planning configuration",!36Resolve "Create temporary mas-dt branch for initial schema refactor"
Pipeline #232934 passed with stages
in 1 minute and 22 seconds
......@@ -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
......
{
"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
......@@ -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",
......
......@@ -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"
......
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