""" schema: vehicle-specific decoded status message (DRAFT) """ from . import message_header_schema, vehicle_schema, api from flask_restx import fields vehicle_status_message_schema = api.model( "VehicleStatusMessage", { "message": fields.Nested( message_header_schema, required=True, description="Message header", ), "platform": fields.Nested(vehicle_schema) "time": fields.String( required=True, description="Timestamp of message", example="2022-11-16T00:00:00Z", ), "version": fields.Integer( required=False, description="", # we can track the version of the AE plan? example="", ), "platform_state": fields.String( required=True, description="", example="SAFETY_STOP", ), "mission_track_number": fields.Integer( required=True, description=( "Track number - stage in mission (e.g. " + "4 --> Waypoint 3 to Waypoint 4)" ), example=4, ), "range_to_go": fields.Float( required=False, description="Estimated distance to reach next waypoint", example=124.3, ), "vehicle_state": fields.String( required=True, description="Current state executed by vehicle. E.g. " + "STOP, IDLE, ABORT.", example="IDLE", ), "c2_health_status": fields.String( required=True, description="Health status determined by vehicle's C2 " + "checks on sensors", example="Warning", ), "gps_source": fields.Float( required=True, description="Source of gps position. E.g. Beacon", example="internal", ), "latitude": fields.Float( required=True, description="Latitude in <insert units>", example="", ), "longitude": fields.Float( required=True, description="Longitude in <insert units>", example="", ), "depth": fields.Float( required=True, description="", example="", ), "gps_fix_seconds_ago": fields.String( required=True, description="", example="", ), "battery_voltage": fields.Float( required=True, description="Volts", example=23.0, ), "battery_current": fields.Float( required=False, description="Amps", example=1.2, ), "battery_current_per_hour": fields.Float( required=False, description="Amp-Hours", example=1.2, ), "battery_wattage": fields.Float( required=False, description="Watts", example=23.0, ), "battery_wattage_per_hour": fields.Float( required=False, description="Watt-Hours", example=23.0, ), }, ) # TBD: Do we append beacon positions with vehicle positions?