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