Commit 4fd9f7f1 authored by Dan Jones's avatar Dan Jones
Browse files

Merge branch '62-mas-dt-define-instruction-set-and-instructions' into '67-mas-dt'

Resolve "MAS-DT define instruction set and instructions"

See merge request !42
parents 95cfc66d da426240
Pipeline #233155 passed with stages
in 1 minute and 34 seconds
......@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Add definition of instruction_set message
- Added optional primitives to squad schema
### Changed
......@@ -16,10 +17,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Refactor action schema to accept geojson.Points
- Use geojson Point for platform_status
- Add waypoint to platform_status
- Updated header version to accept semver, branch or commit
- Store remote schemas as committed local files
This prevents the live runtime loading untested changes
- Updated header version to accept semver, branch or commit
- Store remote schemas as committed local files
- Refactored planning_configuration message definition
- Remove region_of_interest and exclusion_zones
- Add primitives array of classified geojson Features
......
{
"header": {
"message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd",
"timestamp": "2024-09-03T00:00:00Z",
"version": 1,
"source": "ori",
"destination": "internal.noc.slocum.unit_111.to_platform.instruction_set",
"delivery_type": "publish",
"encoded": false
},
"payload": {
"message_type": "instruction_set",
"categories": {
"speed": "slow",
"data_transmission": "normal"
},
"files": [
{
"name": "yo95.ma",
"content": "YmVoYXZpb3JfbmFtZT15bw0KIyB5bzM1Lm1hDQojIFN0YW5kYXJkIFlPIEZpbGUgZmlsZSBnMiBvciBnMyBOT0MgZ2xpZGVycw0KIyAgMSBZTw0KIyAgMzBtIGRlcHRoDQojICBBbHRpbWV0ZXIgT24gYXQgbWF4aW11biBzcGVlZA0KIyAgQXV0b2JhbGxhc3Qgb24gLSBGdWxsIEJ1b3lhbmN5DQojICBCYXR0ZXJ5IE1vZGUgU2Vydm8gMjYgZGVlZ3JlZXMNCiMgU2VlIC9kb2NvL2h3LWl0LXdvcmtzL2F1dG9iYWxsYXN0LnR4dCBhbmQgbWFzdGVyZGF0YSBmb3IgZnVsbCBsaXN0IG9mIGJfYXJncy4NCiMgMjIgLSBBdWd1c3QgMjAxNiBhbHZhcm8ubG9yZW56b0Bub2MuYWMudWsNCiMgMDIgLSBEZWMgMjAyMSBiZW4uYWxsc3VwQG5vYyBjbGVhbiB1cCBmb3IgZzMgYW5kIHRocnVzdGVyIHVzYWdlDQoNCjxzdGFydDpiX2FyZz4JDQojICAgIGJfYXJnOiBudW1faGFsZl9jeWNsZXNfdG9fZG8obm9kaW0pIDIgCQkJIyBOdW1iZXIgb2YgZGl2ZS9jbGltYnMgdG8gcGVyZm9ybQ0KCQkJCQkJCQkJCQkJCQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQojIGFyZ3VtZW50cyBmb3IgZGl2ZV90bw0KICAgIGJfYXJnOiBkX2JwdW1wX3ZhbHVlKFgpIAkgICAgICAJMzAwLjAgCQkjIHRvdGFsIGRyaXZlIHZvbHVtZSBmb3IgYXV0b2JhbGxhc3QNCiAgICBiX2FyZzogZF9waXRjaF92YWx1ZShYKSAgIAkgICAgICAJLTAuMzQ5ICAJIyAtMjAgZGVnDQogICANCiMgYXJndW1lbnRzIGZvciBjbGltYl90bw0KICAgIGJfYXJnOiBjX3BpdGNoX3ZhbHVlKFgpICAgICAJCTAuMzQ5ICAgICAgICMgKzIwIGRlZw0KDQo8ZW5kOmJfYXJnPg0K",
"static": {
"no_half_cycles_to_do": 2,
"d_bpump_value": 300.0,
"d_pitch_value": -0.349,
"c_pitch_value": 0.349
}
},
{
"name": "tbdlist.dat",
"content": "IyMjIG1hbmRhdG9yeSB0aW1lIGluZm9ybWF0aW9uIGF0IGZ1bGwgcmVzb2x1dGlvbg0KU0NJX01fUFJFU0VOVF9USU1FDQpTQ0lfTV9QUkVTRU5UX1NFQ1NfSU5UT19NSVNTSU9ODQoNCiMjIyMjIyMjIyBzdGFuZGFyZCBDVEQgaW5mb3JtYXRpb24gIyMjIyMjIyMjIyMjIyMjIyMNCiMjIyByZWNvbW1lbmRlZCBzYW1wbGUgcmF0ZSA6IDwgMTAgc2Vjb25kcw0KU0NJX1dBVEVSX0NPTkQgICAgICAgICAxMCAjIHRvIHNhbXBsZSBldmVyeSBvdGhlciB5byBvbiBkb3duY2FzdCBvbmx5LCB1c2UgMTAgMSAtMSAyDQpTQ0lfV0FURVJfVEVNUCAgICAgICAgIDEwDQpTQ0lfV0FURVJfUFJFU1NVUkUgICAgIDEwDQojU0NJX0NURDQxQ1BfVElNRVNUQU1QICAxMA==",
"static": {
"SCI_WATER_COND": 10,
"SCI_WATER_TEMP": 10,
"SCI_WATER_PRESSURE": 10
}
},
{
"name": "sample99.ma",
"content": "YmVoYXZpb3JfbmFtZT1zYW1wbGUNCjxzdGFydDpiX2FyZz4NCiAgICBiX2FyZzogbnRoX3lvX3RvX3NhbXBsZShub2RpbSkgICAgICAgICAgICAJMiAgCSAjIENoZWNrIG1hc3RlcmRhdGENCiAgICBiX2FyZzogbWF4X2RlcHRoKG0pICAgICAgICAgICAgICAgICAgIAkgMjAwMCAgICAjIENoZWNrIG1hc3RlcmRhdGENCjxlbmQ6Yl9hcmc+DQo=",
"static": {
"nth_yo_to_sample": 2,
"max_depth": 2000
}
}
]
}
}
\ No newline at end of file
......@@ -87,6 +87,44 @@
}
}
],
"instructions": [
{
"message_type": "instruction_set",
"categories": {
"speed": "slow",
"data_transmission": "normal"
},
"files": [
{
"name": "yo95.ma",
"content": "YmVoYXZpb3JfbmFtZT15bw0KIyB5bzM1Lm1hDQojIFN0YW5kYXJkIFlPIEZpbGUgZmlsZSBnMiBvciBnMyBOT0MgZ2xpZGVycw0KIyAgMSBZTw0KIyAgMzBtIGRlcHRoDQojICBBbHRpbWV0ZXIgT24gYXQgbWF4aW11biBzcGVlZA0KIyAgQXV0b2JhbGxhc3Qgb24gLSBGdWxsIEJ1b3lhbmN5DQojICBCYXR0ZXJ5IE1vZGUgU2Vydm8gMjYgZGVlZ3JlZXMNCiMgU2VlIC9kb2NvL2h3LWl0LXdvcmtzL2F1dG9iYWxsYXN0LnR4dCBhbmQgbWFzdGVyZGF0YSBmb3IgZnVsbCBsaXN0IG9mIGJfYXJncy4NCiMgMjIgLSBBdWd1c3QgMjAxNiBhbHZhcm8ubG9yZW56b0Bub2MuYWMudWsNCiMgMDIgLSBEZWMgMjAyMSBiZW4uYWxsc3VwQG5vYyBjbGVhbiB1cCBmb3IgZzMgYW5kIHRocnVzdGVyIHVzYWdlDQoNCjxzdGFydDpiX2FyZz4JDQojICAgIGJfYXJnOiBudW1faGFsZl9jeWNsZXNfdG9fZG8obm9kaW0pIDIgCQkJIyBOdW1iZXIgb2YgZGl2ZS9jbGltYnMgdG8gcGVyZm9ybQ0KCQkJCQkJCQkJCQkJCQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQojIGFyZ3VtZW50cyBmb3IgZGl2ZV90bw0KICAgIGJfYXJnOiBkX2JwdW1wX3ZhbHVlKFgpIAkgICAgICAJMzAwLjAgCQkjIHRvdGFsIGRyaXZlIHZvbHVtZSBmb3IgYXV0b2JhbGxhc3QNCiAgICBiX2FyZzogZF9waXRjaF92YWx1ZShYKSAgIAkgICAgICAJLTAuMzQ5ICAJIyAtMjAgZGVnDQogICANCiMgYXJndW1lbnRzIGZvciBjbGltYl90bw0KICAgIGJfYXJnOiBjX3BpdGNoX3ZhbHVlKFgpICAgICAJCTAuMzQ5ICAgICAgICMgKzIwIGRlZw0KDQo8ZW5kOmJfYXJnPg0K",
"static": {
"no_half_cycles_to_do": 2,
"d_bpump_value": 300.0,
"d_pitch_value": -0.349,
"c_pitch_value": 0.349
}
},
{
"name": "tbdlist.dat",
"content": "IyMjIG1hbmRhdG9yeSB0aW1lIGluZm9ybWF0aW9uIGF0IGZ1bGwgcmVzb2x1dGlvbg0KU0NJX01fUFJFU0VOVF9USU1FDQpTQ0lfTV9QUkVTRU5UX1NFQ1NfSU5UT19NSVNTSU9ODQoNCiMjIyMjIyMjIyBzdGFuZGFyZCBDVEQgaW5mb3JtYXRpb24gIyMjIyMjIyMjIyMjIyMjIyMNCiMjIyByZWNvbW1lbmRlZCBzYW1wbGUgcmF0ZSA6IDwgMTAgc2Vjb25kcw0KU0NJX1dBVEVSX0NPTkQgICAgICAgICAxMCAjIHRvIHNhbXBsZSBldmVyeSBvdGhlciB5byBvbiBkb3duY2FzdCBvbmx5LCB1c2UgMTAgMSAtMSAyDQpTQ0lfV0FURVJfVEVNUCAgICAgICAgIDEwDQpTQ0lfV0FURVJfUFJFU1NVUkUgICAgIDEwDQojU0NJX0NURDQxQ1BfVElNRVNUQU1QICAxMA==",
"static": {
"SCI_WATER_COND": 10,
"SCI_WATER_TEMP": 10,
"SCI_WATER_PRESSURE": 10
}
},
{
"name": "sample99.ma",
"content": "YmVoYXZpb3JfbmFtZT1zYW1wbGUNCjxzdGFydDpiX2FyZz4NCiAgICBiX2FyZzogbnRoX3lvX3RvX3NhbXBsZShub2RpbSkgICAgICAgICAgICAJMiAgCSAjIENoZWNrIG1hc3RlcmRhdGENCiAgICBiX2FyZzogbWF4X2RlcHRoKG0pICAgICAgICAgICAgICAgICAgIAkgMjAwMCAgICAjIENoZWNrIG1hc3RlcmRhdGENCjxlbmQ6Yl9hcmc+DQo=",
"static": {
"nth_yo_to_sample": 2,
"max_depth": 2000
}
}
]
}
],
"squads": [
{
"squad_ID": 1,
......
"""
schemas: Instruction set message containing a collection of configuration files
"""
config_file_schema = {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of file",
"example": "yo95.ma",
},
"content": {
"type": "string",
"description": "Base64 encoded file content",
"example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcB"
+ "AAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==",
},
"mime_type": {
"type": "string",
"description": "MIME type",
"example": "text/plain",
},
"static": {
"type": "object",
"description": "list of the fixed values set by the config file",
},
},
"required": ["name", "content"],
}
instruction_set_schema = {
"type": "object",
"properties": {
"message_type": {
"type": "string",
"description": "Type of message",
"example": "instruction_set",
"enum": ["instruction_set"],
},
"categories": {
"type": "object",
},
"files": {
"type": "array",
"items": config_file_schema,
},
},
"required": [
"message_type",
"files",
],
}
......@@ -3,6 +3,7 @@ payload_schema = {
"propertyName": "message_type",
"mapping": {
"alert": "#/components/schemas/alert",
"instruction_set": "#/components/schemas/instruction_set",
"mission_plan": "#/components/schemas/mission_plan",
"mission_plan_encoded": "#/components/schemas/" + "mission_plan_encoded",
"observation": "#/components/schemas/observation",
......@@ -20,6 +21,7 @@ payload_schema = {
"oneOf": [
{"$ref": "#/components/schemas/alert"},
{"$ref": "#/components/schemas/acknowledgement"},
{"$ref": "#/components/schemas/instruction_set"},
{"$ref": "#/components/schemas/mission_plan"},
{"$ref": "#/components/schemas/mission_plan_encoded"},
{"$ref": "#/components/schemas/observation"},
......
......@@ -2,6 +2,7 @@
schemas: configuration sent to Autonomy Engine (i.e. during an emergency,
if a platform needs to be removed from the mission planning)
"""
from .instruction_set import instruction_set_schema
emergency_schema = {
"type": "object",
......@@ -263,6 +264,10 @@ planning_configuration_schema = {
"description": "Specification primitives "
+ "- campaign-wide such as operating area and obstacles",
},
"instructions": {
"type": "array",
"items": instruction_set_schema,
},
"squads": {
"type": "array",
"items": squad_metadata_schema,
......
......@@ -12,6 +12,7 @@ from formats.survey import survey_schema
from formats.survey_encoded import survey_encoded_schema
from formats.acknowledgement import acknowledgement_schema
from formats.alert import alert_schema
from formats.instruction_set import config_file_schema, instruction_set_schema
from flasgger import Swagger
from flask import Flask
......@@ -71,6 +72,8 @@ def get_swagger_config(reload=False):
"survey_encoded": survey_encoded_schema,
"acknowledgement": acknowledgement_schema,
"alert": alert_schema,
"instruction_set": instruction_set_schema,
"config_file": config_file_schema,
}
},
}
......
......@@ -111,6 +111,34 @@
],
"type": "object"
},
"config_file": {
"properties": {
"content": {
"description": "Base64 encoded file content",
"example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==",
"type": "string"
},
"mime_type": {
"description": "MIME type",
"example": "text/plain",
"type": "string"
},
"name": {
"description": "Name of file",
"example": "yo95.ma",
"type": "string"
},
"static": {
"description": "list of the fixed values set by the config file",
"type": "object"
}
},
"required": [
"name",
"content"
],
"type": "object"
},
"geojson.org.schema.Feature.json": {
"properties": {
"bbox": {
......@@ -1446,6 +1474,57 @@
],
"type": "object"
},
"instruction_set": {
"properties": {
"categories": {
"type": "object"
},
"files": {
"items": {
"properties": {
"content": {
"description": "Base64 encoded file content",
"example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==",
"type": "string"
},
"mime_type": {
"description": "MIME type",
"example": "text/plain",
"type": "string"
},
"name": {
"description": "Name of file",
"example": "yo95.ma",
"type": "string"
},
"static": {
"description": "list of the fixed values set by the config file",
"type": "object"
}
},
"required": [
"name",
"content"
],
"type": "object"
},
"type": "array"
},
"message_type": {
"description": "Type of message",
"enum": [
"instruction_set"
],
"example": "instruction_set",
"type": "string"
}
},
"required": [
"message_type",
"files"
],
"type": "object"
},
"mission_plan": {
"properties": {
"autonomy_engine_plan_ID": {
......@@ -1730,6 +1809,7 @@
"mapping": {
"acknowledgement": "#/components/schemas/acknowledgement",
"alert": "#/components/schemas/alert",
"instruction_set": "#/components/schemas/instruction_set",
"mission_plan": "#/components/schemas/mission_plan",
"mission_plan_encoded": "#/components/schemas/mission_plan_encoded",
"observation": "#/components/schemas/observation",
......@@ -1749,6 +1829,9 @@
{
"$ref": "#/components/schemas/acknowledgement"
},
{
"$ref": "#/components/schemas/instruction_set"
},
{
"$ref": "#/components/schemas/mission_plan"
},
......@@ -1780,6 +1863,60 @@
},
"planning_configuration": {
"properties": {
"instructions": {
"items": {
"properties": {
"categories": {
"type": "object"
},
"files": {
"items": {
"properties": {
"content": {
"description": "Base64 encoded file content",
"example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==",
"type": "string"
},
"mime_type": {
"description": "MIME type",
"example": "text/plain",
"type": "string"
},
"name": {
"description": "Name of file",
"example": "yo95.ma",
"type": "string"
},
"static": {
"description": "list of the fixed values set by the config file",
"type": "object"
}
},
"required": [
"name",
"content"
],
"type": "object"
},
"type": "array"
},
"message_type": {
"description": "Type of message",
"enum": [
"instruction_set"
],
"example": "instruction_set",
"type": "string"
}
},
"required": [
"message_type",
"files"
],
"type": "object"
},
"type": "array"
},
"message_type": {
"description": "Type of message",
"enum": [
......
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