Commit 5893b2d4 authored by Trishna Saeharaseelan's avatar Trishna Saeharaseelan
Browse files

feat: add emergency flag to mission plan schema

......@@ -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
......@@ -12,6 +12,7 @@
"message_type": "mission_plan",
"platform_ID": "5-ah1",
"autonomy_engine_plan_ID": 1,
"emergency": false,
"plan": [
{
"action": "move",
......
......@@ -12,6 +12,7 @@
"message_type": "mission_plan",
"platform_ID": "ecosub-2",
"autonomy_engine_plan_ID": 1,
"emergency": false,
"plan": [
{
"action": "move",
......
......@@ -12,6 +12,7 @@
"message_type": "mission_plan",
"platform_ID": "reav-60-1",
"autonomy_engine_plan_ID": 1,
"emergency": false,
"plan": [
{
"target_waypoint_latitude": -4.187143188645706,
......
......@@ -12,6 +12,7 @@
"message_type": "mission_plan",
"platform_ID": "ecosub-2",
"autonomy_engine_plan_ID": 1,
"emergency": false,
"plan": [
{
"action": "move",
......
{
"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
......@@ -88,6 +88,12 @@ mission_plan_schema = {
"description": "Unique identifier for this platform",
"example": "reav-x-1",
},
"emergency": {
"type": "boolean",
"description": "To indicate if this is an emergency. 1 = emergency and 0 = no emergency",
"default": False,
"example": False,
},
"plan": {
"type": "array",
"items": action_schema,
......
......@@ -115,6 +115,12 @@
"example":"mission_plan",
"type":"string"
},
"emergency": {
"default": false,
"description": "To indicate if this is an emergency. 1 = emergency and 0 = no emergency",
"example": false,
"type": "boolean"
},
"plan":{
"items":{
"properties":{
......
......@@ -165,6 +165,12 @@ mission_plan_schema = {
"description": "Unique identifier for this platform",
"example": "reav-x-1",
},
"emergency": {
"default": False,
"description": "To indicate if this is an emergency. 1 = emergency and 0 = no emergency",
"example": False,
"type": "boolean"
},
"plan": {
"type": "array",
"items": action_schema,
......
......@@ -110,6 +110,12 @@
"example": "mission_plan",
"type": "string"
},
"emergency": {
"default": false,
"description": "To indicate if this is an emergency. 1 = emergency and 0 = no emergency",
"example": false,
"type": "boolean"
},
"plan": {
"items": {
"properties": {
......
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