mission_plan.py 2.68 KB
Newer Older
1
"""
2
    schemas: Mission plan (un-compiled) generated by the Autonomy Engine
3 4
    sent to the respective platform's C2 to compile into a platform-specific
    mission plan.
5
"""
6
from formats import abstract_schema
7

8 9 10 11 12 13
action_schema = {
    "type": "object",
    "properties": {
        "action": {
            "type": "string",
            "description": "Autonomy Engine's action from `move`, `payload`,"
14
            + " `dive`, `send_hits`, `scanline`, `scanpoint`.",
15 16 17 18 19
            "example": "move",
        },
        "flight_style": {
            "type": "string",
            "description": "Platform-specific modes/flight styles to perform"
20
            + " next action",
21 22 23 24
            "example": "orbit",
        },
        "latitude_waypoint": {
            "type": "number",
25
            "format": "float",
26 27 28 29 30
            "description": "Next waypoint, x-coordinate",
            "example": -4.187143188645706,
        },
        "longitude_waypoint": {
            "type": "number",
31
            "format": "float",
32 33 34 35 36
            "description": "Next waypoint, y-coordinate",
            "example": 50.37072283932642,
        },
        "altitude": {
            "type": "number",
37
            "format": "float",
38 39 40 41 42
            "description": "Altitude of next action",
            "example": 15.0,
        },
        "depth": {
            "type": "number",
43
            "format": "float",
44 45 46 47 48 49
            "description": "Depth of next action",
            "example": 15.0,
        },
        "activate_payload": {
            "type": "boolean",
            "description": "To activate/deactivate sensor for Autosub "
50
            + "Hover-1 --> `MBES` sensor and for EcoSUB --> `Sidescan`",
51 52 53 54
            "example": True,
        },
        "send_environmental_data": {
            "type": "boolean",
55 56
            "description": "To trigger the platform to send list of"
            + "  observations if any found",
57 58
            "example": False,
        },
59
    },
60 61 62 63 64
    "required": [
        "latitude_waypoint",
        "longitude_waypoint",
    ],
}
65

66 67 68
mission_plan_schema = {
    "type": "object",
    "properties": {
69 70 71 72 73 74 75 76 77 78 79
        "autonomy_engine_plan_ID": {
            "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,
        },
80 81 82 83
        "plan": {
            "type": "array",
            "items": action_schema,
        },
84
    },
85
    "required": ["plan_ID", "platform_ID", "plan"],
86
}
87 88 89

full_mission_plan_schema = abstract_schema
full_mission_plan_schema["properties"]["payload"] = mission_plan_schema