""" schema: platform-specific decoded status message """ sensor_schema = { "type": "object", "description": "Scanning sensor on platform available" + " to be controlled by the Autonomy Engine", "properties": { "sensor_serial": { "type": "string", "description": "serial number of sensor", "example": "mbes-002a", }, "sensor_on": { "type": "boolean", "description": "Sensor switched on (True) or off (False)", "example": True, }, "additional_data": { "type": "null", "description": "Any addition fields/data to be added here", "example": {"payload": [1.2, 434]}, }, }, "required": [], } platform_status_message_schema = { "allOf": [{"$ref": "#/components/schemas/Message"}], "type": "object", "properties": { "platform_ID": { "type": "integer", "description": "Identifier for platform", "example": 1, }, "status_source": { "type": "string", "enum": ["usbl", "onboard_platform"], "description": "Indicate if this status message is from the" + " platform or USBL", "example": "usbl", }, "platform_timestamp": { "type": "string", "format": "date-time", "decription": "Timestamp for onboard platform status message", "example": "2022-12-21T00:00:00Z", }, "active": { "type": "boolean", "description": "When a platform is in deployment (executing a" + " mission plan) this should be True", "example": True, }, "platform_state": { # TODO: Define enum with potential STATES of each platform "type": "string", "description": "Current state executed by platform. E.g. " + "STOP, IDLE, ABORT.", "example": "ABORT", }, "autonomy_engine_plan_ID": { "type": "integer", "description": "Last mission plan ID (according to Autonomy" + " Engine's mission plan number sent) executed by platform", "example": 1, }, "latitude": { "type": "number", "format": "float", "description": "Latitude in decimal degrees.", "example": 178.2, }, "longitude": { "type": "number", "format": "float", "description": "Longitude in decimal degrees.", "example": -10.122, }, "depth": { "type": "number", "format": "float", "description": "Target depth in metres", "example": 50, "default": 0, }, "altitude": { "type": "number", "format": "float", "description": "Target altitude in metres", "example": 20, }, "mission_track_ID": { "type": "integer", "description": "Track number - stage in mission (e.g. " + "4 --> Waypoint 3 to Waypoint 4)", "example": 4, }, "mission_action_ID": { "type": "integer", "description": "", # TODO: Add description "example": 1, }, "range_to_go": { "type": "number", "format": "float", "description": "Estimated distance to reach next waypoint", "example": 124.3, }, "speed_over_ground": { "type": "number", "format": "float", "description": "", # TODO: Add description "example": 124.3, }, "water_current_velocity": { "type": "number", "format": "float", "description": "", # TODO: Add description "example": 124.3, }, "thrust_applied": { "type": "number", "format": "float", "description": "", # TODO: Add description "example": 124.3, }, "heading": { "type": "number", "format": "float", "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 " + "if any diagnosis is available to check sensors", "example": "Warning", }, "localisation_error": { "type": "number", "format": "float", "description": "Localisation error at last USBL update.", "example": 0.000129, }, "usbl_fix_seconds_ago": { "type": "number", "format": "float", "description": "USBL Fix received x second ago.", "example": 10.0, }, "battery_remaining_capacity": { "type": "number", "format": "float", "description": "Battery remaining % provided by respective C2", "example": 80.2, }, "current_pitch": { "type": "number", "format": "float", "description": "Current pitch of platform", "example": -4.0, }, "sensor_config": sensor_schema, }, "required": [ "platform_ID", "status_source", "platform_timestamp", "latitude", "longitude", ], }