"git@git.noc.ac.uk:thopri/PyNEMO.git" did not exist on "96558dc542786a485969d72b0494b34465285bc1"
Verified Commit a0ae5a20 authored by Dan Jones's avatar Dan Jones
Browse files

feat: add waypoint status message for dry-run

Rather than sending a goto to the platform the
sfmc-adapter will publish a waypoint_status message
which the c2-adapter can read and add to the
positions service as a simulated waypoint
parent bab76ac7
......@@ -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-bvcdfghjgfdd",
"timestamp": "2024-09-05T00:00:00Z",
"version": "v2.0.0-beta.1",
"source": "noc-sfmc",
"destination": "mas-dt.noc.slocum.unit_xxx.from_platform.platform_status",
"delivery_type": "publish",
"encoded": false
},
"payload":{
"message_type": "waypoint_status",
"platform_ID": "unit_xxx",
"platform_timestamp": "2024-09-05T00:00:00Z",
"status_source": "simulated",
"autonomy_engine_plan_ID": 1,
"mission_plan_ID": 1,
"mission_track_ID": 4,
"waypoint": {
"type": "Point",
"coordinates": [-10.122, 78.2, 50.0, 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",
"waypoint_status": "#/components/schemas/waypoint_status",
},
},
"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/waypoint_status"},
],
}
......@@ -25,27 +25,14 @@ sensor_schema = {
},
}
platform_status_schema = {
platform_status_core_fields_schema = {
"type": "object",
"properties": {
"message_type": {
"type": "string",
"description": "Type of message",
"example": "platform_status",
"enum": ["platform_status"],
},
"platform_ID": {
"type": "string",
"description": "Unique identifier for this platform",
"example": "reav-x-1",
},
"status_source": {
"type": "string",
"enum": ["usbl", "onboard_platform"],
"description": "Indicate if this status message is from the"
+ " platform or USBL",
"example": "usbl",
},
"transmission_mode": {
"type": "string",
"enum": ["acoustics", "iridium", "wifi", "starlink"],
......@@ -172,7 +159,41 @@ platform_status_schema = {
},
"sensor_config": sensor_schema,
},
}
platform_status_schema = {
"type": "object",
"properties": {
"message_type": {
"type": "string",
"description": "Type of message",
"example": "platform_status",
"enum": ["platform_status"],
},
"status_source": {
"type": "string",
"enum": ["usbl", "onboard_platform", "simulated"],
"description": "Indicate if this status message is from the"
+ " platform or USBL",
"example": "usbl",
},
},
"allOf": [platform_status_core_fields_schema],
"oneOf": [
{
"type": "object",
"properties": {
"no_position_reason": {
"type": "string",
"enum": ["missing", "invalid", "old", "poor_fix"],
"description": "Why position data is unavailable",
"example": "invalid",
},
},
"required": [
"no_position_reason",
],
},
{
"type": "object",
"properties": {
......@@ -254,3 +275,104 @@ platform_status_schema = {
"platform_timestamp",
],
}
waypoint_status_schema = {
"type": "object",
"properties": {
"message_type": {
"type": "string",
"description": "Type of message",
"example": "waypoint_status",
"enum": ["waypoint_status"],
},
"status_source": {
"type": "string",
"enum": ["onboard_platform", "simulated", "autonomy"],
"description": "Indicate if this status message is from the"
+ " platform or USBL",
"example": "usbl",
},
},
"allOf": [platform_status_core_fields_schema],
"oneOf": [
{
"type": "object",
"properties": {
"position": {
"$ref": "https://geojson.org/schema/Point.json",
},
"waypoint": {
"$ref": "https://geojson.org/schema/Point.json",
},
},
"required": [
"waypoint",
],
},
{
"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,
},
"waypoint_latitude": {
"type": "number",
"format": "float",
"description": "Latitude (Y-coordinate) in decimal degrees.",
"example": 178.2,
},
"waypoint_longitude": {
"type": "number",
"format": "float",
"description": "Longitude (X-coordinate) in decimal degrees.",
"example": -10.122,
},
"waypoint_depth": {
"type": "number",
"format": "float",
"description": "Target depth in metres",
"example": 50.0,
"default": 0.0,
},
"waypoint_altitude": {
"type": "number",
"format": "float",
"description": "Target altitude in metres",
"example": 20.0,
},
},
"required": [
"waypoint_latitude",
"waypoint_longitude",
],
},
],
"required": [
"message_type",
"platform_ID",
"status_source",
"platform_timestamp",
],
}
......@@ -6,7 +6,7 @@ from formats.observation import observation_schema
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.platform_status import platform_status_schema, waypoint_status_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 +74,7 @@ def get_swagger_config(reload=False):
"alert": alert_schema,
"instruction_set": instruction_set_schema,
"config_file": config_file_schema,
"waypoint_status": waypoint_status_schema,
}
},
}
......
This diff is collapsed.
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