Key Information

Register
Submit
The challenge is finished.

Challenge Overview


In previous challenge we've built a preflight checklist that is filled out by the drone pilot. Now we need to take it one step further and load the actual mission to the drone. This is a primary objective of this challenge.
The integration point is the "Save and Load Mission" action in the preflight checklist page (can be accessed from the /mission-list page when logged in as a pilot). Clicking that will save the checklist (already implemented) and will send the mission to the drone. That consists of 2 steps: building the mission and sending it to the drone via http request. 

Building the mission

The mission has a series of waypoints and the assumption is that an image will be taken at each of these points, in a specified heading. This information is available in the Mission database model. The actual format that should be sent to the drone requires modifying the mission that is stored in the database. For each mission item we need to create a waypoint object like this one
{
    "param1": 0,
    "param2": 0,
    "param3": 0,
    "param4": 0,
    "x": 42.142791748046875,
    "y": -88.01958465576172,
    "z": 224.08999633789062,
    "seq": 0,
    "command": 16,
    "target_system": 1,
    "target_component": 190,
    "frame": 0,
    "current": 0,
    "autocontinue": 1
}
In the above, current and autocontinue should be hardcoded to 0 and 1 respectively. Seq should be incremented, starting from 0.
The final mission is an array of the waypoints. Examples will be posted in the forums.

Sending the mission list

The mission list should be sent as a http request to the actual drone. For this purpose, add a accessURL field to Drone database model and send a post request to accessUrl/mission
The actual drone API does not require any authentication, so you can just send a post request to the specified url with mission in the request body.

Update Mission list

The current mission list contains only mission name and status. This should be expanded with the following:
1. Add a Drone column that will display the assigned drone name
1. Add a column "Drone Status" that will show if the drone is actually online. For each mission send a get http request to the drone accessURL. If the API returns a 200 response, drone is considered as online 
2. Add a load mission button that will load the mission to the drone (same as when saving the checklist). The button will be disabled if the drone isnt online.
3. Add a "Check Status" button that will display a popup with current drone information :current position and mission waypoints. Both are accessed via drone accessURL.

Current position is obtained from accessURL/telemetry/global_position_int . API response is 
{
  "result": "success",
  "data": {
    "time_boot_ms": 1327978,
    "lat": 421428248,
    "lon": -880196102,
    "alt": 228070,
    "relative_alt": -3970,
    "vx": -1,
    "vy": 7,
    "vz": -6,
    "hdg": 26610
  }
}
Notice that the lan and lot fields aren`t decimal but integer values
Mission details are loaded with a GET to accessUrl/mission.

Here is a current screen with additions marked in red:


To access the pilot screen, you need to register a pilot user (manually, via postman - role='pilot'), create a mission, and set mission.pilot to the user id of the pilot. Then navigate to the /mission-list page. The drone should also be assigned manually to the mission (postman or test script).

Base code for this challenge is in the loadMission branch in the frontend and backend repositories
Any changes to backend api require updating postman and test data.

NOTE: The review and appeals phases are shortened, pay attention to the timeline

Final Submission Guidelines

Submit a git patch for your changes to the base code
Submit a short video demonstrating the implemented features
Submit a short verification guide with screenshots (verification guide should be placed in the /verification-docs directory)

ELIGIBLE EVENTS:

2017 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30056110