mission_plan.py 2.66 KB
Newer Older
1
"""
2 3 4
    schemas: Mission plan (un-complied) geenrated by the  Autonomy Engine
    sent to the respective platform's C2 to compile into a platform-specific
    mission plan.
5
"""
6
from . import api, full_message_schema
7 8 9
from flask_restx import fields


10 11 12 13 14 15 16 17 18 19 20
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,
21 22
            description="Platform-specific modes/flight styles to perform"
            + " next action",
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
            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,
53 54
            description="To trigger the platform to send list of observations"
            + " if any found",
55 56 57 58 59
            example=False,
        ),
    },
)

60 61 62 63
mission_plan_schema = api.model(
    "MissionPlan",
    {
        "message": fields.Nested(
64
            full_message_schema,
65 66 67
            required=True,
            description="Message header",
        ),
68
        "plan_ID": fields.Integer(
69
            required=True,
70 71
            description="Identifier of given mission sequence planned",
            example=1,
72
        ),
73
        "platform_serial": fields.String(
74
            required=True,
75 76
            description="Serial of target platform to send mission to",
            example="reav-60",
77
        ),
78 79
        "plan": fields.List(
            fields.Nested(action_schema),
80
            required=True,
81 82
            description="Sequence of actions/instructions generated by the "
            + " Autonomy Engine that should be compiled by the respective C2.",
83
        ),
84 85
    },
)