mission_plan.py 3.54 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
"""

7 8 9 10 11 12
action_schema = {
    "type": "object",
    "properties": {
        "action": {
            "type": "string",
            "description": "Autonomy Engine's action from `move`, `payload`,"
13
            + " `dive`, `send_hits`, `scanline`, `scanpoint`.",
14 15 16 17 18 19 20 21 22 23 24 25
            "enum": [
                "move",
                "payload",
                "dive",
                "send_hits",
                "scanline",
                "scanpoint",
                "go_home",
                "surface_now",
                "stop_mission",
                "abort_now",
            ],
26 27
            "example": "move",
        },
28
        "start_point_latitude": {
29
            "type": "number",
30
            "format": "float",
31 32
            "description": "Start point, y-coordinate",
            "example": 50.37072283932642,
33
        },
34
        "start_point_longitude": {
35
            "type": "number",
36
            "format": "float",
37 38
            "description": "Start point, x-coordinate",
            "example": -4.187143188645706,
39 40 41 42
        },
        "target_waypoint_latitude": {
            "type": "number",
            "format": "float",
43 44
            "description": "Target waypoint, y-coordinate",
            "example": 50.37072283932642,
45 46 47 48
        },
        "target_waypoint_longitude": {
            "type": "number",
            "format": "float",
49 50
            "description": "Target waypoint, x-coordinate",
            "example": -4.187143188645706,
51 52 53
        },
        "altitude": {
            "type": "number",
54
            "format": "float",
55 56 57 58 59
            "description": "Altitude of next action",
            "example": 15.0,
        },
        "depth": {
            "type": "number",
60
            "format": "float",
61 62 63 64 65 66
            "description": "Depth of next action",
            "example": 15.0,
        },
        "activate_payload": {
            "type": "boolean",
            "description": "To activate/deactivate sensor for Autosub "
67
            + "Hover-1 --> `MBES` sensor and for EcoSUB --> `Sidescan`",
68 69
            "example": True,
        },
70 71 72 73 74 75
        "timeout": {
            "type": "number",
            "format": "float",
            "description": "Timeout set to perform action",
            "example": 1800.0,
        },
76
    },
77
    "required": [
78 79
        "target_waypoint_latitude",
        "target_waypoint_longitude",
80 81
    ],
}
82

83 84 85
mission_plan_schema = {
    "type": "object",
    "properties": {
86 87 88 89
        "message_type": {
            "type": "string",
            "description": "Type of message",
            "example": "mission_plan",
90
            "enum": ["mission_plan"],
91
        },
92 93 94 95 96 97 98
        "autonomy_engine_plan_ID": {
            "type": "integer",
            "description": "Unique identifier for this plan"
            + "generated by the Autonomy Engine",
            "example": 3,
        },
        "platform_ID": {
99
            "type": "string",
100
            "description": "Unique identifier for this platform",
101
            "example": "reav-x-1",
102
        },
103 104
        "emergency": {
            "type": "boolean",
Trishna Saeharaseelan's avatar
Trishna Saeharaseelan committed
105
            "description": "To indicate if this is an emergency. "
106
            + "true = emergency and false = no emergency",
107 108 109
            "default": False,
            "example": False,
        },
110 111 112 113
        "plan": {
            "type": "array",
            "items": action_schema,
        },
114
    },
Trishna Saeharaseelan's avatar
Trishna Saeharaseelan committed
115 116 117 118 119 120
    "required": [
        "message_type",
        "autonomy_engine_plan_ID",
        "platform_ID",
        "plan",
    ],
121
}