Commit 691a23b6 authored by Trishna Saeharaseelan's avatar Trishna Saeharaseelan
Browse files

fix: tests and add beacon_ID field per platform

...@@ -78,7 +78,6 @@ ...@@ -78,7 +78,6 @@
"model": "reav", "model": "reav",
"platform_ID": "reav-60-1", "platform_ID": "reav-60-1",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.189772466767039, "target_waypoint_latitude": -4.189772466767039,
"target_waypoint_longitude": 50.33611100020795, "target_waypoint_longitude": 50.33611100020795,
"safe_command": "go_home", "safe_command": "go_home",
...@@ -88,15 +87,13 @@ ...@@ -88,15 +87,13 @@
"max_velocity": 0.9, "max_velocity": 0.9,
"min_velocity": 0.1, "min_velocity": 0.1,
"target_altitude": 0.0, "target_altitude": 0.0,
"turning_radius": null,
"scan_sensor": null,
"additional_data": {} "additional_data": {}
} }
] ]
}, },
{ {
"squad_ID": 2, "squad_ID": 2,
"no_of_platforms": 3, "no_of_platforms": 4,
"squad_mission_type": "survey", "squad_mission_type": "survey",
"platforms": [ "platforms": [
{ {
...@@ -104,7 +101,6 @@ ...@@ -104,7 +101,6 @@
"platform_ID": "ecosub-1", "platform_ID": "ecosub-1",
"model": "ecosub", "model": "ecosub",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.192219151149999, "target_waypoint_latitude": -4.192219151149999,
"target_waypoint_longitude": 50.32933594228737, "target_waypoint_longitude": 50.32933594228737,
"safe_command": "go_home", "safe_command": "go_home",
...@@ -131,7 +127,6 @@ ...@@ -131,7 +127,6 @@
"platform_ID": "ecosub-2", "platform_ID": "ecosub-2",
"model": "ecosub", "model": "ecosub",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.192219151149999, "target_waypoint_latitude": -4.192219151149999,
"target_waypoint_longitude": 50.32775207068519, "target_waypoint_longitude": 50.32775207068519,
"safe_command": "go_home", "safe_command": "go_home",
...@@ -158,7 +153,6 @@ ...@@ -158,7 +153,6 @@
"platform_ID": "ecosub-3", "platform_ID": "ecosub-3",
"model": "ecosub", "model": "ecosub",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.184550412882118, "target_waypoint_latitude": -4.184550412882118,
"target_waypoint_longitude": 50.326744124905844, "target_waypoint_longitude": 50.326744124905844,
"safe_command": "go_home", "safe_command": "go_home",
...@@ -185,7 +179,6 @@ ...@@ -185,7 +179,6 @@
"platform_ID": "ecosub-4", "platform_ID": "ecosub-4",
"model": "ecosub", "model": "ecosub",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.188610333142037, "target_waypoint_latitude": -4.188610333142037,
"target_waypoint_longitude": 50.32616814629094, "target_waypoint_longitude": 50.32616814629094,
"safe_command": "go_home", "safe_command": "go_home",
...@@ -215,10 +208,10 @@ ...@@ -215,10 +208,10 @@
"squad_mission_type": "inspection", "squad_mission_type": "inspection",
"platforms": [ "platforms": [
{ {
"operator": "noc",
"platform_ID": "ah-1", "platform_ID": "ah-1",
"model": "autosub", "model": "autosub",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.19759350502369, "target_waypoint_latitude": -4.19759350502369,
"target_waypoint_longitude": 50.3342284629413, "target_waypoint_longitude": 50.3342284629413,
"safe_command": "abort_now", "safe_command": "abort_now",
......
...@@ -78,7 +78,6 @@ ...@@ -78,7 +78,6 @@
"model": "reav", "model": "reav",
"platform_ID": "reav-60-1", "platform_ID": "reav-60-1",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.189772466767039, "target_waypoint_latitude": -4.189772466767039,
"target_waypoint_longitude": 50.33611100020795, "target_waypoint_longitude": 50.33611100020795,
"safe_command": "go_home", "safe_command": "go_home",
...@@ -88,15 +87,13 @@ ...@@ -88,15 +87,13 @@
"max_velocity": 0.9, "max_velocity": 0.9,
"min_velocity": 0.1, "min_velocity": 0.1,
"target_altitude": 0.0, "target_altitude": 0.0,
"turning_radius": null,
"scan_sensor": null,
"additional_data": {} "additional_data": {}
} }
] ]
}, },
{ {
"squad_ID": 2, "squad_ID": 2,
"no_of_platforms": 3, "no_of_platforms": 4,
"squad_mission_type": "survey", "squad_mission_type": "survey",
"platforms": [ "platforms": [
{ {
...@@ -104,7 +101,6 @@ ...@@ -104,7 +101,6 @@
"platform_ID": "ecosub-1", "platform_ID": "ecosub-1",
"model": "ecosub", "model": "ecosub",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.192219151149999, "target_waypoint_latitude": -4.192219151149999,
"target_waypoint_longitude": 50.32933594228737, "target_waypoint_longitude": 50.32933594228737,
"safe_command": "go_home", "safe_command": "go_home",
...@@ -131,7 +127,6 @@ ...@@ -131,7 +127,6 @@
"platform_ID": "ecosub-2", "platform_ID": "ecosub-2",
"model": "ecosub", "model": "ecosub",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.192219151149999, "target_waypoint_latitude": -4.192219151149999,
"target_waypoint_longitude": 50.32775207068519, "target_waypoint_longitude": 50.32775207068519,
"safe_command": "go_home", "safe_command": "go_home",
...@@ -158,7 +153,6 @@ ...@@ -158,7 +153,6 @@
"platform_ID": "ecosub-3", "platform_ID": "ecosub-3",
"model": "ecosub", "model": "ecosub",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.184550412882118, "target_waypoint_latitude": -4.184550412882118,
"target_waypoint_longitude": 50.326744124905844, "target_waypoint_longitude": 50.326744124905844,
"safe_command": "go_home", "safe_command": "go_home",
...@@ -185,7 +179,6 @@ ...@@ -185,7 +179,6 @@
"platform_ID": "ecosub-4", "platform_ID": "ecosub-4",
"model": "ecosub", "model": "ecosub",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.188610333142037, "target_waypoint_latitude": -4.188610333142037,
"target_waypoint_longitude": 50.32616814629094, "target_waypoint_longitude": 50.32616814629094,
"safe_command": "go_home", "safe_command": "go_home",
...@@ -215,10 +208,10 @@ ...@@ -215,10 +208,10 @@
"squad_mission_type": "inspection", "squad_mission_type": "inspection",
"platforms": [ "platforms": [
{ {
"operator": "noc",
"platform_ID": "ah-1", "platform_ID": "ah-1",
"model": "autosub", "model": "autosub",
"emergency": { "emergency": {
"additional_data": {},
"target_waypoint_latitude": -4.19759350502369, "target_waypoint_latitude": -4.19759350502369,
"target_waypoint_longitude": 50.3342284629413, "target_waypoint_longitude": 50.3342284629413,
"safe_command": "abort_now", "safe_command": "abort_now",
......
from formats.encoded import encoded_schema from formats.encoded import encoded_schema
from copy import deepcopy
mission_plan_encoded_schema = encoded_schema mission_plan_encoded_schema = deepcopy(encoded_schema)
mission_plan_encoded_schema["properties"]["message_type"]["enum"] = [ mission_plan_encoded_schema["properties"]["message_type"]["enum"] = [
"mission_plan_encoded" "mission_plan_encoded"
......
from formats.encoded import encoded_schema from formats.encoded import encoded_schema
from copy import deepcopy
observation_encoded_schema = encoded_schema observation_encoded_schema = deepcopy(encoded_schema)
observation_encoded_schema["properties"]["message_type"]["enum"] = [ observation_encoded_schema["properties"]["message_type"]["enum"] = [
"observation_encoded" "observation_encoded"
......
...@@ -32,11 +32,6 @@ emergency_schema = { ...@@ -32,11 +32,6 @@ emergency_schema = {
+ " . If platform to NOT stay at depth, key in `0.0`", + " . If platform to NOT stay at depth, key in `0.0`",
"example": 10.0, "example": 10.0,
}, },
"additional_data": {
"type": "object",
"description": "Any addition fields/data to be added here",
"example": {},
},
}, },
"required": [ "required": [
"target_waypoint_latitude", "target_waypoint_latitude",
...@@ -95,29 +90,35 @@ platform_schema = { ...@@ -95,29 +90,35 @@ platform_schema = {
"type": "string", "type": "string",
"example": "reav", "example": "reav",
}, },
"beacon_ID": {
"type": "number",
"description": "Unique identifier (number) for the beacon "
+ "associated to this platform",
"example": 9407,
},
"emergency": emergency_schema, "emergency": emergency_schema,
"min_altitude": { "min_altitude": {
"type": "number", "type": "number",
"format": "float", "format": "float",
"description": "Minimum altitude set for plaform.", "description": "Minimum altitude set for platform",
"example": 15.2, "example": 15.2,
}, },
"min_velocity": { "min_velocity": {
"type": "number", "type": "number",
"format": "float", "format": "float",
"description": "Minimum velocity set for plaform.", "description": "Minimum velocity set for platform",
"example": 0.1, "example": 0.1,
}, },
"max_velocity": { "max_velocity": {
"type": "number", "type": "number",
"format": "float", "format": "float",
"description": "Maximum altitude set for plaform.", "description": "Maximum altitude set for platform",
"example": 0.9, "example": 0.9,
}, },
"target_altitude": { "target_altitude": {
"type": "number", "type": "number",
"format": "float", "format": "float",
"description": "Target altitude set for plaform. This affects swath width", "description": "Target altitude set for platform. This affects swath width",
"example": 15.0, "example": 15.0,
}, },
"turning_radius": { "turning_radius": {
...@@ -134,6 +135,7 @@ platform_schema = { ...@@ -134,6 +135,7 @@ platform_schema = {
}, },
}, },
"required": [ "required": [
"operator",
"platform_ID", "platform_ID",
"model", "model",
"emergency", "emergency",
...@@ -150,11 +152,11 @@ region_schema = { ...@@ -150,11 +152,11 @@ region_schema = {
"type": "array", "type": "array",
"example": [ "example": [
[ [
[-4.187143188645706, 50.37072283932642], [-4.1777839187560915, 50.34173405662855],
[-4.202697005964865, 50.368816892405874], [-4.1777839187560915, 50.33820949229701],
[-4.203156724702808, 50.365640144076906], [-4.143667777943875, 50.33820949229701],
[-4.19449868846155, 50.362267670845654], [-4.143667777943875, 50.34173405662855],
[-4.187143188645706, 50.37072283932642], [-4.1777839187560915, 50.34173405662855],
] ]
], ],
}, },
......
from formats.encoded import encoded_schema from formats.encoded import encoded_schema
from copy import deepcopy
platform_status_encoded_schema = encoded_schema platform_status_encoded_schema = deepcopy(encoded_schema)
platform_status_encoded_schema["properties"]["message_type"]["enum"] = [ platform_status_encoded_schema["properties"]["message_type"]["enum"] = [
"platform_status_encoded" "platform_status_encoded"
......
...@@ -219,9 +219,9 @@ ...@@ -219,9 +219,9 @@
"message_type":{ "message_type":{
"description":"Type of message", "description":"Type of message",
"enum":[ "enum":[
"platform_status_encoded" "mission_plan_encoded"
], ],
"example":"platform_status_encoded", "example":"mission_plan_encoded",
"type":"string" "type":"string"
}, },
"mime_type":{ "mime_type":{
...@@ -320,9 +320,9 @@ ...@@ -320,9 +320,9 @@
"message_type":{ "message_type":{
"description":"Type of message", "description":"Type of message",
"enum":[ "enum":[
"platform_status_encoded" "observation_encoded"
], ],
"example":"platform_status_encoded", "example":"observation_encoded",
"type":"string" "type":"string"
}, },
"mime_type":{ "mime_type":{
...@@ -389,24 +389,24 @@ ...@@ -389,24 +389,24 @@
"example":[ "example":[
[ [
[ [
-4.187143188645706, -4.1777839187560915,
50.37072283932642 50.34173405662855
], ],
[ [
-4.202697005964865, -4.1777839187560915,
50.368816892405874 50.33820949229701
], ],
[ [
-4.203156724702808, -4.143667777943875,
50.365640144076906 50.33820949229701
], ],
[ [
-4.19449868846155, -4.143667777943875,
50.362267670845654 50.34173405662855
], ],
[ [
-4.187143188645706, -4.1777839187560915,
50.37072283932642 50.34173405662855
] ]
] ]
], ],
...@@ -439,24 +439,24 @@ ...@@ -439,24 +439,24 @@
"example":[ "example":[
[ [
[ [
-4.187143188645706, -4.1777839187560915,
50.37072283932642 50.34173405662855
], ],
[ [
-4.202697005964865, -4.1777839187560915,
50.368816892405874 50.33820949229701
], ],
[ [
-4.203156724702808, -4.143667777943875,
50.365640144076906 50.33820949229701
], ],
[ [
-4.19449868846155, -4.143667777943875,
50.362267670845654 50.34173405662855
], ],
[ [
-4.187143188645706, -4.1777839187560915,
50.37072283932642 50.34173405662855
] ]
] ]
], ],
...@@ -487,15 +487,13 @@ ...@@ -487,15 +487,13 @@
}, },
"type":"object" "type":"object"
}, },
"beacon_ID":{
"description":"Unique identifier (number) for the beacon associated to this platform",
"example":9407,
"type":"number"
},
"emergency":{ "emergency":{
"properties":{ "properties":{
"additional_data":{
"description":"Any addition fields/data to be added here",
"example":{
},
"type":"object"
},
"safe_command":{ "safe_command":{
"description":"Command/Action that is native to respective partner's platform/C2", "description":"Command/Action that is native to respective partner's platform/C2",
"enum":[ "enum":[
...@@ -533,19 +531,19 @@ ...@@ -533,19 +531,19 @@
"type":"object" "type":"object"
}, },
"max_velocity":{ "max_velocity":{
"description":"Maximum altitude set for plaform.", "description":"Maximum altitude set for platform",
"example":0.9, "example":0.9,
"format":"float", "format":"float",
"type":"number" "type":"number"
}, },
"min_altitude":{ "min_altitude":{
"description":"Minimum altitude set for plaform.", "description":"Minimum altitude set for platform",
"example":15.2, "example":15.2,
"format":"float", "format":"float",
"type":"number" "type":"number"
}, },
"min_velocity":{ "min_velocity":{
"description":"Minimum velocity set for plaform.", "description":"Minimum velocity set for platform",
"example":0.1, "example":0.1,
"format":"float", "format":"float",
"type":"number" "type":"number"
...@@ -568,13 +566,13 @@ ...@@ -568,13 +566,13 @@
"properties":{ "properties":{
"angle":{ "angle":{
"description":"Angle of range of swath width (in degrees)", "description":"Angle of range of swath width (in degrees)",
"example": 140.0, "example":140.0,
"format":"float", "format":"float",
"type":"number" "type":"number"
}, },
"frequency":{ "frequency":{
"description":"Frequency of scanning sensor (in kHz)", "description":"Frequency of scanning sensor (in kHz)",
"example": 700.0, "example":700.0,
"format":"float", "format":"float",
"type":"number" "type":"number"
}, },
...@@ -589,7 +587,7 @@ ...@@ -589,7 +587,7 @@
}, },
"swath_width":{ "swath_width":{
"description":"Function of `target_altitude` for the platform's swath width (in metres)", "description":"Function of `target_altitude` for the platform's swath width (in metres)",
"example": 38.0, "example":38.0,
"format":"float", "format":"float",
"type":"number" "type":"number"
} }
...@@ -597,7 +595,7 @@ ...@@ -597,7 +595,7 @@
"type":"object" "type":"object"
}, },
"target_altitude":{ "target_altitude":{
"description":"Target altitude set for plaform. This affects swath width", "description":"Target altitude set for platform. This affects swath width",
"example":15.0, "example":15.0,
"format":"float", "format":"float",
"type":"number" "type":"number"
...@@ -610,6 +608,7 @@ ...@@ -610,6 +608,7 @@
} }
}, },
"required":[ "required":[
"operator",
"platform_ID", "platform_ID",
"model", "model",
"emergency", "emergency",
......
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