Commit 7096e360 authored by Trishna Saeharaseelan's avatar Trishna Saeharaseelan
Browse files

Merge branch '29-emergency-mission-plan' into 'dev'

feat: add emergency flag to mission plan schema

Closes #29

See merge request !21
......@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
### Changed
- Updated README to run tests against JS dependencies
### Added
- Emergency flag in mission plan schemas
## [v0.1.0] - 2023-03-24
### Added
......
......@@ -74,10 +74,15 @@ Run the command below and go to `http://127.0.0.1:5000`
python3 generate_schema_config.py
```
## Run Tests
Run the command below
Run both tests below:
1. Test 1
```
python3 -m unittest tests/test_schemas.py
```
2. Test 2
```
cd tests-js/docker; docker compose up --build
```
## Quick Links
1. [Generated Swagger Docs (recommended to look at this)](https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/-/blob/dev/project/soar/swagger.json)
......
{
"header": {
"message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd",
"timestamp": "2022-11-16T00:00:00Z",
"version": 2,
"source": "gui",
"destination": "soar.noc.autosub.alr-52.to_platform.mission_plan",
"delivery_type": "publish",
"encoded": false
},
"payload":{
"message_type": "mission_plan",
"platform_ID": "5-ah1",
"autonomy_engine_plan_ID": 1,
"emergency": true,
"plan": [
{
"action": "safety_abort",
"target_waypoint_latitude": -3.237143188645706,
"target_waypoint_longitude": 52.37072283932642
}
]
}
}
\ No newline at end of file
{
"header": {
"message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd",
"timestamp": "2022-11-16T00:00:00Z",
"version": 2,
"source": "gui",
"destination": "soar.noc.autosub.alr-52.to_platform.mission_plan",
"delivery_type": "publish",
"encoded": false
},
"payload":{
"message_type": "mission_plan",
"platform_ID": "5-ah1",
"autonomy_engine_plan_ID": 1,
"emergency": true,
"plan": [
{
"action": "move",
"target_waypoint_latitude": -3.237143188645706,
"target_waypoint_longitude": 52.37072283932642,
"depth": 5.0
},
{
"action": "safety_abort",
"target_waypoint_latitude": -3.237143188645706,
"target_waypoint_longitude": 52.37072283932642
}
]
}
}
\ No newline at end of file
{
"header": {
"message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd",
"timestamp": "2022-11-16T00:00:00Z",
"version": 2,
"source": "gui",
"destination": "soar.noc.autosub.alr-52.to_platform.mission_plan",
"delivery_type": "publish",
"encoded": false
},
"payload":{
"message_type": "mission_plan",
"platform_ID": "5-ah1",
"autonomy_engine_plan_ID": 1,
"emergency": true,
"plan": [
{
"action": "safety_abort",
"target_waypoint_latitude": -3.237143188645706,
"target_waypoint_longitude": 52.37072283932642
}
]
}
}
\ No newline at end of file
{
"header": {
"message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd",
"timestamp": "2022-11-16T00:00:00Z",
"version": 2,
"source": "gui",
"destination": "soar.noc.autosub.alr-52.to_platform.mission_plan",
"delivery_type": "publish",
"encoded": false
},
"payload":{
"message_type": "mission_plan",
"platform_ID": "5-ah1",
"autonomy_engine_plan_ID": 1,
"emergency": true,
"plan": [
{
"action": "move",
"target_waypoint_latitude": -3.237143188645706,
"target_waypoint_longitude": 52.37072283932642,
"depth": 5.0
},
{
"action": "safety_abort",
"target_waypoint_latitude": -3.237143188645706,
"target_waypoint_longitude": 52.37072283932642
}
]
}
}
\ No newline at end of file
......@@ -44,7 +44,7 @@ message_header = {
"encoded": {
"type": "boolean",
"description": "Indicate that message raw (encoded) or decoded. "
+ "Options: encoded=True, decoded=False",
+ "Options: encoded=true, decoded=false",
"example": False,
},
"delivery_type": {
......
......@@ -32,8 +32,8 @@ encoded_schema = {
"is_binary": {
"type": "boolean",
"description": (
"True if the data field contains binary format data encoded as base64."
+ " False if the data field contains ascii content such as NMEA."
"true if the data field contains binary format data encoded as base64."
+ " false if the data field contains ascii content such as NMEA."
),
"example": True,
},
......
......@@ -88,6 +88,13 @@ mission_plan_schema = {
"description": "Unique identifier for this platform",
"example": "reav-x-1",
},
"emergency": {
"type": "boolean",
"description": "To indicate if this is an emergency. "
+ "true = emergency and false = no emergency",
"default": False,
"example": False,
},
"plan": {
"type": "array",
"items": action_schema,
......
......@@ -14,7 +14,7 @@ sensor_schema = {
},
"sensor_on": {
"type": "boolean",
"description": "Sensor switched on (True) or off (False)",
"description": "Sensor switched on (true) or off (false)",
"example": True,
},
"additional_data": {
......
......@@ -71,7 +71,7 @@
"type":"string"
},
"encoded":{
"description":"Indicate that message raw (encoded) or decoded. Options: encoded=True, decoded=False",
"description":"Indicate that message raw (encoded) or decoded. Options: encoded=true, decoded=false",
"example":false,
"type":"boolean"
},
......@@ -115,6 +115,12 @@
"example":"mission_plan",
"type":"string"
},
"emergency": {
"default": false,
"description": "To indicate if this is an emergency. true = emergency and false = no emergency",
"example": false,
"type": "boolean"
},
"plan":{
"items":{
"properties":{
......@@ -206,7 +212,7 @@
"type":"string"
},
"is_binary":{
"description":"True if the data field contains binary format data encoded as base64. False if the data field contains ascii content such as NMEA.",
"description":"true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.",
"example":true,
"type":"boolean"
},
......@@ -307,7 +313,7 @@
"type":"string"
},
"is_binary":{
"description":"True if the data field contains binary format data encoded as base64. False if the data field contains ascii content such as NMEA.",
"description":"true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.",
"example":true,
"type":"boolean"
},
......@@ -710,7 +716,7 @@
"type":"object"
},
"sensor_on":{
"description":"Sensor switched on (True) or off (False)",
"description":"Sensor switched on (true) or off (false)",
"example":true,
"type":"boolean"
},
......@@ -789,7 +795,7 @@
"type":"string"
},
"is_binary":{
"description":"True if the data field contains binary format data encoded as base64. False if the data field contains ascii content such as NMEA.",
"description":"true if the data field contains binary format data encoded as base64. false if the data field contains ascii content such as NMEA.",
"example":true,
"type":"boolean"
},
......
......@@ -35,7 +35,7 @@ message_header = {
"encoded": {
"type": "boolean",
"description": "Indicate that message raw (encoded) or decoded. "
+ "Options: encoded=True, decoded=False",
+ "Options: encoded=true, decoded=false",
"example": False,
},
"delivery_type": {
......@@ -165,6 +165,13 @@ mission_plan_schema = {
"description": "Unique identifier for this platform",
"example": "reav-x-1",
},
"emergency": {
"default": False,
"description": "To indicate if this is an emergency. "
+ "true = emergency and false = no emergency",
"example": False,
"type": "boolean",
},
"plan": {
"type": "array",
"items": action_schema,
......@@ -430,7 +437,7 @@ sensor_schema = {
},
"sensor_on": {
"type": "boolean",
"description": "Sensor switched on (True) or off (False)",
"description": "Sensor switched on (true) or off (false)",
"example": True,
},
"additional_data": {
......
......@@ -69,7 +69,7 @@
"type": "string"
},
"encoded": {
"description": "Indicate that message raw (encoded) or decoded. Options: encoded=True, decoded=False",
"description": "Indicate that message raw (encoded) or decoded. Options: encoded=true, decoded=false",
"example": false,
"type": "boolean"
},
......@@ -110,6 +110,12 @@
"example": "mission_plan",
"type": "string"
},
"emergency": {
"default": false,
"description": "To indicate if this is an emergency. true = emergency and false = no emergency",
"example": false,
"type": "boolean"
},
"plan": {
"items": {
"properties": {
......@@ -586,7 +592,7 @@
}
},
"sensor_on": {
"description": "Sensor switched on (True) or off (False)",
"description": "Sensor switched on (true) or off (false)",
"example": true,
"type": "boolean"
},
......
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