diff --git a/examples/ecosub_c2/platform_status.json b/examples/ecosub_c2/platform_status.json index ab543803c8454588bea9e3ea40dbfa27375dd4ff..2ea2a3748c09615f154e5bbbe1fbbbc2cb306cfb 100644 --- a/examples/ecosub_c2/platform_status.json +++ b/examples/ecosub_c2/platform_status.json @@ -20,6 +20,7 @@ "longitude": -10.122, "depth": 50, "altitude": 20, + "heading": 90.0, "health_status": "Warning", "localisation_error": null, "usbl_fix_seconds_ago": null, diff --git a/examples/hydrosurv_adapter/platform_status.json b/examples/hydrosurv_adapter/platform_status.json index dc24112255a1946bf5e9b238322a1f7d5f237f27..13d7aa2f857027bee373d76c4ae506baf4cdf864 100644 --- a/examples/hydrosurv_adapter/platform_status.json +++ b/examples/hydrosurv_adapter/platform_status.json @@ -11,6 +11,7 @@ "active": true, "status_source": "onboard_platform", "battery_remaining_capacity": 80.2, + "heading": 310.0, "health_status": "Lost Connection", "latitude": 178.2, "longitude": -10.122, diff --git a/formats/planning_configuration.py b/formats/planning_configuration.py index d4fb1e58847cb123730f793101cee4671e183385..4e008a924493b721392310ae08e7ddca2aab900c 100644 --- a/formats/planning_configuration.py +++ b/formats/planning_configuration.py @@ -11,22 +11,23 @@ emergency_schema = { "safe_command": { "type": "string", "enum": ["go_home", "abort_now", "stop_mission"], - "description": "Command/Action that is native to respective partner's platform/C2", + "description": "Command/Action that is native to respective" + + " partner's platform/C2", "example": "go_home", }, "latitude_waypoint": { "type": "number", - "description": "X-coordinate of safe place for respective platform", + "description": "X-coordinate safe place for respective platform", "example": -7.432, }, "longitude_waypoint": { "type": "number", - "description": "Y-coordinate of safe place for respective platform", + "description": "Y-coordinate safe place for respective platform", "example": 50.365, }, "target_depth": { "type": "number", - "description": "Z-coordinate of safe place for respective platform" + "description": "Z-coordinate safe place for respective platform" + " . If platform to NOT stay at depth, key in `0.0`", "example": 10, }, @@ -79,7 +80,15 @@ platform_schema = { "example": {"swath_width": 10.0, "scan_type": "DVL"}, }, }, - "required": ["platform_ID", "serial", "model", "emergency", "min_altitude", "min_velocity", "max_velocity"], + "required": [ + "platform_ID", + "serial", + "model", + "emergency", + "min_altitude", + "min_velocity", + "max_velocity", + ], } region_schema = { diff --git a/formats/platform_status.py b/formats/platform_status.py index 0bb15a5e698926ddaa4a1ab6271871e41eb2ee12..9d08620b096243473b30a0c51825babab09a2540 100644 --- a/formats/platform_status.py +++ b/formats/platform_status.py @@ -117,6 +117,12 @@ platform_status_message_schema = { "description": "TODO: Needs further consideration", "example": 124.3, }, + "heading": { + "type": "number", + "description": "Angular distance relative to north, usually 000°" + + " at north, clockwise through 359°, in degrees", + "example": 124.3, + }, "health_status": { "type": "string", "description": "Health status extracted by respective platform " diff --git a/generate_swagger.py b/generate_swagger.py index dc0657e1291dfa5f7626983ef177e869d913b7d3..99938a0b772ea86ac3734e1c789a7f1239d6aa3e 100644 --- a/generate_swagger.py +++ b/generate_swagger.py @@ -109,8 +109,7 @@ for item in message_types: "schema": { "allOf": [ { - "$ref": "#/components/schemas" - + "/" + item, + "$ref": "#/components/schemas/" + item, }, ], "discriminator": {