Commit c37ec78c authored by Dan Jones's avatar Dan Jones
Browse files

Merge branch '78-update-platform-status-to-accommodate-simulated-wpts' into '67-mas-dt'

Resolve "Update platform status to accommodate simulated  wpts"

See merge request !49
parents bab76ac7 6901b7d7
Pipeline #233805 passed with stages
in 1 minute and 7 seconds
......@@ -22,7 +22,7 @@
"type": "Point",
"coordinates": [
-10.122,
178.2,
78.2,
50.0,
20
]
......@@ -31,7 +31,7 @@
"type": "Point",
"coordinates": [
-10.5,
178.5
78.5
]
}
}
......
{
"header":{
"message_ID": "b427003c-0000-11aa-a1eb-b1cdf2342fdd",
"timestamp": "2024-09-05T00:00:00Z",
"version": "v2.0.0-beta.1",
"source": "noc-sfmc",
"destination": "mas-dt.noc.slocum.unit_xxx.from_platform.waypoints",
"delivery_type": "publish",
"encoded": false
},
"payload":{
"message_type": "waypoints",
"platform_ID": "unit_xxx",
"platform_timestamp": "2024-09-05T00:00:00Z",
"status_source": "simulated",
"waypoints": [
{
"type": "Point",
"coordinates": [-10.122, 78.2, 50.0, 20.0]
}
]
}
}
{
"header":{
"message_ID": "b427003c-0000-11aa-a1eb-b1cdf2342fdd",
"timestamp": "2024-09-05T00:00:00Z",
"version": "v2.0.0-beta.1",
"source": "noc-sfmc",
"destination": "mas-dt.noc.slocum.unit_xxx.from_platform.waypoints",
"delivery_type": "publish",
"encoded": false
},
"payload":{
"message_type": "waypoints",
"platform_ID": "unit_xxx",
"platform_timestamp": "2024-09-05T00:00:00Z",
"status_source": "simulated",
"waypoints": [
{
"latitude": 78.2,
"longitude": -10.122,
"depth": 50.0,
"altitude": 20.0
}
]
}
}
......@@ -5,9 +5,9 @@ payload_schema = {
"alert": "#/components/schemas/alert",
"instruction_set": "#/components/schemas/instruction_set",
"mission_plan": "#/components/schemas/mission_plan",
"mission_plan_encoded": "#/components/schemas/" + "mission_plan_encoded",
"mission_plan_encoded": "#/components/schemas/mission_plan_encoded",
"observation": "#/components/schemas/observation",
"observation_encoded": "#/components/schemas/" + "observation_encoded",
"observation_encoded": "#/components/schemas/observation_encoded",
"planning_configuration": "#/components/schemas/"
+ "planning_configuration",
"platform_status": "#/components/schemas/platform_status",
......@@ -15,7 +15,8 @@ payload_schema = {
+ "platform_status_encoded",
"acknowledgement": "#/components/schemas/acknowledgement",
"survey": "#/components/schemas/survey",
"survey_encoded": "#/components/schemas/" + "survey_encoded",
"survey_encoded": "#/components/schemas/survey_encoded",
"waypoints": "#/components/schemas/waypoints",
},
},
"oneOf": [
......@@ -31,5 +32,6 @@ payload_schema = {
{"$ref": "#/components/schemas/platform_status_encoded"},
{"$ref": "#/components/schemas/survey"},
{"$ref": "#/components/schemas/survey_encoded"},
{"$ref": "#/components/schemas/waypoints"},
],
}
......@@ -25,6 +25,11 @@ sensor_schema = {
},
}
platform_status_core_fields_schema = {
"type": "object",
"properties": {},
}
platform_status_schema = {
"type": "object",
"properties": {
......@@ -41,7 +46,7 @@ platform_status_schema = {
},
"status_source": {
"type": "string",
"enum": ["usbl", "onboard_platform"],
"enum": ["usbl", "onboard_platform", "simulated"],
"description": "Indicate if this status message is from the"
+ " platform or USBL",
"example": "usbl",
......@@ -173,6 +178,27 @@ platform_status_schema = {
"sensor_config": sensor_schema,
},
"oneOf": [
{
"type": "object",
"properties": {
"no_position_reason": {
"type": "string",
"enum": [
"missing",
"invalid",
"old",
"poor_fix",
"unavailable",
"not_applicable",
],
"description": "Why position data is unavailable",
"example": "invalid",
},
},
"required": [
"no_position_reason",
],
},
{
"type": "object",
"properties": {
......
"""
Temporary message definition to handle the MAS-DT dry-run mode
In dry-run the SFMC adapter will receive misson_plan messages from ORI
These messages will be parsed and compiled into a goto file which will
not be sent on to the glider
To confirm the message flow is working the SFMC will instead publish
a waypoints message back to the backbone which C2 can receive and
process - adding simulated waypoints to C2 positions
"""
waypoint_schema = {
"type": "object",
"oneOf": [
{
"$ref": "https://geojson.org/schema/Point.json",
},
{
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "float",
"description": "Latitude (Y-coordinate) in decimal degrees.",
"example": 178.2,
},
"longitude": {
"type": "number",
"format": "float",
"description": "Longitude (X-coordinate) in decimal degrees.",
"example": -10.122,
},
"depth": {
"type": "number",
"format": "float",
"description": "Target depth in metres",
"example": 50.0,
"default": 0.0,
},
"altitude": {
"type": "number",
"format": "float",
"description": "Target altitude in metres",
"example": 20.0,
},
},
"required": [
"latitude",
"longitude",
],
},
],
}
waypoints_schema = {
"type": "object",
"properties": {
"message_type": {
"type": "string",
"description": "Type of message",
"example": "waypoints",
"enum": ["waypoints"],
},
"platform_ID": {
"type": "string",
"description": "Unique identifier for this platform",
"example": "reav-x-1",
},
"status_source": {
"type": "string",
"enum": ["onboard_platform", "simulated", "autonomy"],
"description": "Indicate if this status message is from the"
+ " platform or USBL",
"example": "usbl",
},
"platform_timestamp": {
"type": "string",
"format": "date-time",
"description": "Timestamp for onboard platform status message",
"example": "2022-12-21T00:00:00Z",
},
"waypoints": {
"type": "array",
"items": waypoint_schema,
},
},
"required": [
"message_type",
"platform_ID",
"status_source",
"platform_timestamp",
"waypoints",
],
}
......@@ -7,6 +7,7 @@ from formats.observation_encoded import observation_encoded_schema
from formats.payload import payload_schema
from formats.planning_configuration import planning_configuration_schema
from formats.platform_status import platform_status_schema
from formats.waypoints import waypoints_schema
from formats.platform_status_encoded import platform_status_encoded_schema
from formats.survey import survey_schema
from formats.survey_encoded import survey_encoded_schema
......@@ -74,6 +75,7 @@ def get_swagger_config(reload=False):
"alert": alert_schema,
"instruction_set": instruction_set_schema,
"config_file": config_file_schema,
"waypoints": waypoints_schema,
}
},
}
......
......@@ -1820,7 +1820,8 @@
"platform_status": "#/components/schemas/platform_status",
"platform_status_encoded": "#/components/schemas/platform_status_encoded",
"survey": "#/components/schemas/survey",
"survey_encoded": "#/components/schemas/survey_encoded"
"survey_encoded": "#/components/schemas/survey_encoded",
"waypoints": "#/components/schemas/waypoints"
},
"propertyName": "message_type"
},
......@@ -1860,6 +1861,9 @@
},
{
"$ref": "#/components/schemas/survey_encoded"
},
{
"$ref": "#/components/schemas/waypoints"
}
]
},
......@@ -2208,6 +2212,27 @@
},
"platform_status": {
"oneOf": [
{
"properties": {
"no_position_reason": {
"description": "Why position data is unavailable",
"enum": [
"missing",
"invalid",
"old",
"poor_fix",
"unavailable",
"not_applicable"
],
"example": "invalid",
"type": "string"
}
},
"required": [
"no_position_reason"
],
"type": "object"
},
{
"properties": {
"position": {
......@@ -2417,7 +2442,8 @@
"description": "Indicate if this status message is from the platform or USBL",
"enum": [
"usbl",
"onboard_platform"
"onboard_platform",
"simulated"
],
"example": "usbl",
"type": "string"
......@@ -2628,6 +2654,92 @@
"is_binary"
],
"type": "object"
},
"waypoints": {
"properties": {
"message_type": {
"description": "Type of message",
"enum": [
"waypoints"
],
"example": "waypoints",
"type": "string"
},
"platform_ID": {
"description": "Unique identifier for this platform",
"example": "reav-x-1",
"type": "string"
},
"platform_timestamp": {
"description": "Timestamp for onboard platform status message",
"example": "2022-12-21T00:00:00Z",
"format": "date-time",
"type": "string"
},
"status_source": {
"description": "Indicate if this status message is from the platform or USBL",
"enum": [
"onboard_platform",
"simulated",
"autonomy"
],
"example": "usbl",
"type": "string"
},
"waypoints": {
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/geojson.org.schema.Point.json"
},
{
"properties": {
"altitude": {
"description": "Target altitude in metres",
"example": 20.0,
"format": "float",
"type": "number"
},
"depth": {
"default": 0.0,
"description": "Target depth in metres",
"example": 50.0,
"format": "float",
"type": "number"
},
"latitude": {
"description": "Latitude (Y-coordinate) in decimal degrees.",
"example": 178.2,
"format": "float",
"type": "number"
},
"longitude": {
"description": "Longitude (X-coordinate) in decimal degrees.",
"example": -10.122,
"format": "float",
"type": "number"
}
},
"required": [
"latitude",
"longitude"
],
"type": "object"
}
],
"type": "object"
},
"type": "array"
}
},
"required": [
"message_type",
"platform_ID",
"status_source",
"platform_timestamp",
"waypoints"
],
"type": "object"
}
}
},
......
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