Commit f7ad53ea authored by Trishna Saeharaseelan's avatar Trishna Saeharaseelan
Browse files

fix: examples for hydrosurv and correct SOAR_README.md

parent 42a832fe
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
from flask_restx import Api from flask_restx import Api
from flask import Flask from flask import Flask
# import os # import os
__all__ = [ __all__ = [
...@@ -11,4 +12,3 @@ __all__ = [ ...@@ -11,4 +12,3 @@ __all__ = [
app = Flask(__name__) app = Flask(__name__)
api = Api(app) api = Api(app)
# api = Marshmallow(app) # api = Marshmallow(app)
...@@ -18,7 +18,8 @@ swagger_template = dict( ...@@ -18,7 +18,8 @@ swagger_template = dict(
"title": LazyString(lambda: "SoAR Backbone Message Formats"), "title": LazyString(lambda: "SoAR Backbone Message Formats"),
"version": LazyString(lambda: "0.1"), "version": LazyString(lambda: "0.1"),
"description": LazyString( "description": LazyString(
lambda: "Backbone Message Format component for the Squad of Autonomous Robots (SoAR) message definitions." lambda: "Backbone Message Format component for the Squad of"
+ " Autonomous Robots (SoAR) message definitions."
), ),
}, },
host=LazyString(lambda: request.host), host=LazyString(lambda: request.host),
...@@ -28,11 +29,21 @@ swagger_template = dict( ...@@ -28,11 +29,21 @@ swagger_template = dict(
full_message_schema = api.model( full_message_schema = api.model(
"FullMessageSchema", "FullMessageSchema",
{ {
"message_ID": fields.String(
required=True,
description="UUID assigned to this message",
example="b427003c-7bc8-11ed-a1eb-0242ac120002",
),
"timestamp": fields.DateTime( "timestamp": fields.DateTime(
required=True, required=True,
description="Timestamp of message", description="Timestamp of message",
example="2022-11-16T00:00:00Z", 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( "source": fields.String(
required=True, required=True,
description="Where is this message from", description="Where is this message from",
...@@ -61,7 +72,30 @@ full_message_schema = api.model( ...@@ -61,7 +72,30 @@ full_message_schema = api.model(
), ),
}, },
) )
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",
),
},
)
constraints_schema = api.model( constraints_schema = api.model(
"ConstraintsSchema", "ConstraintsSchema",
{ {
...@@ -89,27 +123,23 @@ platform_schema = api.model( ...@@ -89,27 +123,23 @@ platform_schema = api.model(
"platform_ID": fields.Integer( "platform_ID": fields.Integer(
required=True, required=True,
description="unique identifier for platform", description="unique identifier for platform",
example="ah-1", example=1,
), ),
"serial": fields.Integer( "serial": fields.String(
required=True, required=True,
description="platform serial number", description="platform serial number",
example="ah-1", example="reav-60",
), ),
"model": fields.Integer( "model": fields.String(
required=True, required=True,
description="platform serial number", description="platform serial number",
example="ah-1", example="reav",
), ),
"constraints": fields.Nested(constraints_schema), "constraints": fields.Nested(constraints_schema),
"active": fields.Boolean(
required=False,
description="When a platform is in deployment (executing a mission plan) this should be True",
example=True,
),
}, },
) )
action_schema = api.model( action_schema = api.model(
"AutonomyEngineAction", "AutonomyEngineAction",
{ {
...@@ -121,7 +151,8 @@ action_schema = api.model( ...@@ -121,7 +151,8 @@ action_schema = api.model(
), ),
"flight_style": fields.String( "flight_style": fields.String(
required=False, required=False,
description="Platform-specific modes/flight styles to perform next action", description="Platform-specific modes/flight styles to perform"
+ " next action",
example="orbit", example="orbit",
), ),
"latitude_waypoint": fields.Float( "latitude_waypoint": fields.Float(
...@@ -152,17 +183,8 @@ action_schema = api.model( ...@@ -152,17 +183,8 @@ action_schema = api.model(
), ),
"send_environmental_data": fields.Boolean( "send_environmental_data": fields.Boolean(
required=False, required=False,
description="To trigger the platform to send list of observations if any found", description="DO WE NEED THIS? To trigger the platform to send"
example=False, + " list of observations if any found",
),
"scanline": fields.Boolean(
required=False,
description="To trigger the platform to scan-line",
example=False,
),
"scanpoint": fields.Boolean(
required=False,
description="To trigger the platform to send list of observations if any found",
example=False, example=False,
), ),
}, },
...@@ -189,8 +211,8 @@ mission_plan_schema = api.model( ...@@ -189,8 +211,8 @@ mission_plan_schema = api.model(
"plan": fields.List( "plan": fields.List(
fields.Nested(action_schema), fields.Nested(action_schema),
required=True, required=True,
description="Sequence of actions/instructions generated by the " + description="Sequence of actions/instructions generated by the "
" Autonomy Engine that should be compiled by the respective C2.", + " Autonomy Engine that should be compiled by the respective C2.",
), ),
}, },
) )
...@@ -212,17 +234,20 @@ observation_schema = api.model( ...@@ -212,17 +234,20 @@ observation_schema = api.model(
# properties of each observation? # properties of each observation?
"points_of_interest": fields.Float( "points_of_interest": fields.Float(
required=False, required=False,
description="Points from features of interest identified by platform if any found. DEFINE FORMAT.", description="Points from features of interest identified by"
+ " platform if any found. DEFINE FORMAT.",
example="", example="",
), ),
"region_surveyed": fields.Float( "region_surveyed": fields.Float(
required=False, required=False,
description="Region surveyed by given platform. DEFINE FORMAT. GEOJSON?", description="Region surveyed by given platform. DEFINE FORMAT."
+ " GEOJSON?",
example="", example="",
), ),
"quality_of_points": fields.Float( "quality_of_points": fields.Float(
required=False, required=False,
description="Quality/strength of points from features of interest identified by platform. DEFINE FORMAT.", description="Quality/strength of points from features of interest"
+ " identified by platform. DEFINE FORMAT.",
example=0.98, example=0.98,
), ),
"additional_data": fields.Raw( "additional_data": fields.Raw(
...@@ -239,7 +264,8 @@ region_schema = api.model( ...@@ -239,7 +264,8 @@ region_schema = api.model(
{ {
"region": fields.Raw( "region": fields.Raw(
required=True, required=True,
description="Using GEOJSON, exact region of interest in rectangle format polygon", description="Using GEOJSON, exact region of interest in rectangle"
+ " format polygon",
example={ example={
"type": "FeatureCollection", "type": "FeatureCollection",
"features": [ "features": [
...@@ -284,7 +310,8 @@ squad_metadata_schema = api.model( ...@@ -284,7 +310,8 @@ squad_metadata_schema = api.model(
), ),
"squad_mission_type": fields.String( "squad_mission_type": fields.String(
required=True, required=True,
description="Mission of given squad: `tracking`, `survey`, `inspection`", description="Mission of given squad: `tracking`, `survey`,"
+ " `inspection`",
example="survey", example="survey",
), ),
"squad_state": fields.Boolean( "squad_state": fields.Boolean(
...@@ -334,7 +361,8 @@ gps_schema = api.model( ...@@ -334,7 +361,8 @@ gps_schema = api.model(
{ {
"gps_source": fields.Float( # TODO: TBD with partners "gps_source": fields.Float( # TODO: TBD with partners
required=False, required=False,
description="Source of gps position. E.g. USBL (external), platform itself (internal)", description="Source of gps position. E.g. USBL (external), "
+ "platform itself (internal)",
example="internal", example="internal",
), ),
"latitude_type": fields.String( "latitude_type": fields.String(
...@@ -371,26 +399,6 @@ gps_schema = api.model( ...@@ -371,26 +399,6 @@ gps_schema = api.model(
}, },
) )
sensor_schema = api.model(
"Sensor",
{
"sensor_name": fields.String(
required=False,
description="Name of sensor (e.g. MBES for AH1 and SideScan for Ecosub",
example="MBES",
),
"sensor_status": fields.Boolean(
required=False,
description="Sensor switched on (True) or off (False)",
example=True,
),
"additional_data": fields.Raw(
required=False,
description="Add any additional sensor-related data here.",
example={"sensor_loadtime_seconds": 30.0},
),
},
)
platform_status_message_schema = api.model( platform_status_message_schema = api.model(
"platformStatusMessage", "platformStatusMessage",
{ {
...@@ -399,7 +407,17 @@ platform_status_message_schema = api.model( ...@@ -399,7 +407,17 @@ platform_status_message_schema = api.model(
required=True, required=True,
description="Message header", description="Message header",
), ),
"platform": fields.Nested(platform_schema), "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( "platform_state": fields.String(
# TODO: Define dictionary with potential STATES of each platform # TODO: Define dictionary with potential STATES of each platform
required=False, required=False,
...@@ -409,7 +427,8 @@ platform_status_message_schema = api.model( ...@@ -409,7 +427,8 @@ platform_status_message_schema = api.model(
), ),
"autonomy_plan_ID": fields.Integer( "autonomy_plan_ID": fields.Integer(
required=False, required=False,
description="Last mission plan ID (according to Autonomy Engine's mission plan number) executed by platform", description="Last mission plan ID (according to Autonomy Engine's "
+ "mission plan number) executed by platform",
example=1, example=1,
), ),
"mission_track_ID": fields.Integer( "mission_track_ID": fields.Integer(
...@@ -452,9 +471,8 @@ platform_status_message_schema = api.model( ...@@ -452,9 +471,8 @@ platform_status_message_schema = api.model(
example="Warning", example="Warning",
), ),
"gps_data": fields.List( "gps_data": fields.List(
fields.Nested( fields.Nested(gps_schema), # TODO: TBD Do we want a list of gps
gps_schema # readings to allow > 1 reading i.e. platform + usbl
), # TODO: TBD Do we want a list of gps readings to allow > 1 reading i.e. platform + usbl
required=True, required=True,
description="Metadata pf each platform", description="Metadata pf each platform",
), ),
...@@ -470,7 +488,8 @@ platform_status_message_schema = api.model( ...@@ -470,7 +488,8 @@ platform_status_message_schema = api.model(
), ),
"battery_remaining_capacity": fields.Float( "battery_remaining_capacity": fields.Float(
required=True, required=True,
description="Battery remaining capacity % provided by respective platform/C2.", description="Battery remaining capacity % provided by respective"
+ " platform/C2.",
example=80.0, example=80.0,
), ),
"sensor_config": fields.Nested( "sensor_config": fields.Nested(
...@@ -495,14 +514,14 @@ acknowledgement_schema = api.model( ...@@ -495,14 +514,14 @@ acknowledgement_schema = api.model(
), ),
"status": fields.String( "status": fields.String(
required=True, required=True,
description="Highest level of acknowledgement. I.e. `c2_received`: Received by C2," description="Highest level of acknowledgement. I.e. `c2_received`:"
+ " `c2_sent`: Sent from C2->Platform, `executed`: Executed by platform", + " Received by C2,`c2_sent`: Sent from C2"
+ " ->Platform, `executed`: Executed by platform",
), ),
}, },
) )
swagger_config = { swagger_config = {
"headers": [], "headers": [],
"specs": [ "specs": [
...@@ -530,7 +549,11 @@ swagger_config = { ...@@ -530,7 +549,11 @@ swagger_config = {
swagger = Swagger(app, template=swagger_template, config=swagger_config) swagger = Swagger(app, template=swagger_template, config=swagger_config)
ns1 = api.namespace("message", description="Message Wrapper (Full Message Schema) Format") ns1 = api.namespace(
"message", description="Message Wrapper (Full Message Schema) Format"
)
@ns1.route("/wrapper") @ns1.route("/wrapper")
class MessageWrapper(Resource): class MessageWrapper(Resource):
@ns1.response(200, "Success", full_message_schema) @ns1.response(200, "Success", full_message_schema)
...@@ -538,7 +561,12 @@ class MessageWrapper(Resource): ...@@ -538,7 +561,12 @@ class MessageWrapper(Resource):
pass pass
ns2 = api.namespace("platform_status", description="platform Status Message Format") ns2 = api.namespace(
"platform_status",
description="platform Status Message Format",
)
@ns2.route("") @ns2.route("")
class platformStatus(Resource): class platformStatus(Resource):
@ns2.response(200, "Success", platform_status_message_schema) @ns2.response(200, "Success", platform_status_message_schema)
...@@ -547,9 +575,12 @@ class platformStatus(Resource): ...@@ -547,9 +575,12 @@ class platformStatus(Resource):
ns3 = api.namespace( ns3 = api.namespace(
"planning_configuration", description="Planning Configuration Format. Do we want region of interest to be per squad, per platform or in the main schema?" "planning_configuration",
description="Planning Configuration Format. Do we want region of "
+ "interest to be per squad, per platform or in the main schema?",
) )
@ns3.route("") @ns3.route("")
class PlanningConfiguration(Resource): class PlanningConfiguration(Resource):
@ns3.response(200, "Success", planning_configuration_schema) @ns3.response(200, "Success", planning_configuration_schema)
...@@ -558,8 +589,13 @@ class PlanningConfiguration(Resource): ...@@ -558,8 +589,13 @@ class PlanningConfiguration(Resource):
# @api.route('/mission-plan/<str:platform_type') # @api.route('/mission-plan/<str:platform_type')
# @api.doc(params={"platform_type": "The type of platform of the mission plan to target."}) # @api.doc(params={"platform_type": "The type of platform of the
ns4 = api.namespace("mission_plan", description="Mission Plan Format Per platform") # mission plan to target."})
ns4 = api.namespace(
"mission_plan",
description="Mission Plan Format Per platform",
)
@ns4.route("") @ns4.route("")
class MissionPlan(Resource): class MissionPlan(Resource):
...@@ -567,18 +603,29 @@ class MissionPlan(Resource): ...@@ -567,18 +603,29 @@ class MissionPlan(Resource):
def get(self): def get(self):
pass pass
ns5 = api.namespace("observation", description="Observation Format --> Per platform or generic?")
ns5 = api.namespace(
"observation",
description="Observation Format --> Per platform or generic?",
)
@ns5.route("") @ns5.route("")
class Observation(Resource): class Observation(Resource):
@ns5.response(200, "Success", observation_schema) @ns5.response(200, "Success", observation_schema)
def get(self): def get(self):
pass pass
ns6 = api.namespace("acknowledgement", description="Acknowledgment Format") ns6 = api.namespace("acknowledgement", description="Acknowledgment Format")
@ns6.route("") @ns6.route("")
class Acknowledgment(Resource): class Acknowledgment(Resource):
@ns6.response(200, "Success", acknowledgement_schema) @ns6.response(200, "Success", acknowledgement_schema)
def get(self): def get(self):
pass pass
if __name__ == "__main__": if __name__ == "__main__":
app.run() app.run()
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"version": 1,
"source": "hydrosurv_adapter", "source": "hydrosurv_adapter",
"destination": "autonomy_engine", "destination": "autonomy_engine",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "acknowledgement",
"payload": { "payload": {
"message_ID": 202, "message_ID": "b427003c-7bc8-11ed-a1eb-0242ac999999",
"status": "executed" "status": "executed"
} }
} }
\ No newline at end of file
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"source": "hydrosurv_adapter", "version": 2,
"destination": "autonomy_engine", "source": "autonomy_engine",
"destination": "ah-1",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "platform_status",
"payload": { "payload": {
...@@ -16,9 +18,7 @@ ...@@ -16,9 +18,7 @@
"altitude": 0, "altitude": 0,
"depth": 0, "depth": 0,
"activate_payload": false, "activate_payload": false,
"send_environmental_data": false, "send_environmental_data": false
"scanline": false,
"scanpoint": false
} }
] ]
} }
......
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"source": "hydrosurv_adapter", "version": 2,
"source": "ecosub_c2",
"destination": "autonomy_engine", "destination": "autonomy_engine",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "platform_status",
"payload": { "payload": {
"platform_serial":"ecosub-3", "platform_serial":"ecosub-3",
"points_of_interest": "", "points_of_interest": [],
"region_surveyed": "", "region_surveyed": [],
"quality_of_points": 0.98, "quality_of_points": 0.98,
"additional_data": { "additional_data": {
"sensor_x": false "sensor_x": false
......
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"source": "gui", "version": 2,
"destination": "autonomy_engine", "source": "autonomy_engine",
"destination": "ah-1",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "platform_status",
"payload": { "payload": {
......
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"version": 1,
"source": "hydrosurv_adapter", "source": "hydrosurv_adapter",
"destination": "autonomy_engine", "destination": "autonomy_engine",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "platform_status",
"payload": { "payload": {
"platform": { "platform_ID": 1,
"platform_ID": 2, "active": true,
"serial": "ah-1", "platform_state": "ORBIT",
"model": "ah-1",
"constraints": {
"min_altitude": 15.2,
"min_velocity": 0.1,
"max_velocity": 0.9
},
"active": true
},
"platform_state": "IDLE",
"autonomy_plan_ID": 1, "autonomy_plan_ID": 1,
"mission_track_ID": 4, "mission_track_ID": 4,
"mission_action_ID": 1, "mission_action_ID": 1,
"range_to_go": 124.3, "range_to_go": 0.3,
"speed_over_ground": 124.3, "speed_over_ground": 0.3,
"water_current_velocity": 124.3, "water_current_velocity": 0.3,
"thrust_applied": 124.3, "thrust_applied": 0.3,
"health_status": "Warning", "health_status": "Warning",
"gps_data": [ "gps_data": [
{ {
...@@ -36,16 +29,13 @@ ...@@ -36,16 +29,13 @@
"altitude": 0.0 "altitude": 0.0
} }
], ],
"localisation_error": 0.008, "localisation_error": null,
"usbl_fix_seconds_ago": 20.3, "usbl_fix_seconds_ago": null,
"battery_remaining_capacity": 80, "battery_remaining_capacity": 80,
"sensor_config": { "sensor_config": {
"sensor_name": "MBES", "sensor_name": null,
"sensor_status": false, "sensor_status": false,
"additional_data": { "additional_data": null
"sensor_loadtime_seconds": 30
} }
} }
} }
\ No newline at end of file
}
}
\ No newline at end of file
{
"timestamp": "2022-11-16T00:00:00Z",
"source": "gui",
"destination": "autonomy_engine",
"encoded": false,
"type": "platform_status",
"payload": {
"ID": 3,
"squads": {
"squad_ID": 23,
"no_of_platforms": 3,
"platforms": [
{
"platform_ID": 1,
"serial": "ah-1",
"model": "ah-1",
"constraints": {
"min_altitude": 15.2,
"min_velocity": 0.1,
"max_velocity": 0.9
},
"active": true
}
],
"squad_mission_type": "survey",
"squad_state": false,
"region_of_interest": [
{
"region": {
"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"
}
}
]
}
}
],
"exclusion_zones": [
{
"region": {
"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"
}
}
]
}
}
]
}
}
}
\ No newline at end of file
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"source": "hydrosurv_adapter", "version": 2,
"destination": "autonomy_engine", "source": "autonomy_engine",
"destination": "ecosub_c2",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "mission_plan",
"payload": { "payload": {
"plan_ID": 1, "plan_ID": 3,
"platform_serial": "reav-60", "platform_serial": "ecosub-4",
"plan": [ "plan": [
{ {
"action": "move", "action": "move",
"flight_style": "orbit", "flight_style": "dive",
"latitude_waypoint": -4.187143188645706, "latitude_waypoint": -4.187143188645706,
"longitude_waypoint": 50.37072283932642, "longitude_waypoint": 50.37072283932642,
"altitude": 0, "altitude": 20,
"depth": 0, "depth": null,
"activate_payload": false, "activate_payload": true,
"send_environmental_data": false, "send_environmental_data": false
"scanline": false,
"scanpoint": false
} }
] ]
} }
......
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"source": "hydrosurv_adapter", "version": 2,
"source": "ecosub_c2",
"destination": "autonomy_engine", "destination": "autonomy_engine",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "platform_status",
"payload": { "payload": {
"platform_serial":"ecosub-3", "platform_serial":"ecosub-3",
"points_of_interest": "", "points_of_interest": [],
"region_surveyed": "", "region_surveyed": [],
"quality_of_points": 0.98, "quality_of_points": 0.98,
"additional_data": { "additional_data": {
"sensor_x": false "sensor_x": false
......
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"source": "hydrosurv_adapter", "version": 1,
"source": "hermes_ecosub",
"destination": "autonomy_engine", "destination": "autonomy_engine",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "platform_status",
"payload": { "payload": {
"platform": {
"platform_ID": 2, "platform_ID": 2,
"serial": "ah-1", "active": true,
"model": "ah-1",
"constraints": {
"min_altitude": 15.2,
"min_velocity": 0.1,
"max_velocity": 0.9
},
"active": true
},
"platform_state": "IDLE", "platform_state": "IDLE",
"autonomy_plan_ID": 1, "autonomy_plan_ID": 1,
"mission_track_ID": 4, "mission_track_ID": 4,
"mission_action_ID": 1, "mission_action_ID": 1,
"range_to_go": 124.3, "range_to_go": 12.3,
"speed_over_ground": 124.3, "speed_over_ground": 10.3,
"water_current_velocity": 124.3, "water_current_velocity": 10.3,
"thrust_applied": 124.3, "thrust_applied": 0.3,
"health_status": "Warning", "health_status": "Warning",
"gps_data": [ "gps_data": [
{ {
...@@ -32,20 +25,20 @@ ...@@ -32,20 +25,20 @@
"longitude_type": "", "longitude_type": "",
"latitude": -7.432, "latitude": -7.432,
"longitude": 50.365, "longitude": 50.365,
"depth": 0.0, "depth": 5.0,
"altitude": 0.0 "altitude": 20.0
} }
], ],
"localisation_error": 0.008, "localisation_error": null,
"usbl_fix_seconds_ago": 20.3, "usbl_fix_seconds_ago": null,
"battery_remaining_capacity": 80, "battery_remaining_capacity": 80,
"sensor_config": { "sensor_config": {
"sensor_name": "MBES", "sensor_ID": 22,
"sensor_status": false, "serial": "sidescan-2x",
"sensor_status": true,
"additional_data": { "additional_data": {
"sensor_loadtime_seconds": 30 "whiskers_on": true
} }
} }
} }
} }
\ No newline at end of file
}
\ No newline at end of file
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"version": 1,
"source": "hydrosurv_adapter", "source": "hydrosurv_adapter",
"destination": "autonomy_engine", "destination": "autonomy_engine",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "acknowledgement",
"payload": { "payload": {
"message_ID": 202, "message_ID": "b427003c-7bc8-11ed-a1eb-0242ac999999",
"status": "executed" "status": "executed"
} }
} }
\ No newline at end of file
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"source": "hydrosurv_adapter", "version": 2,
"destination": "autonomy_engine", "source": "autonomy_engine",
"destination": "ah-1",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "platform_status",
"payload": { "payload": {
...@@ -16,9 +18,7 @@ ...@@ -16,9 +18,7 @@
"altitude": 0, "altitude": 0,
"depth": 0, "depth": 0,
"activate_payload": false, "activate_payload": false,
"send_environmental_data": false, "send_environmental_data": false
"scanline": false,
"scanpoint": false
} }
] ]
} }
......
{ {
"message_ID": "b427003c-7bc8-11ed-a1eb-0242ac120002",
"timestamp": "2022-11-16T00:00:00Z", "timestamp": "2022-11-16T00:00:00Z",
"version": 1,
"source": "hydrosurv_adapter", "source": "hydrosurv_adapter",
"destination": "autonomy_engine", "destination": "autonomy_engine",
"encoded": false, "encoded": false,
"type": "platform_status", "type": "platform_status",
"payload": { "payload": {
"platform": { "platform_ID": 1,
"platform_ID": 23, "active": true,
"serial": "ah-1", "platform_state": "ORBIT",
"model": "ah-1",
"constraints": {
"min_altitude": 15.2,
"min_velocity": 0.1,
"max_velocity": 0.9
},
"active": true
},
"platform_state": "IDLE",
"autonomy_plan_ID": 1, "autonomy_plan_ID": 1,
"mission_track_ID": 4, "mission_track_ID": 4,
"mission_action_ID": 1, "mission_action_ID": 1,
"range_to_go": 124.3, "range_to_go": 0.3,
"speed_over_ground": 124.3, "speed_over_ground": 0.3,
"water_current_velocity": 124.3, "water_current_velocity": 0.3,
"thrust_applied": 124.3, "thrust_applied": 0.3,
"health_status": "Warning", "health_status": "Warning",
"gps_data": [ "gps_data": [
{ {
...@@ -36,16 +29,13 @@ ...@@ -36,16 +29,13 @@
"altitude": 0.0 "altitude": 0.0
} }
], ],
"localisation_error": 0.008, "localisation_error": null,
"usbl_fix_seconds_ago": 20.3, "usbl_fix_seconds_ago": null,
"battery_remaining_capacity": 80, "battery_remaining_capacity": 80,
"sensor_config": { "sensor_config": {
"sensor_name": "MBES", "sensor_name": null,
"sensor_status": false, "sensor_status": false,
"additional_data": { "additional_data": null
"sensor_loadtime_seconds": 30
} }
} }
} }
\ No newline at end of file
}
}
\ No newline at end of file
...@@ -21,11 +21,21 @@ message_types = [ ...@@ -21,11 +21,21 @@ message_types = [
full_message_schema = api.model( full_message_schema = api.model(
"FullMessageSchema", "FullMessageSchema",
{ {
"message_ID": fields.String(
required=True,
description="UUID assigned to this message",
example="b427003c-7bc8-11ed-a1eb-0242ac120002",
),
"timestamp": fields.DateTime( "timestamp": fields.DateTime(
required=True, required=True,
description="Timestamp of message", description="Timestamp of message",
example="2022-11-16T00:00:00Z", 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( "source": fields.String(
required=True, required=True,
description="Where is this message from", description="Where is this message from",
...@@ -82,23 +92,18 @@ platform_schema = api.model( ...@@ -82,23 +92,18 @@ platform_schema = api.model(
"platform_ID": fields.Integer( "platform_ID": fields.Integer(
required=True, required=True,
description="unique identifier for platform", description="unique identifier for platform",
example="ah-1", example=1,
), ),
"serial": fields.Integer( "serial": fields.String(
required=True, required=True,
description="platform serial number", description="platform serial number",
example="ah-1", example="reav-60",
), ),
"model": fields.Integer( "model": fields.String(
required=True, required=True,
description="platform serial number", description="platform serial number",
example="ah-1", example="reav",
), ),
"constraints": fields.Nested(constraints_schema), "constraints": fields.Nested(constraints_schema),
"active": fields.Boolean(
required=False,
description="When a platform is in deployment (executing a mission plan) this should be True",
example=True,
),
}, },
) )
...@@ -22,8 +22,9 @@ acknowledgement_schema = api.model( ...@@ -22,8 +22,9 @@ acknowledgement_schema = api.model(
), ),
"status": fields.String( "status": fields.String(
required=True, required=True,
description="Highest level of acknowledgement. I.e. `c2_received`: Received by C2," description="Highest level of acknowledgement. I.e. `c2_received`:"
+ " `c2_sent`: Sent from C2->Platform, `executed`: Executed by platform", + " Received by C2, `c2_sent`: Sent from C2->Platform, `executed`:"
+ " Executed by platform",
), ),
}, },
) )
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