Commit 1b8ad63e authored by Trishna Saeharaseelan's avatar Trishna Saeharaseelan
Browse files

fix(formats): corrected type and examples definitions#

...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"delivery_type": "publish", "delivery_type": "publish",
"encoded": false, "encoded": false,
"message_type": "mission_plan", "message_type": "mission_plan",
"platform_serial": "reav-60", "platform_ID": 1,
"autonomy_engine_mission_plan_ID": 1, "autonomy_engine_mission_plan_ID": 1,
"plan": [ "plan": [
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"delivery_type": "publish", "delivery_type": "publish",
"encoded": false, "encoded": false,
"message_type": "mission_plan", "message_type": "mission_plan",
"platform_serial": "reav-60", "platform_ID": 5,
"autonomy_engine_plan_ID": 1, "autonomy_engine_plan_ID": 1,
"plan": [ "plan": [
{ {
......
# from flask_restx import fields
# from . import api
import os import os
...@@ -8,102 +6,3 @@ __all__ = [ ...@@ -8,102 +6,3 @@ __all__ = [
for x in os.listdir(os.path.dirname(__file__)) for x in os.listdir(os.path.dirname(__file__))
if x.endswith(".py") and x != "__init__.py" if x.endswith(".py") and x != "__init__.py"
] ]
# TODO: Define units for all schemas
# message_types = [
# "platform_status",
# "mission_plan_ecosub",
# "mission_plan_reav",
# "mission_plan_autosub",
# ] # TODO: Add full range of message types once scoped out
# full_message_schema = api.model(
# "FullMessageSchema",
# {
# "message_ID": fields.String(
# required=True,
# description="UUID assigned to this message",
# example="b427003c-7bc8-11ed-a1eb-0242ac120002",
# ),
# "timestamp": fields.DateTime(
# required=True,
# description="Timestamp of message",
# example="2022-11-16T00:00:00Z",
# ),
# "version": fields.Float(
# required=True,
# description="Version of comms bacbone messaging format protocol",
# example=2.0,
# ),
# "source": fields.String(
# required=True,
# description="Where is this message from",
# example="autonomy_engine",
# ),
# "destination": fields.String(
# required=True,
# description="What is the destination of this message",
# example="ah-1",
# ),
# "encoded": fields.Boolean(
# required=True,
# description="Indicate that message raw (encoded) or decoded. "
# + "Options: encoded=True, decoded=False",
# example=False,
# ),
# "type": fields.String(
# required=True,
# description="Type of message",
# example="platform_status",
# ),
# "payload": fields.Raw(
# required=True,
# description="Content of Message",
# # example="{}",
# ),
# },
# )
# constraints_schema = api.model(
# "ConstraintsSchema",
# {
# "min_altitude": fields.Float(
# required=True,
# description="Minimum altitude set for squad.",
# example=15.2,
# ),
# "min_velocity": fields.Float(
# required=True,
# description="Minimum velocity set for squad.",
# example=0.1,
# ),
# "max_velocity": fields.Float(
# required=True,
# description="Maximum altitude set for squad.",
# example=0.9,
# ),
# },
# )
# platform_schema = api.model(
# "PlatformSchema",
# {
# "platform_ID": fields.Integer(
# required=True,
# description="unique identifier for platform",
# example=1,
# ),
# "serial": fields.String(
# required=True,
# description="platform serial number",
# example="reav-60",
# ),
# "model": fields.String(
# required=True,
# description="platform serial number",
# example="reav",
# ),
# "constraints": fields.Nested(constraints_schema),
# },
# )
...@@ -14,34 +14,13 @@ acknowledgement_schema = { ...@@ -14,34 +14,13 @@ acknowledgement_schema = {
}, },
"status": { "status": {
"type": "string", "type": "string",
"enum": ["c2_received", "operator_approved_and_sent", "executed"],
"description": "Highest level of acknowledgement. I.e." "description": "Highest level of acknowledgement. I.e."
+ " `c2_received`: Received by C2, `c2_sent`: Sent from" + " `c2_received`: Received by C2, `operator_approved_and_sent`"
+ " C2->Platform, `executed`: Executed by platform", + " : Approved by operator and sent from C2->Platform,"
+ " `executed`: Executed by platform",
"example": "executed by platform", "example": "executed by platform",
}, },
}, },
"required": ["acknowledged_message_ID", "status"], "required": ["acknowledged_message_ID", "status"],
} }
# acknowledgement_schema = api.model(
# "Acknowledgement",
# {
# "message": fields.Nested(
# full_message_schema,
# required=True,
# description="Message header",
# ),
# "message_ID": fields.Integer(
# required=True,
# description="Identifier of message received and executed with "
# + "success for mission plans sent by the Autonomy Engine.",
# example=202,
# ),
# "status": fields.String(
# required=True,
# description="Highest level of acknowledgement. "
# + " I.e. `c2_received`: Received by C2, `c2_sent`:"
# + " Sent from C2->Platform, `executed`: Executed by platform",
# ),
# },
# )
...@@ -16,18 +16,20 @@ message_wrapper_schema = { ...@@ -16,18 +16,20 @@ message_wrapper_schema = {
"example": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", "example": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd",
}, },
"timestamp": { "timestamp": {
"type": "date-time", "type": "string",
"format": "date-time",
"description": "Timestamp of message", "description": "Timestamp of message",
"example": "2022-11-16T00:00:00Z", "example": "2022-11-16T00:00:00Z",
}, },
"message_type": { "message_type": {
"type": "Type of message", "type": "string",
"description": "Type of message", "description": "Type of message",
"example": "platform_status", "example": "platform_status",
}, },
"version": { "version": {
"type": "string", "type": "number",
"description": "Version of comms bacbone message format protocol", "format": "float",
"description": "Version of comms backbone message format protocol",
"example": 2.0, "example": 2.0,
}, },
"source": { "source": {
......
""" """
schemas: Mission plan (un-compiled) geenrated by the Autonomy Engine schemas: Mission plan (un-compiled) generated by the Autonomy Engine
sent to the respective platform's C2 to compile into a platform-specific sent to the respective platform's C2 to compile into a platform-specific
mission plan. mission plan.
""" """
# from . import api, full_message_schema
# from flask_restx import fields
action_schema = { action_schema = {
"type": "object", "type": "object",
...@@ -23,21 +21,25 @@ action_schema = { ...@@ -23,21 +21,25 @@ action_schema = {
}, },
"latitude_waypoint": { "latitude_waypoint": {
"type": "number", "type": "number",
"format": "float",
"description": "Next waypoint, x-coordinate", "description": "Next waypoint, x-coordinate",
"example": -4.187143188645706, "example": -4.187143188645706,
}, },
"longitude_waypoint": { "longitude_waypoint": {
"type": "number", "type": "number",
"format": "float",
"description": "Next waypoint, y-coordinate", "description": "Next waypoint, y-coordinate",
"example": 50.37072283932642, "example": 50.37072283932642,
}, },
"altitude": { "altitude": {
"type": "number", "type": "number",
"format": "float",
"description": "Altitude of next action", "description": "Altitude of next action",
"example": 15.0, "example": 15.0,
}, },
"depth": { "depth": {
"type": "number", "type": "number",
"format": "float",
"description": "Depth of next action", "description": "Depth of next action",
"example": 15.0, "example": 15.0,
}, },
...@@ -64,90 +66,21 @@ mission_plan_schema = { ...@@ -64,90 +66,21 @@ mission_plan_schema = {
"allOf": [{"$ref": "#/components/schemas/Message"}], "allOf": [{"$ref": "#/components/schemas/Message"}],
"type": "object", "type": "object",
"properties": { "properties": {
"autonomy_engine_plan_ID": {"type": "integer"}, "autonomy_engine_plan_ID": {
"platform_serial": {"type": "string"}, "type": "integer",
"description": "Unique identifier for this plan"
+ "generated by the Autonomy Engine",
"example": 3,
},
"platform_ID": {
"type": "integer",
"description": "Unique identifier for this platform",
"example": 1,
},
"plan": { "plan": {
"type": "array", "type": "array",
"items": action_schema, "items": action_schema,
}, },
}, },
"required": ["plan_ID", "platform_serial", "plan"], "required": ["plan_ID", "platform_ID", "plan"],
} }
# action_schema = api.model(
# "AutonomyEngineAction",
# {
# "action": fields.String(
# required=True,
# description="Autonomy Engine's action from `move`, `payload`,"
# + " `dive`, `send_hits`, `scanline`, `scanpoint`.",
# example="move",
# ),
# "flight_style": fields.String(
# required=False,
# description="Platform-specific modes/flight styles to perform"
# + " next action",
# example="orbit",
# ),
# "latitude_waypoint": fields.Float(
# required=True,
# description="Next waypoint, x-coordinate",
# example=-4.187143188645706,
# ),
# "longitude_waypoint": fields.Float(
# required=True,
# description="Next waypoint, y-coordinate",
# example=50.37072283932642,
# ),
# "altitude": fields.Float(
# required=False,
# description="Altitude of next action",
# example=15.0,
# ),
# "depth": fields.Float(
# required=False,
# description="Depth of next action",
# example=15.0,
# ),
# "activate_payload": fields.Boolean(
# required=False,
# description="To activate/deactivate sensor for Autosub "
# + "Hover-1 --> `MBES` sensor and for EcoSUB --> `Sidescan`",
# example=True,
# ),
# "send_environmental_data": fields.Boolean(
# required=False,
# description="To trigger the platform to send list of"
# + " observations if any found",
# example=False,
# ),
# },
# )
# mission_plan_schema = api.model(
# "MissionPlan",
# {
# "message": fields.Nested(
# full_message_schema,
# required=True,
# description="Message header",
# ),
# "plan_ID": fields.Integer(
# required=True,
# description="Identifier of given mission sequence planned",
# example=1,
# ),
# "platform_serial": fields.String(
# required=True,
# description="Serial of target platform to send mission to",
# example="reav-60",
# ),
# "plan": fields.List(
# fields.Nested(action_schema),
# required=True,
# description="Sequence of actions/instructions generated by the"
# + " Autonomy Engine that should be compiled by the",
# + " respective C2.",
# ),
# },
# )
...@@ -2,30 +2,31 @@ ...@@ -2,30 +2,31 @@
schema: Observation Message sent by platforms when points of schema: Observation Message sent by platforms when points of
interest are found. interest are found.
""" """
# from . import full_message_schema, api
# from flask_restx import fields
hits_schema = { hits_schema = {
"type": "object", "type": "object",
"properties": { "properties": {
"latitude": { "latitude": {
"type": "number", "type": "number",
"format": "float",
"description": "Identified x-coordinate of point of interest", "description": "Identified x-coordinate of point of interest",
"example": 178.2, "example": 178.2,
}, },
"longitude": { "longitude": {
"type": "number", "type": "number",
"format": "float",
"description": "Identified y-coordinate of point of interest", "description": "Identified y-coordinate of point of interest",
"example": -10.122, "example": -10.122,
}, },
"quality_of_point": { "quality_of_point": {
"type": "number", "type": "number",
"format": "float",
"description": "Quality/strength of points from features of" "description": "Quality/strength of points from features of"
+ " interest identified by platform. TODO: DEFINE FORMAT.", + " interest identified by platform.", # TODO: DEFINE FORMAT.
"example": 0.98, "example": 0.98,
}, },
}, },
"required": [], "required": ["latitude", "longitude"],
} }
observation_schema = { observation_schema = {
...@@ -35,19 +36,18 @@ observation_schema = { ...@@ -35,19 +36,18 @@ observation_schema = {
"platform_ID": { "platform_ID": {
"type": "integer", "type": "integer",
"description": "ID of platform to sending observations", "description": "ID of platform to sending observations",
"example": "ecosub-3", "example": 2,
}, },
# "observation_type" ==> payloads tied to different types maybe?
# properties of each observation?
"points_of_interest": { "points_of_interest": {
"type": "array", "type": "array",
"items": hits_schema, "items": hits_schema,
"description": "Points from features of interest identified by" "description": "Points from features of interest identified by"
+ " platform if any found. DEFINE FORMAT.", + " platform if any found.", # TODO: DEFINE FORMAT.
}, },
"region_surveyed": { "region_surveyed": {
"description": "Region surveyed by given platform. DEFINE FORMAT." "type": "null",
+ " GEOJSON", "description": "Region surveyed by given platform."
+ " GEOJSON", # TODO: DEFINE FORMAT.
"example": "", "example": "",
}, },
"additional_data": { "additional_data": {
...@@ -55,46 +55,5 @@ observation_schema = { ...@@ -55,46 +55,5 @@ observation_schema = {
"example": {"sensor_payload": False}, "example": {"sensor_payload": False},
}, },
}, },
"required": ["platform_serial"], "required": ["platform_ID"],
} }
# observation_schema = api.model(
# "Observation",
# {
# "message": fields.Nested(
# full_message_schema,
# required=True,
# description="Message header",
# ),
# "platform_serial": fields.String(
# required=True,
# description="Serial of platform to sendign observations",
# example="ecosub-3",
# ),
# # "observation_type" ==> payloads tied to different types maybe?
# # properties of each observation?
# "points_of_interest": fields.Float(
# required=False,
# description="Points from features of interest identified by"
# + " platform if any found. DEFINE FORMAT.",
# example="",
# ),
# "region_surveyed": fields.Float(
# required=False,
# description="Region surveyed by given platform. DEFINE FORMAT."
# + " GEOJSON?",
# example="",
# ),
# "quality_of_points": fields.Float(
# required=False,
# description="Quality/strength of points from features of"
# + " interest identified by platform. DEFINE FORMAT.",
# example=0.98,
# ),
# "additional_data": fields.Raw(
# required=False,
# description="Placeholder field for any additional data",
# example={"sensor_payload": False},
# ),
# },
# )
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
schemas: configuration sent to Autonomy Engine (i.e. during an emergency, schemas: configuration sent to Autonomy Engine (i.e. during an emergency,
if a platform needs to be removed from the mission planning) if a platform needs to be removed from the mission planning)
""" """
# from . import api, full_message_schema, platform_schema
# from flask_restx import fields
emergency_schema = { emergency_schema = {
"type": "object", "type": "object",
...@@ -17,16 +15,19 @@ emergency_schema = { ...@@ -17,16 +15,19 @@ emergency_schema = {
}, },
"latitude_waypoint": { "latitude_waypoint": {
"type": "number", "type": "number",
"format": "float",
"description": "X-coordinate safe place for respective platform", "description": "X-coordinate safe place for respective platform",
"example": -7.432, "example": -7.432,
}, },
"longitude_waypoint": { "longitude_waypoint": {
"type": "number", "type": "number",
"format": "float",
"description": "Y-coordinate safe place for respective platform", "description": "Y-coordinate safe place for respective platform",
"example": 50.365, "example": 50.365,
}, },
"target_depth": { "target_depth": {
"type": "number", "type": "number",
"format": "float",
"description": "Z-coordinate safe place for respective platform" "description": "Z-coordinate safe place for respective platform"
+ " . If platform to NOT stay at depth, key in `0.0`", + " . If platform to NOT stay at depth, key in `0.0`",
"example": 10, "example": 10,
...@@ -61,16 +62,19 @@ platform_schema = { ...@@ -61,16 +62,19 @@ platform_schema = {
"emergency": emergency_schema, "emergency": emergency_schema,
"min_altitude": { "min_altitude": {
"type": "number", "type": "number",
"format": "float",
"description": "Minimum altitude set for squad.", "description": "Minimum altitude set for squad.",
"example": 15.2, "example": 15.2,
}, },
"min_velocity": { "min_velocity": {
"type": "number", "type": "number",
"format": "float",
"description": "Minimum velocity set for squad.", "description": "Minimum velocity set for squad.",
"example": 0.1, "example": 0.1,
}, },
"max_velocity": { "max_velocity": {
"type": "number", "type": "number",
"format": "float",
"description": "Maximum altitude set for squad.", "description": "Maximum altitude set for squad.",
"example": 0.9, "example": 0.9,
}, },
...@@ -178,99 +182,3 @@ planning_configuration_schema = { ...@@ -178,99 +182,3 @@ planning_configuration_schema = {
"exclusion_zones", "exclusion_zones",
], ],
} }
# region_schema = api.model(
# "RegionSchema",
# {
# "region": fields.Raw(
# required=True,
# description="Using GEOJSON, exact region of "
# + "interest in rectangle format polygon",
# example={
# "type": "FeatureCollection",
# "features": [
# {
# "type": "Feature",
# "properties": {},
# "geometry": {
# "coordinates": [
# [
# [-4.187143188645706, 50.37072283932642],
# [-4.202697005964865, 50.368816892405874],
# [-4.203156724702808, 50.365640144076906],
# [-4.19449868846155, 50.362267670845654],
# ]
# ],
# "type": "Polygon",
# },
# }
# ],
# },
# ),
# },
# )
# squad_metadata_schema = api.model(
# "SquadMetadataSchema",
# {
# "squad_ID": fields.Integer(
# required=True,
# description="Identifier of given squad",
# example=23,
# ),
# "no_of_platforms": fields.Integer(
# required=True,
# description="Number of platforms",
# example=3,
# ),
# "platforms": fields.List(
# fields.Nested(platform_schema),
# required=True,
# description="Squad consists of these platforms",
# ),
# "squad_mission_type": fields.String(
# required=True,
# description="Mission of given squad: `tracking`, `survey`"
# + ", `inspection`",
# example="survey",
# ),
# "squad_state": fields.Boolean(
# required=True,
# description="In execution, Waiting.. <define further>",
# example=False,
# ),
# "region_of_interest": fields.List(
# fields.Nested(region_schema),
# required=False,
# description="Region of interest and exclusion zones per squad.",
# ),
# "exclusion_zones": fields.List(
# fields.Nested(region_schema),
# required=True,
# description="Exclusion zones exclusion zones per squad.",
# ),
# },
# )
# planning_configuration_schema = api.model(
# "PlanningConfigurationSchema",
# {
# "message": fields.Nested(
# full_message_schema,
# required=True,
# description="Message header",
# ),
# "ID": fields.Integer(
# required=True,
# description="Unique identifier tagged to version of this"
# + " configuration plan",
# example=3,
# ),
# "squads": fields.Nested(
# squad_metadata_schema,
# required=False,
# description="Details of each squad",
# ),
# },
# )
...@@ -42,7 +42,8 @@ platform_status_message_schema = { ...@@ -42,7 +42,8 @@ platform_status_message_schema = {
"example": "usbl", "example": "usbl",
}, },
"platform_timestamp": { "platform_timestamp": {
"type": "date-time", "type": "string",
"format": "date-time",
"decription": "Timestamp for onboard platform status message", "decription": "Timestamp for onboard platform status message",
"example": "2022-12-21T00:00:00Z", "example": "2022-12-21T00:00:00Z",
}, },
...@@ -53,7 +54,7 @@ platform_status_message_schema = { ...@@ -53,7 +54,7 @@ platform_status_message_schema = {
"example": True, "example": True,
}, },
"platform_state": { "platform_state": {
# TODO: Define dictionary with potential STATES of each platform # TODO: Define enum with potential STATES of each platform
"type": "string", "type": "string",
"description": "Current state executed by platform. E.g. " "description": "Current state executed by platform. E.g. "
+ "STOP, IDLE, ABORT.", + "STOP, IDLE, ABORT.",
...@@ -67,22 +68,26 @@ platform_status_message_schema = { ...@@ -67,22 +68,26 @@ platform_status_message_schema = {
}, },
"latitude": { "latitude": {
"type": "number", "type": "number",
"format": "float",
"description": "Latitude in decimal degrees.", "description": "Latitude in decimal degrees.",
"example": 178.2, "example": 178.2,
}, },
"longitude": { "longitude": {
"type": "number", "type": "number",
"format": "float",
"description": "Longitude in decimal degrees.", "description": "Longitude in decimal degrees.",
"example": -10.122, "example": -10.122,
}, },
"depth": { "depth": {
"type": "number", "type": "number",
"format": "float",
"description": "Target depth in metres", "description": "Target depth in metres",
"example": 50, "example": 50,
"default": 0, "default": 0,
}, },
"altitude": { "altitude": {
"type": "number", "type": "number",
"format": "float",
"description": "Target altitude in metres", "description": "Target altitude in metres",
"example": 20, "example": 20,
}, },
...@@ -94,31 +99,36 @@ platform_status_message_schema = { ...@@ -94,31 +99,36 @@ platform_status_message_schema = {
}, },
"mission_action_ID": { "mission_action_ID": {
"type": "integer", "type": "integer",
"description": "TODO: add description", "description": "", # TODO: Add description
"example": 1, "example": 1,
}, },
"range_to_go": { "range_to_go": {
"type": "number", "type": "number",
"format": "float",
"description": "Estimated distance to reach next waypoint", "description": "Estimated distance to reach next waypoint",
"example": 124.3, "example": 124.3,
}, },
"speed_over_ground": { "speed_over_ground": {
"type": "number", "type": "number",
"description": "TODO: add description", "format": "float",
"description": "", # TODO: Add description
"example": 124.3, "example": 124.3,
}, },
"water_current_velocity": { "water_current_velocity": {
"type": "number", "type": "number",
"description": "TODO: add description", "format": "float",
"description": "", # TODO: Add description
"example": 124.3, "example": 124.3,
}, },
"thrust_applied": { "thrust_applied": {
"type": "number", "type": "number",
"description": "TODO: Needs further consideration", "format": "float",
"description": "", # TODO: Add description
"example": 124.3, "example": 124.3,
}, },
"heading": { "heading": {
"type": "number", "type": "number",
"format": "float",
"description": "Angular distance relative to north, usually 000°" "description": "Angular distance relative to north, usually 000°"
+ " at north, clockwise through 359°, in degrees", + " at north, clockwise through 359°, in degrees",
"example": 124.3, "example": 124.3,
...@@ -131,21 +141,25 @@ platform_status_message_schema = { ...@@ -131,21 +141,25 @@ platform_status_message_schema = {
}, },
"localisation_error": { "localisation_error": {
"type": "number", "type": "number",
"format": "float",
"description": "Localisation error at last USBL update.", "description": "Localisation error at last USBL update.",
"example": 0.000129, "example": 0.000129,
}, },
"usbl_fix_seconds_ago": { "usbl_fix_seconds_ago": {
"type": "number", "type": "number",
"format": "float",
"description": "USBL Fix received x second ago.", "description": "USBL Fix received x second ago.",
"example": 10.0, "example": 10.0,
}, },
"battery_remaining_capacity": { "battery_remaining_capacity": {
"type": "number", "type": "number",
"format": "float",
"description": "Battery remaining % provided by respective C2", "description": "Battery remaining % provided by respective C2",
"example": 80.2, "example": 80.2,
}, },
"current_pitch": { "current_pitch": {
"type": "number", "type": "number",
"format": "float",
"description": "Current pitch of platform", "description": "Current pitch of platform",
"example": -4.0, "example": -4.0,
}, },
...@@ -159,175 +173,3 @@ platform_status_message_schema = { ...@@ -159,175 +173,3 @@ platform_status_message_schema = {
"longitude", "longitude",
], ],
} }
# gps_schema = api.model(
# "GPS",
# {
# "gps_source": fields.Float( # TODO: TBD with partners
# required=False,
# description=(
# "Source of gps position. E.g. USBL (external),"
# + "platform itself (internal)"
# ),
# example="internal",
# ),
# "latitude_type": fields.String(
# required=False,
# description="",
# example="",
# ),
# "longitude_type": fields.String(
# required=False,
# description="",
# example="",
# ),
# "latitude": fields.Float(
# required=False,
# description="Latitude in <DEFINE UNITS>",
# example="",
# ),
# "longitude": fields.Float(
# required=False,
# description="Longitude in <DEFINE UNITS>",
# example="",
# ),
# "depth": fields.Float(
# required=False,
# description="Depth in <DEFINE UNITS>",
# example="",
# ),
# "altitude": fields.Float(
# required=False,
# description="Altitude in <DEFINE UNITS>",
# example="",
# ),
# # "gps_fix_seconds_ago"
# },
# )
# sensor_schema = api.model(
# "SensorSchema",
# {
# "sensor_ID": fields.Integer(
# required=True,
# description="unique identifier for platform",
# example=2,
# ),
# "serial": fields.String(
# required=False,
# description="serial number of sensor",
# example="mbes-001",
# ),
# "sensor_status": fields.Boolean(
# required=False,
# description="Sensor switched on (True) or off (False)",
# example=True,
# ),
# "additional_data": fields.Raw(
# required=False,
# description="Any addition fields/data to be added here",
# ),
# },
# )
# platform_status_message_schema = api.model(
# "platformStatusMessage",
# {
# "message": fields.Nested(
# full_message_schema,
# required=True,
# description="Message header",
# ),
# "platform_ID": fields.Integer(
# required=True,
# description="unique identifier for platform",
# example=1,
# ),
# "active": fields.Boolean(
# required=False,
# description="When a platform is in deployment (executing a"
# + " mission plan) this should be True",
# example=True,
# ),
# "platform_state": fields.String(
# # TODO: Define dictionary with potential STATES of each platform
# required=False,
# description="Current state executed by platform. E.g. "
# + "STOP, IDLE, ABORT.",
# example="IDLE",
# ),
# "autonomy_plan_ID": fields.Integer(
# required=False,
# description="Last mission plan ID (
# + "according to Autonomy Engine's"
# + " mission plan number) executed by platform",
# example=1,
# ),
# "mission_track_ID": fields.Integer(
# required=False,
# description=(
# "Track number - stage in mission (e.g. "
# + "4 --> Waypoint 3 to Waypoint 4)"
# ),
# example=4,
# ),
# "mission_action_ID": fields.Integer(
# required=False,
# description="to add description",
# example=1,
# ),
# "range_to_go": fields.Float(
# required=False,
# description="Estimated distance to reach next waypoint",
# example=124.3,
# ),
# "speed_over_ground": fields.Float(
# required=False,
# description="",
# example=124.3,
# ),
# "water_current_velocity": fields.Float(
# required=False,
# description="",
# example=124.3,
# ),
# "thrust_applied": fields.Float(
# required=False,
# description="TODO: Needs further consideration",
# example=124.3,
# ),
# "health_status": fields.String(
# required=False,
# description="Health status extracted by respective platform "
# + "if any diagnosis available checks on sensors",
# example="Warning",
# ),
# "gps_data": fields.List(
# fields.Nested(gps_schema), # TODO: TBD Do we want a list of
# # gps readings to allow > 1 reading i.e. platform + usbl
# required=True,
# description="Metadata pf each platform",
# ),
# "localisation_error": fields.Float(
# required=False,
# description="Localisation error at last USBL update.",
# example="",
# ),
# "usbl_fix_seconds_ago": fields.Float(
# required=False,
# description="",
# example="",
# ),
# "battery_remaining_capacity": fields.Float(
# required=True,
# description="Battery remaining capacity % provided by respective"
# + " platform/C2.",
# example=80.0,
# ),
# "sensor_config": fields.Nested(
# sensor_schema
# ), # TODO: TBD Do we want a list of sensors to allow > 1 sensor
# },
# )
# # TBD: Do we append beacon positions with platform positions?
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