Missions

Term Definitions

Mission template: a collection of ordered waypoints and settings that will be flown by a vehicle.

Waypoint: contains a location (either in GPS, specified by latitude and longitude, or NAV, specified by a position relative to the takeoff point), an orientation, and an optional action (ex: PHOTO).

Scheduled mission: A specified hour of the day and days of the week that a particular mission template should be run, on a given vehicle or dock.

Mission run: A single execution of a mission template.

Alert: An event that occurred during a mission. Examples include failure to takeoff and subject detection.

Mission control: A command to control an actively flying mission. Examples include pausing, resuming, and stopping the mission by landing in place.

Idempotency key: A unique value that allows certain requests to be idempotent, i.e., allows a request to be retried for the same vehicle without duplicating the operation. To make a request idempotent, the client must specify the value in the Idempotency-Key header of the request. See specific endpoint documentation to determine if it supports idempotent requests.

Example code

These samples use our example Python client

Create a mission template with one photo waypoint, three feet above the takeoff location.

body = {
    "name": "My First Mission",
    "waypoints": [
        {
            "name": "3 feet above takeoff",
            "action": "PHOTO",
            "orientation": {
                "gimbal_pitch_degrees": 0,
                "heading_degrees": 0,
            },
            "position": {
                "frame": "NAV",
                "x": 0,
                "y": 0,
                "z": 3,
            },
        }
    ],
}

mission_response = client.post("/v0/mission/template", json=body)
mission_template_uuid = mission_response["data"]["mission_template"]["uuid"]

Create a mission template with one photo GPS waypoint, specified by latitude, longitude, and altitude above takeoff in feet.

body = {
    "name": "My GPS Mission",
    "waypoints": [
        {
            "name": "Photo of HQ",
            "action": "PHOTO",
            "orientation": {
                "gimbal_pitch_degrees": 0,
                "heading_degrees": 0,
            },
            "position": {
                "frame": "GPS",
                "latitude": 37.534329,
                "longitude": -122.331413,
                # Since GPS altitude tends to be unreliable, you
                # can also specify a z value in feet above the
                # takeoff location, by setting z_frame to NAV
                "z": 3,
                "z_frame": "NAV"
            },
        }
    ],
}

mission_response = client.post("/v0/mission/template", json=body)
mission_template_uuid = mission_response["data"]["mission_template"]["uuid"]

Schedule the mission to run every Wednesday at 3 PM on a vehicle

body = {
    "schedule_events": [{"day_of_week": 3, "time_of_day": "15:00:00"}],
    "template_uuid": mission_template_uuid,
    "vehicle_serial": "Skydio2-1234",
}
mission_response = client.post("/v0/mission/schedule", json=body)
scheduled_mission_id = mission_response["data"]["scheduled_mission"]["uuid"]

Schedule a mission to run now, for an online vehicle. This uses an idempotency key to make the
request idempotent if retried.

import uuid
idempotency_key = str(uuid.uuid4())
headers = {"Idempotency-Key": idempotency_key}
body = {
    "mission_template_uuid": "167cede9-4e11-4de5-8c68-96048a7eed86",
    "vehicle_serial": "Skydio2-1234",
    "max_delay_seconds": 120,
}
schedule_mission_now_resp = client.post("/v0/mission/schedule_now", headers=headers, json=body)

Once scheduled to run now, the mission status on the vehicle can be verified by fetching status of a single vehicle.

vehicle_resp = client.get("/v0/vehicle/{}".format("Skydio2-1234"))
print(vehicle_resp["data"]["vehicle"]["mission_status"])