Vous êtes sur la page 1sur 54

AUVSI SUAS Interoperability

Documentation
Release 2017.1

AUVSI Seafarer Chapter

October 27, 2016


Contents

1 Contents 3
1.1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 Interface Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4 Client Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.5 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.6 Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

2 Indices & Tables 43

HTTP Routing Table 45

Python Module Index 47

i
ii
AUVSI SUAS Interoperability Documentation, Release 2017.1

This is the documentation for the Association for Unmanned Vehicle Systems International (AUVSI) Student Un-
manned Air Systems (SUAS) Competition Repository. The AUVSI Seafarer Chapter runs the competition.
To contact the competition directors and interoperability developers, please email auvsi-suas@googlegroups.com.
The AUVSI SUAS Competition Repository contains the interoperability server and associated components. Teams
should watch the repository so they receive notifications when things change. Teams should also monitor the Git log
for changes.

Contents 1
AUVSI SUAS Interoperability Documentation, Release 2017.1

2 Contents
CHAPTER 1

Contents

1.1 Getting Started

This section describes how to go from setting up the Interoperability Server to completing interop tasks with the pro-
vided client library. The following code and command examples work with the competitions host operating system,
Ubuntu 16.04.

1.1.1 Prerequisites

The Interoperability System builds on top a set of standard technologies. These technologies should be learned and
understood prior to using the Interoperability System. The following are resources the reader can use to learn these
technologies.
1. Ubuntu 16.04
2. Ubuntu Terminal
3. Linux Shell
4. Git
5. Github
6. Docker
7. Python
8. Virtualenv
9. Pip
10. Django
11. Postgres
12. Apache

1.1.2 Computers and Networking

This subsection describes the computer and networking setup at competition. The teams should replicate this setup to
test their integration.
IP Addresses, Username, & Password. At Check-In and Orientation, teams will be given a static IP address, a
DHCP IP address range, the server IP address and port, a username, and a password. The static IP address (e.g.

3
AUVSI SUAS Interoperability Documentation, Release 2017.1

10.10.130.100) will be a single address unique to the team which can be used to connect to the system. The
DHCP range will be a common range that will be provisioned to teams automatically by the interop router. The
router will be on the subnet 10.10.130.XXX with subnet mask 255.255.255.0. The server IP address and port
will be used to communicate with the interop server (e.g. http://10.10.130.2:8000). The username (e.g.
testuser) and password (e.g. testpass) will be the interop server login credentials required to execute requests.
The username will not be for a superuser/administrator account on the server.
Ethernet Cord. During Mission Setup, the teams will be provided a single ethernet cord. This cord will connect the
teams system to the interop router, which will be connected to the interop server. The mission clock will end once the
team has evacuated the runway and returned this ethernet cord.
The following shows how the Interoperability System will be connected, and the recommended means of connecting
the teams system. Note the IP addresses are examples.

Judges Team

Interop Router: 10.10.130.1 Team Router: 192.168.1.1

LAN 1: 10.10.130.3 WLAN: 10.10.130.3

LAN 0: 10.10.130.2 LAN 0: 192.168.1.2

Interop Server: 10.10.130.2 Team Computer: 192.168.1.2

Interop Hardware. The hardware consists of a router and a computer. The router will be configured to have a static
IP address range, and a DHCP IP address range. All connected judge computers will be at a static IP address. The
judges may also use network configuration, like VLANs, to further isolate network traffic. The interop host machine
will be a computer running Ubuntu 14.04 or 16.04, and will run the server Docker image to host the inteorp server.
Interop Supporting Hardware. The judges have additional hardware to improve reliability of the interop deployment.
The judges use an additional computer to act as a black-box prober which continuously executes requests to validate
availability. The judges also use UPS battery backups to prevent unavailability due to generator power loss.
Team Router. The judges recommend that teams use a router to have a separate subnet. The judge provided ethernet
cord will then connect a LAN port on the interop router to the WAN port on the teams router. This will allow multiple
team computers to communicate with the interop server at the same time. This will also allow a single computer to
simultaneously communicate with the interop server and other team computers.
Team Machine. The teams will need at least one computer to communicate with the interop server. The judges

4 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

recommend that teams leverage the provided client library and tools, which are available in the client Docker image.
Teams may also integrate directly via the HTTP + JSON protocol.

1.1.3 Git Repository

The Interoperability System is developed through the AUVSI SUAS Competition Repository. The first step is to clone
the repository locally.
sudo apt-get install -y git
cd ~/
git clone https://github.com/auvsi-suas/interop.git

1.1.4 Docker Images

The Interoperability System is released to teams as Docker images. The images can be used to run the server and
client tools with minimal setup.
Setup the Host Computer. The next step is to setup the host computer (Ubuntu 16.04) to run Docker images. The
repo provides a script in the repository to do such. For alternative deployments, you can use the Docker Engine
Installation guide.
cd ~/interop
sudo ./tools/setup_docker.sh
sudo ./tools/setup_tools.sh

auvsisuas/interop-server

Create and Start Container. The interop server is provided as a Docker image and should be run as a Docker
container. The repo provides a script to run the container in a standard way: it creates the container, runs it in the
background, uses port 8000 for the web server, and restarts automatically (e.g. on failure or boot) unless explicitly
stopped.
cd ~/interop
sudo ./server/run.sh

Stop and Start. Once the server is running, it can be stopped and started again. Note that the run.sh creates
and starts the container- it cant be used to start an existing stopped container. The following can start and stop the
container.
sudo docker stop interop-server
sudo docker start interop-server

Container Shell. To inspect state, use local server tools (e.g. Djangos management tool), or do other container-local
actions, you can start a bash shell inside of the container. The following shows how to start the shell.
sudo docker exec -it interop-server bash

Dump Database, Dump Server Log. The shell will start the user inside of the working directory (server source code)
at /interop/server. The following shows how to dump the database to standard output, dump the server log file
to standard output, and exit the shell.
cd /interop/server
python manage.py dumpdata

cd /var/log/apache2

1.1. Getting Started 5


AUVSI SUAS Interoperability Documentation, Release 2017.1

cat interop_server_error.log

exit

Remove Container. The container will maintain database and log state between starts and stops of the same container.
The state, which includes data like telemetry will automatically be deleted if the container is removed. The following
can remove a container.
sudo docker stop interop-server
sudo docker rm interop-server

auvsisuas/interop-client

Create Container & Start Shell. The interop client library and tools are provided as a Docker image and can be run
as a Docker container. The repo provides a script to run the container in a standard way: it creates the container and
starts a pre-configured shell.
cd ~/interop
sudo ./client/run.sh

Get Missions. The client image provides a script to request mission details from the interoperability server, and it can
be executed from the container shell. The following shows how to execute it for the default testing user (testuser)
if the interop server was at 10.10.130.2:8000.
./tools/interop_cli.py --url http://10.10.130.2:8000 --username testuser missions

Upload Targets. The client image provides a script to upload targets to the interop server from a directory of targets
and target thumbnails in the Object File Format, described in the appendix of the 2017 rules. The following shows
how to upload targets from the client container shell.
./tools/interop_cli.py --url http://10.10.130.2:8000 --username testuser targets \
--target_dir /path/to/target/directory/

Probe Server. The client image provides a script to continuously execute dummy interop requests to test server
availability. The following shows how to execute the prober from the client container shell.
./tools/interop_cli.py --url http://10.10.130.2:8000 --username testuser probe

1.1.5 Mission Configuration

This section describes how to configure a mission as an administrator on a running interop server.
Preconfigured Users. The interop server Docker image comes with 2 users preconfigured: a test team user
(testuser, testpass), and a test admin user (testadmin, testpass). At competition, the judges will have a
secret admin account (testadmin will be deleted), and the teams will be given a new team account (not testuser
with testpass). Dont confuse the capabilities of the two accounts! At competition you will not have access to an
admin account, so you will not be able to see the following admin dashboards. Dont hard-code the username and
password!
Admin Web Login. The interop server has an admin webpage that can be used to configure the server. Navigate to
http://localhost:8000 in a web browser. You may need to replace localhost:8000 if youve configured the setup
differently. This will prompt for an admin account login, so enter the preconfigured user: testadmin with password
testpass.
SUAS Admin Dashboard. After login it will show the SUAS made admin dashboard. It will have a navigation bar
with system-wide and mission-specific links. The homagepage for the dashboard will also list the current missions,

6 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

and should show the single mission which comes with the image. If you click the mission, you will be brought to a
mission-specific dashboard. Click the Help button on the mission dashboard to learn how to use this interface.
System
Live View (KML). Downloads a KML file which can be opened in Google Earth to view real-time infor-
mation. This provides a visualization that complements the one provided in this interface.
Export Data (KML). Downloads a KML file which can be opened in Google Earth to view the UAS
telemetry and other mission data after the mission is completed.
Edit Data. Opens the Django Admin Interface which can be used to configure missions and view raw data.
Clear Cache. Caching is used to improve performance of certain operations. The caches automatically
expire, so users shouldnt need to use this, but data modification mid-mission may require explicit clearing
to react faster.
Mission
Dashboard. Navigates to the dashboard showing all mission elements, active team details, etc.
Review Targets. Navigates to the page to review targets submitted.
Evaluate Teams (CSV). Evaluates the teams for the mission being viewed. This is otherwise the same as
the System link.
Django Admin Dashboard. From the SUAS Admin Dashboard, you can use the menu System > Edit Data
to open the Django Admin dashboard. You should know how to use this interface from the Prerequisite work. See
Configuration for more details.
Mission Configuration. To configure a mission, create or edit the MissionConfig object to specify the desired
flight boundaries, waypoints, true targets (for grading base targets), etc. Once the updated mission and subobjects have
been saved, the cache should be cleared via the SUAS Dashboards menu System > Clear Cache.
Mission Clock Events. When the mission clock for a team starts, the interop judge creates a MissionClockEvent
for the team indicating the team has gone on the clock. The judge creates another object to indicate the team has gone
off the clock. The time is automatically set at time of save. This is used to evaluate mission clock time and to ensure
target review doesnt start before targets are frozen.
Takeoff or Landing Events. When a team takes off and when a team lands, the interop judge creates a
TakeoffOrLandingEvent to mark the evenet. The time is automatically set at time of save. This is used to
evaluate UAS telemetry rates, waypoints, and collisions only while airborne.

1.1.6 Interop Integration

This section provides examples for how to integrate with the interop server beyond using the provided tools.

Example Request with CURL

The following is an example of how to perform interoperability using the curl command. This is too inefficient to
achieve a sufficient update rate. This merely shows how simple it is to implement interoperability from standard
HTTP and JSON.
The curl command has the following parameters:
1. cookie: Cookies in this file are sent to the server.
2. cookie-jar: Cookies sent from the server are saved in this file.
3. data: Makes the request a POST request instead of GET request, and sends the given argument as the POST
data segment.

1.1. Getting Started 7


AUVSI SUAS Interoperability Documentation, Release 2017.1

4. [URL]: The URL to make a request to. This consists of a hostname (localhost:8080) and a relative path
(/api/interop/server_info).
Try the following commands, and see the effect on the stored data at the server:
curl --cookie cookies.txt --cookie-jar cookies.txt \
--data "username=testuser&password=testpass" \
http://localhost:8080/api/login

curl --cookie cookies.txt --cookie-jar cookies.txt \


http://localhost:8080/api/missions

curl --cookie cookies.txt --cookie-jar cookies.txt \


http://localhost:8080/api/obstacles

curl --cookie cookies.txt --cookie-jar cookies.txt \


--data "latitude=10&longitude=20&altitude_msl=30&uas_heading=40" \
http://localhost:8080/api/telemetry

Client Library

The competition provides a Client Library to make integration easier. It is recommended that teams use this library to
create a high-quality integration.
To create a client, import the interop module and construct the object with the server URL, your username, and
your password. The competition provides two client objects: one which does synchronous requests, and another which
does asynchronous requests. The following examples show how to use the synchronous form.
import interop

client = interop.Client(url='http://127.0.0.1:8000',
username='testuser',
password='testpass')

The following shows how to request the mission details and the current position of the obstacles.
missions = client.get_missions()
print missions

stationary_obstacles, moving_obstacles = client.get_obstacles()


print stationary_obstacles, moving_obstacles

The following shows how to upload UAS telemetry.


telemetry = interop.Telemetry(latitude=38.145215,
longitude=-76.427942,
altitude_msl=50,
uas_heading=90)
client.post_telemetry(telemetry)

The following shows how to upload a target and its image.


target = interop.Target(type='standard',
latitude=38.145215,
longitude=-76.427942,
orientation='n',
shape='square',
background_color='green',
alphanumeric='A',

8 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

alphanumeric_color='white')
target = client.post_target(target)

with open('path/to/image/A.jpg', 'rb') as f:


image_data = f.read()
client.put_target_image(target.id, image_data)

Mission Planner Script

The Interop Client Image comes with Mission Planner integration. This code lives in the client/missionplanner folder,
found in the repository or the image.
This code requires that the interoperability client interop module and its dependencies are installed on the system
and available in PYTHONPATH.
auvsi_mp.py is run as a script inside of Mission Planner. It polls for a change in aircraft telemetry, and on change
sends the telemetry to the interoperability server. It also prints out errors detected and the average upload rate over the
last 10 seconds.
Inside Mission Planner, open the script console (under Actions in the Flight Data panel) and paste the contents of
auvsi_mp.py into the window. Add a line to add the interoperability client library to the system path. Modify
the script constants to provide settings like the interop server URL. When you close the window, the script will
immediately start executing.

1.1.7 Performance Evaluation

Once you have integrated with the Interoperability System, you should then validate the integration by performing an
end-to-end test. This should include using the automatic evaluation the judges will use, which is provided as part of
the interop server.
Note that proper evaluation requires a representative MissionConfig, which will include things like the flight
boundaries and the details for the true targets.
Review Target Imagery. The first step is to review any target imagery provided. This is used to review whether the
provided image is acceptable, and whether human graded features are correct (e.g. emergent target description). It is
not used to grade whether the target details are correct (done automatically). Go to the Mission Dashboard, and then
use the menu Mission > Review Targets. Click on a target ID to see the image and details, and then approve
or reject the image, and if applicable the emergent description.
Automatic Evaluation. The second step is to run the automatic evaluator. Use the menu Mission > Evaluate
Teams (CSV). This will generate a CSV file, with one line for every team (non superuser account), and one column
for every gradable deliverable / performance feedback.

1.2 Configuration

This section describes how to configure the interop server. Additional steps for deployment can be found in Djangos
Deployment Docs.
Create a New Admin. The automated system setup will create a default administrator account with username
testadmin and password testpass. This account can be used to login to the admin interfaces or authenticate any
requests. If you would like to create another administrator account, the Django management program can be used to
create an administrator account. Execute the following from a bash shell inside the servers container.

1.2. Configuration 9
AUVSI SUAS Interoperability Documentation, Release 2017.1

cd /interop/server
python manage.py createsuperuser

1.2.1 Object Configuration

The following describes the individual model objects in greater detail than what is presented in Getting Started.
class auvsi_suas.models.GpsPosition(*args, **kwargs)
GPS position consisting of a latitude and longitude degree value.
latitude
Latitude in degrees.
longitude
Longitude in degrees.
class auvsi_suas.models.AerialPosition(*args, **kwargs)
Aerial position which consists of a GPS position and an altitude.
gps_position
GPS position.
altitude_msl
Altitude (MSL) in feet.
class auvsi_suas.models.UasTelemetry(*args, **kwargs)
UAS telemetry reported by teams.
uas_position
The position of the UAS.
uas_heading
The (true north) heading of the UAS in degrees.
class auvsi_suas.models.Target(*args, **kwargs)
Target represents a single target submission for a team.
user
The user which submitted and owns this target.
target_type
Target type.
location
Target location.
orientation
Target orientation.
shape
Target shape.
background_color
Target background color.
alphanumeric
Target alphanumeric.
alphanumeric_color
Target alphanumeric color.

10 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

description
Free-form target description.
autonomous
Target is an ADLC submission.
thumbnail
Uploaded target image thumbnail.
thumbnail_approved
Whether judge considers thumbnail valid for target.
creation_time
Time that this target was first created.
last_modified_time
Time that this target was last modified.
class auvsi_suas.models.Waypoint(*args, **kwargs)
A waypoint consists of an aerial position and its order in a set.
position
Aerial position.
order
Waypoint relative order number. Should be unique per waypoint set.
class auvsi_suas.models.StationaryObstacle(*args, **kwargs)
A stationary obstacle that teams must avoid.
gps_position
The position of the obstacle center.
cylinder_radius
The radius of the cylinder in feet.
cylinder_height
The height of the cylinder in feet.
class auvsi_suas.models.MovingObstacle(*args, **kwargs)
A moving obstacle that teams must avoid.
waypoints
The waypoints the obstacle attempts to follow.
speed_avg
The average speed of the obstacle in knots.
sphere_radius
The radius of the sphere in feet.
class auvsi_suas.models.FlyZone(*args, **kwargs)
An approved area for UAS flight. UAS shall be in at least one zone.
boundary_pts
The polygon defining the boundary of the zone.
altitude_msl_min
The minimum altitude of the zone (MSL) in feet.
altitude_msl_max
The maximum altitude of the zone (MSL) in feet.

1.2. Configuration 11
AUVSI SUAS Interoperability Documentation, Release 2017.1

class auvsi_suas.models.MissionConfig(*args, **kwargs)


The details for the mission.
is_active
Whether the mission is active. Only one mission can be active at a time.
home_pos
The home position for use as a reference point. Should be the tents.
fly_zones
Valid areas for the UAS to fly.
mission_waypoints
The waypoints that define the mission waypoint path
search_grid_points
The polygon that defines the search grid.
targets
The judge created targets.
emergent_last_known_pos
The last known position of the emergent target.
off_axis_target_pos
Off-axis target position.
air_drop_pos
The air drop position.
stationary_obstacles
The stationary obstacles.
moving_obstacles
The moving obstacles.
class auvsi_suas.models.MissionClockEvent(*args, **kwargs)
Marker for a team going on/off mission clock.
team_on_clock
Whether the team is now on the mission clock.
team_on_timeout
Whether the team is now in a timeout.
class auvsi_suas.models.TakeoffOrLandingEvent(*args, **kwargs)
Marker for a UAS takeoff/landing. UAS must interop during that time.
uas_in_air
Whether the UAS is now in the air.

1.3 Interface Specification

This section describes the interoperability interface that is implemented by the AUVSI SUAS competition server.
Teams should use this documentation to integrate with the competition server.

12 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

1.3.1 Hostname & Port

The competition will specify the hostname and port during the competition. Teams will not have this during the
development and testing period. For testing purposes, teams can use the provided competition server to evaluate their
system. The hostname will be the IP address of the computer on which the server is running, and the port will be
the port selected when starting the server. Teams must be able to specify this to their system during the mission.
The hostname can also be the hostname given to the computer. The hostname localhost is a reserved name for
the local host, and it resolves to the loopback IP address 127.0.0.1. An example hostname and port combination is
192.168.1.2:8080.

1.3.2 Relative URLs

The relative URLs (endpoints) are described further in the following sections. The interface defined in this document
is what will be used at the competition. Only slight changes may be made leading up to the competition to fix bugs
or add features. Teams should synchronize their code and check this documentation for updates. An example relative
URL is /api/server_info.

1.3.3 Full Resource URL

The full resource URL is the combination of the hostname, port, and relative URL. This is the URL that must be used
to make requests. An example full resource URL is http://192.168.1.2:80/api/login.

1.3.4 Endpoints

Below are all of the endpoints provided by the server, displayed by their relative URL, and the HTTP method with
which you access them.
A quick summary of the endpoints:
POST /api/login: Used to authenticate with the competition server so that future requests will be authen-
ticated. Teams cannot make other requests without logging in successfully.
GET /api/missions: Used to get details for available missions.
GET /api/missions/(int:id): Used to get details for a mission.
GET /api/obstacles: Used to download obstacle information from the competition server for purpose of
displaying it and avoiding the obstacles.
POST /api/telemetry: Used to upload UAS telemetry information to the competition server. Uploading
telemetry to this endpoint is required by the competition rules.
POST /api/targets: Used to upload targets for submission.
GET /api/targets: Used to retrieve targets uploaded for submission.
GET /api/targets/(int:id): Used to get details about submitted targets.
PUT /api/targets/(int:id): Used to update characteristics of submitted targets.
DELETE /api/targets/(int:id): Used to delete a submitted target.
GET /api/targets/(int:id)/image: Used to get target image previously submitted.
POST /api/targets/(int:id)/image: Used to submit or update target image thumbnail.
DELETE /api/targets/(int:id)/image: Used to delete target image thumbnail.

1.3. Interface Specification 13


AUVSI SUAS Interoperability Documentation, Release 2017.1

Errors

Some of the HTTP request errors you may receive when using this API:
404 Not Found: The request was made to an invalid URL, the server does not know how to respond to such a
request. Check the endpoint URL.
405 Method Not Allowed: The request used an invalid method (e.g., GET when only POST is supported).
Double check the documentation below for the methods supported by each endpoint.
500 Internal Server Error: The server encountered an internal error and was unable to process the request. This
indicates a configuration error on the server side.

User Login

POST /api/login
Teams login to the competition server by making an HTTP POST request with two parameters: username and
password. Teams only need to make a login once before any other requests. The login request, if successful,
will return cookies that uniquely identify the user and the current session. Teams must send these cookies to the
competition server in all future requests.
Example Request:
POST /api/login HTTP/1.1
Host: 192.168.1.2:8000
Content-Type: application/x-www-form-urlencoded

username=testadmin&password=testpass

Example Response:
HTTP/1.1 200 OK
Set-Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi; expires=Mon, 17-Aug-2015 02:41:09 GMT; h

Login Successful.

Form Parameters
username This parameter is the username that the judges give teams during the compe-
tition. This is a unique identifier that will be used to associate the requests as your teams.
password This parameter is the password that the judges give teams during the compe-
tition. This is used to ensure that teams do not try to spoof other teams usernames, and that
requests are authenticated with security.
Response Headers
Set-Cookie Upon successful login, a session cookie will be sent back to the client. This
cookie must be sent with each subsequent request, authenticating the request.
Status Codes
200 OK Successful logins will have a response status code of 200. The content of the
response will be a success message. The response will also include cookies which must be
sent with future requests.
400 Bad Request Unsuccessful logins will have a response status code of 400. The content
of the response will be an error message indicating why the request failed. Requests can
fail because the request was missing one of the required parameters, or had invalid login
information.

14 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

Missions

GET /api/missions
This endpoint is used to retrieve a list of available missions and details.
Example Request:
GET /api/missions HTTP/1.1
Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi

Example Response:
Note: This example reformatted for readability; actual response may be entirely on one line.
HTTP/1.1 200 OK
Content-Type: application/json

[
{
"id": 1,
"active": true,
"air_drop_pos": {
"latitude": 38.141833,
"longitude": -76.425263
},
"fly_zones": [
{
"altitude_msl_max": 200.0,
"altitude_msl_min": 100.0,
"boundary_pts": [
{
"latitude": 38.142544,
"longitude": -76.434088,
"order": 1
},
{
"latitude": 38.141833,
"longitude": -76.425263,
"order": 2
},
{
"latitude": 38.144678,
"longitude": -76.427995,
"order": 3
}
]
}
],
"home_pos": {
"latitude": 38.14792,
"longitude": -76.427995
},
"mission_waypoints": [
{
"altitude_msl": 200.0,
"latitude": 38.142544,
"longitude": -76.434088,
"order": 1
}

1.3. Interface Specification 15


AUVSI SUAS Interoperability Documentation, Release 2017.1

],
"off_axis_target_pos": {
"latitude": 38.142544,
"longitude": -76.434088
},
"emergent_last_known_pos": {
"latitude": 38.145823,
"longitude": -76.422396
},
"search_grid_points": [
{
"altitude_msl": 200.0,
"latitude": 38.142544,
"longitude": -76.434088,
"order": 1
}
]
}
]

The response format is a list of mission objects. Each is in the same as GET /api/missions/(int:id)
and is described in detail there.
If no missions have been created, the response will contain an empty list.
Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Response Headers
Content-Type The response is application/json on success.
Status Codes
200 OK Success. Response contains missions.
403 Forbidden User not authenticated. Login is required before using this endpoint. En-
sure POST /api/login was successful, and the login cookie was sent to this endpoint.
GET /api/missions/(int: id)
This endpoint gets the details about a mission with id id.
Example request:
GET /api/missions/1 HTTP/1.1
Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi

Example response:
Note: This example reformatted for readability; actual response may be entirely on one line.
HTTP/1.1 200 OK
Content-Type: application/json

{
"id": 1,
"active": true,
"air_drop_pos": {
"latitude": 38.141833,

16 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

"longitude": -76.425263
},
"fly_zones": [
{
"altitude_msl_max": 200.0,
"altitude_msl_min": 100.0,
"boundary_pts": [
{
"latitude": 38.142544,
"longitude": -76.434088,
"order": 1
},
{
"latitude": 38.141833,
"longitude": -76.425263,
"order": 2
},
{
"latitude": 38.144678,
"longitude": -76.427995,
"order": 3
}
]
}
],
"home_pos": {
"latitude": 38.14792,
"longitude": -76.427995
},
"mission_waypoints": [
{
"altitude_msl": 200.0,
"latitude": 38.142544,
"longitude": -76.434088,
"order": 1
}
],
"off_axis_target_pos": {
"latitude": 38.142544,
"longitude": -76.434088
},
"emergent_last_known_pos": {
"latitude": 38.145823,
"longitude": -76.422396
},
"search_grid_points": [
{
"altitude_msl": 200.0,
"latitude": 38.142544,
"longitude": -76.434088,
"order": 1
}
]
}

Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-

1.3. Interface Specification 17


AUVSI SUAS Interoperability Documentation, Release 2017.1

ticate the request.


Response Headers
Content-Type The response is application/json on success.
Response JSON Object
id (int) Unique identifier for this mission.
active (boolean) Whether the mission is active. Only a single mission should be
active, and it should be the mission the team is interacting with.
air_drop_pos (object) The position of the air drop.
fly_zones (array) A list of fly_zone boundaries. The UAS must be within one of
these boundaries at all times. A single boundary consists of a GPS polygon and an altitude
range. The UAS is within the boundary if it is both inside the polygon and the altitude range.
altitude_msl_min (float) (member of fly_zones) The minimum altitude in
feet MSL.
altitude_msl_max (float) (member of fly_zones) The maximum altitude in
feet MSL.
boundary_pts (array) (member of fly_zones) A list of waypoints defining a
polygon.
home_pos (object) The launch point of the UAVs (flight-line tents).
mission_waypoints (array) A list of waypoints the UAS must traverse.
off_axis_target_pos (object) The GPS position of the off-axis target.
emergent_last_known_pos (object) The last known GPS position of the emer-
gent target.
search_grid_points (array) A list of waypoints defining the search grid polygon.
gps_position (object) (Type for air_drop_ops, home_pos,
off_axis_target_pos) Consists of a latitude and longitude.
waypoint (object) (Type for boundary_pts, mission_waypoints, and
search_grid_points) Consists of a order number (relative ordering between set of
waypoints), latitude, longitude, and optional altitude.
latitude (float) (Member of gps_position and waypoint) Latitude in decimal
degrees.
longitude (float) (Member of gps_position and waypoint) Longitude in dec-
imal degrees.
altitude_msl (float) (Member of waypoint) Altitude in feet MSL.
Status Codes
200 OK Success. Response contains mission details.
403 Forbidden User not authenticated. Login is required before using this endpoint. En-
sure POST /api/login was successful, and the login cookie was sent to this endpoint.
404 Not Found Mission not found. Check ID.

18 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

Obstacle Information

GET /api/obstacles
Teams make requests to obtain obstacle information for purpose of displaying the information and for avoiding
the obstacles. This request is a GET request with no parameters. The data returned will be in JSON format.
Example Request:
GET /api/obstacles HTTP/1.1
Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi

Example Response:
Note: This example reformatted for readability; actual response may be entirely on one line.
HTTP/1.1 200 OK
Content-Type: application/json

{
"moving_obstacles": [
{
"altitude_msl": 189.56748784643966,
"latitude": 38.141826869853645,
"longitude": -76.43199876559223,
"sphere_radius": 150.0
},
{
"altitude_msl": 250.0,
"latitude": 38.14923628783763,
"longitude": -76.43238529543882,
"sphere_radius": 150.0
}
],
"stationary_obstacles": [
{
"cylinder_height": 750.0,
"cylinder_radius": 300.0,
"latitude": 38.140578,
"longitude": -76.428997
},
{
"cylinder_height": 400.0,
"cylinder_radius": 100.0,
"latitude": 38.149156,
"longitude": -76.430622
}
]
}

Note: The stationary_obstacles and moving_obstacles fields are lists. This means that there can
be 0, 1, or many objects contained within each list. Above shows an example with 2 moving obstacles and 2
stationary obstacles.
Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Response Headers

1.3. Interface Specification 19


AUVSI SUAS Interoperability Documentation, Release 2017.1

Content-Type The response is application/json on success.


Response JSON Object
moving_obstacles (array) List of zero or more moving obstacles.
stationary_obstacles (array) List of zero or more stationary obstacles.
latitude (float) (member of object in moving_obstacles or
stationary_obstacles) The obstacles current altitude in degrees.
longitude (float) (member of object in moving_obstacles or
stationary_obstacles) The obstacles current longitude in degrees.
altitude_msl (float) (member of object in moving_obstacles) The moving
obstacles current centroid altitude in feet MSL.
sphere_radius (float) (member of object in moving_obstacles) The moving
obstacles radius in feet.
cylinder_radius (float) (member of object in stationary_obstacles) The
stationary obstacles radius in feet.
cylinder_height (float) (member of object in stationary_obstacles) The
stationary obstacles height in feet.
Status Codes
200 OK The team made a valid request. The request will be logged to later evaluate
request rates. The response will have status code 200 to indicate success, and it will have
content in JSON format. This JSON data is the server information that teams must display,
and it contains data which can be used to avoid the obstacles. The format for the JSON data
is given below.
403 Forbidden User not authenticated. Login is required before using this endpoint. En-
sure POST /api/login was successful, and the login cookie was sent to this endpoint.

UAS Telemetry

POST /api/telemetry
Teams make requests to upload the UAS telemetry to the competition server. The request is a POST request
with parameters latitude, longitude, altitude_msl, and uas_heading.
Each telemetry request should contain unique telemetry data. Duplicated data will be accepted but not evaluated.
Example Request:
POST /api/telemetry HTTP/1.1
Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi
Content-Type: application/x-www-form-urlencoded

latitude=38.149&longitude=-76.432&altitude_msl=100&uas_heading=90

Example Response:
HTTP/1.1 200 OK

UAS Telemetry Successfully Posted.

Request Headers

20 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Form Parameters
latitude The latitude of the aircraft as a floating point degree value. Valid values are:
-90 <= latitude <= 90.
longitude The longitude of the aircraft as a floating point degree value. Valid values
are: -180 <= longitude <= 180.
altitude_msl The height above mean sea level (MSL) of the aircraft in feet as a
floating point value.
uas_heading The (true north) heading of the aircraft as a floating point degree value.
Valid values are: 0 <= uas_heading <= 360.
Status Codes
200 OK The team made a valid request. The information will be stored on the competition
server to evaluate various competition rules. The content of the response will have a success
message.
400 Bad Request Invalid requests will return a response code of 400. A request will be
invalid if the user did not specify a parameter, or if the user specified an invalid value for
a parameter. The content of the response will have an error message indicating what went
wrong.
403 Forbidden User not authenticated. Login is required before using this endpoint. En-
sure POST /api/login was successful, and the login cookie was sent to this endpoint.

Targets

POST /api/targets
This endpoint is used to upload a new target for submission. All targets uploaded at the end of the mission time
will be evaluated by the judges.
Most of the target characteristics are optional; if not provided in this initial POST request, they may be added in
a future PUT request. Characteristics not provided will be considered left blank. Note that some characteristics
must be submitted by the end of the mission to earn credit for the target.
The fields that should be used depends on the type of target being submitted. Refer to TargetTypes for more
detail.
Example Request:
POST /api/targets HTTP/1.1
Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi
Content-Type: application/json

{
"type": "standard",
"latitude": 38.1478,
"longitude": -76.4275,
"orientation": "n",
"shape": "star",
"background_color": "orange",
"alphanumeric": "C",
"alphanumeric_color": "black"
}

1.3. Interface Specification 21


AUVSI SUAS Interoperability Documentation, Release 2017.1

Example Response:
Note: This example reformatted for readability; actual response may be entirely on one line.
HTTP/1.1 201 CREATED
Content-Type: application/json

{
"id": 1,
"user": 1,
"type": "standard",
"latitude": 38.1478,
"longitude": -76.4275,
"orientation": "n",
"shape": "star",
"background_color": "orange",
"alphanumeric": "C",
"alphanumeric_color": "black",
"description": null,
"autonomous": false
}

The response format is the same as GET /api/targets/(int:id) and is described in detail there.
Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Content-Type The request should be sent as application/json.
Request JSON Object
type (string) (required) Target type; must be one of TargetTypes.
latitude (float) (optional) Target latitude (decimal degrees). If latitude is pro-
vided, longitude must also be provided.
longitude (float) (optional) Target longitude (decimal degrees). If longitude is
provided, latitude must also be provided.
orientation (string) (optional) Target orientation; must be one of
Orientations.
shape (string) (optional) Target shape; must be one of Shapes.
background_color (string) (optional) Target background color (portion of the
target outside the alphanumeric); must be one of Colors.
alphanumeric (string) (optional) Target alphanumeric; may consist of one or more
of the characters 0-9, A-Z, a-z. It is case sensitive.
alphanumeric_color (string) (optional) Target alphanumeric color; must be one
of Colors.
description (string) (optional) Free-form description of target. This should be
used for describing certain target types (see TargetTypes).
autonomous (boolean) (optional, default false) This target was detected, localized,
and characterized by the teams ADLC system, per section 7.3 of the rules. Note that if this
field is set, then detection, localization, and characterization must be autonomous, with
no human input. Per section 7.3 of the rules, no more than six targets should be marked
autonomous.

22 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

Response Headers
Content-Type The response is application/json on success.
Status Codes
201 Created The target has been accepted and a record has been created for it. The record
has been included in the response.
400 Bad Request Request was invalid. The request content may have been malformed,
missing required fields, or may have contained invalid field values. The response includes a
more detailed error message.
403 Forbidden User not authenticated. Login is required before using this endpoint. En-
sure POST /api/login was successful, and the login cookie was sent to this endpoint.
GET /api/targets
This endpoint is used to retrieve a list of targets uploaded for submission.
The targets returned by this endpoint are those that have been uploaded with POST /api/targets and
possibly updated with PUT /api/targets/(int:id).

Note: This endpoint will only return up to 100 targets. It is recommended to remain below 100 targets total
(there certainly wont be that many at competition!). If you do have more than 100 targets, individual targets
may be queried with GET /api/targets/(int:id).

Example request:
GET /api/targets HTTP/1.1
Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi

Example response:
Note: This example reformatted for readability; actual response may be entirely on one line.
HTTP/1.1 200 OK
Content-Type: application/json

[
{
"id": 1,
"user": 1,
"type": "standard",
"latitude": 38.1478,
"longitude": -76.4275,
"orientation": "n",
"shape": "star",
"background_color": "orange",
"alphanumeric": "C",
"alphanumeric_color": "black",
"description": null,
"autonomous": false
},
{
"id": 2,
"user": 1,
"type": "qrc",
"latitude": 38.1878,
"longitude": -76.4075,

1.3. Interface Specification 23


AUVSI SUAS Interoperability Documentation, Release 2017.1

"orientation": null,
"shape": null,
"background_color": null,
"alphanumeric": null,
"alphanumeric_color": null,
"description": "http://auvsi-seafarer.org",
"autonomous": false
}
]

The response format is a list of target objects. Each is in the same as GET /api/targets/(int:id) and
is described in detail there.
If no targets have been uploaded, the response will contain an empty list.
Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Response Headers
Content-Type The response is application/json on success.
Status Codes
200 OK Success. Response contains targets.
403 Forbidden User not authenticated. Login is required before using this endpoint. En-
sure POST /api/login was successful, and the login cookie was sent to this endpoint.
GET /api/targets/(int: id)
Details about a target id id. This simple endpoint allows you to verify the uploaded characteristics of a target.
id is the unique identifier of a target, as returned by POST /api/targets. When you first upload your target
to POST /api/targets, the response includes an id field, whose value you use to access this endpoint.
Note that this id is unique to all teams and will not necessarily start at 1 or increase linearly with additional
targets.
Example request:
GET /api/targets/1 HTTP/1.1
Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi

Example response:
Note: This example reformatted for readability; actual response may be entirely on one line.
HTTP/1.1 200 OK
Content-Type: application/json

{
"id": 1,
"user": 1,
"type": "standard",
"latitude": 38.1478,
"longitude": -76.4275,
"orientation": "n",
"shape": "star",
"background_color": "orange",
"alphanumeric": "C",

24 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

"alphanumeric_color": "black",
"description": null,
"autonomous": false
}

Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Response Headers
Content-Type The response is application/json on success.
Response JSON Object
id (int) Unique identifier for this target. This is unique across all teams, it may not
naturally increment 1-10. Used to reference specific targets in various endpoints. The target
ID does not change when a target is updated.
user (int) Unique identifier for the team. Teams should not need to use this field.
type (string) Target type; one of TargetTypes.
latitude (float) Target latitude in decimal degrees, or null if no latitude specified
yet.
longitude (float) Target longitude in decimal degrees, or null if no longitude
specified yet.
orientation (string) Target orientation; one of Orientations, or null if no
orientation specified yet.
shape (string) Target shape; one of Shapes, or null if no shape specified yet.
background_color (string) Target background color; one of Colors, or null if
no background color specified yet.
alphanumeric (string) Target alphanumeric; null if no alphanumeric specified
yet.
alphanumeric_color (string) Target alphanumeric color; one of Colors, or
null if no alphanumeric color specified yet.
description (string) Target description; null if no description specified yet.
autonomous (boolean) Target is an ADLC target.
Status Codes
200 OK Success. Response contains target details.
403 Forbidden
User not authenticated. Login is required before using this endpoint. Ensure POST
/api/login was successful, and the login cookie was sent to this endpoint.
The specified target was found but is not accessible by your user (i.e., another team created
this target). Check target ID.
Check response for detailed error message.
404 Not Found Target not found. Check target ID.

1.3. Interface Specification 25


AUVSI SUAS Interoperability Documentation, Release 2017.1

PUT /api/targets/(int: id)


Update target id id. This endpoint allows you to specify characteristics that were omitted in POST
/api/targets, or update those that were specified.
id is the unique identifier of a target, as returned by POST /api/targets. See GET
/api/targets/(int:id) for more information about the target ID.
Example request:
PUT /api/targets/1 HTTP/1.1
Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi
Content-Type: application/json

{
"alphanumeric": "O"
}

Example response:
Note: This example reformatted for readability; actual response may be entirely on one line.
HTTP/1.1 200 OK
Content-Type: application/json

{
"id": 1,
"user": 1,
"type": "standard",
"latitude": 38.1478,
"longitude": -76.4275,
"orientation": "n",
"shape": "star",
"background_color": "orange",
"alphanumeric": "O",
"alphanumeric_color": "black",
"description": null,
"autonomous": false
}

This endpoint accepts all fields described in POST /api/targets in its request. Any fields that are specified
will be updated, overwriting the old value. Any fields omitted will not be changed. Specifying a field with a
null value will clear that field (except type, which may never be null).
In the example above, only the alphanumeric field was sent to in the request. As can be seen in the response,
the alphanumeric field has the new value, but all other fields have been left unchanged.
The response format is the same as GET /api/targets/(int:id) and is described in detail there.
Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Content-Type The request should be sent as application/json.
Response Headers
Content-Type The response is application/json on success.
Status Codes

26 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

200 OK The target has been successfully updated, and the updated target is included in
the response.
400 Bad Request Request was invalid. The request content may have been malformed
or it may have contained invalid field values. The response includes a more detailed error
message.
403 Forbidden
User not authenticated. Login is required before using this endpoint. Ensure POST
/api/login was successful, and the login cookie was sent to this endpoint.
The specified target was found but is not accessible by your user (i.e., another team created
this target). Check target ID.
Check response for detailed error message.
404 Not Found Target not found. Check target ID.
DELETE /api/targets/(int: id)
Delete target id id. This endpoint allows you to remove a target from the server entirely (including its image).
Targets deleted with this endpoint will not be scored, and cannot be recovered. If a target is deleted accidentally,
reupload it as a new target.
id is the unique identifier of a target, as returned by POST /api/targets. See GET
/api/targets/(int:id) for more information about the target ID.
Example request:
DELETE /api/targets/1 HTTP/1.1
Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi

Example response:
HTTP/1.1 200 OK
Content-Type: text/html

Target deleted.

Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Status Codes
200 OK The target has been successfully deleted. It will not be scored.
403 Forbidden
User not authenticated. Login is required before using this endpoint. Ensure POST
/api/login was successful, and the login cookie was sent to this endpoint.
The specified target was found but is not accessible by your user (i.e., another team created
this target). Check target ID.
Check response for detailed error message.
404 Not Found Target not found. Check target ID.

GET /api/targets/(int: id)/image


Download previously uploaded target thumbnail. This simple endpoint returns the target thumbnail uploaded
with a POST /api/targets/(int:id)/image request.

1.3. Interface Specification 27


AUVSI SUAS Interoperability Documentation, Release 2017.1

id is the unique identifier of a target, as returned by POST /api/targets. See GET


/api/targets/(int:id) for more information about the target ID.
The response content is the image content itself on success.
Example request:
GET /api/targets/2/image HTTP/1.1
Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi

Example response:
HTTP/1.1 200 OK
Content-Type: image/jpeg

<binary image content ...>

Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Response Headers
Content-Type Matches content type of uploaded image. For example, JPEG is
image/jpeg.
Status Codes
200 OK Target image found and included in response.
403 Forbidden
User not authenticated. Login is required before using this endpoint. Ensure POST
/api/login was successful, and the login cookie was sent to this endpoint.
The specified target was found but is not accessible by your user (i.e., another team created
this target). Check target ID.
Check response for detailed error message.
404 Not Found
Target not found. Check target ID.
Target does not have associated image. One must first be uploaded with POST
/api/targets/(int:id)/image.

POST /api/targets/(int: id)/image


Add or update target image thumbnail.
id is the unique identifier of a target, as returned by POST /api/targets. See GET
/api/targets/(int:id) for more information about the target ID.
This endpoint is used to submit an image of the associated target. This image should be a clear, close crop of
the target. Subsequent calls to this endpoint replace the target image.
The request body contains the raw binary content of the image. The image should be in either JPEG or PNG
format. The request must not exceed 1 MB in size.
Example request:

28 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

POST /api/targets/2/image HTTP/1.1


Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi
Content-Type: image/jpeg

<binary image content ...>

Example response:
HTTP/1.1 200 OK

Image uploaded.

Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Content-Type JPEG images should be image/jpeg. PNG images should be
image/png.
Status Codes
200 OK The target image has been successfully uploaded.
400 Bad Request Request was not a valid JPEG or PNG image. The response includes a
more detailed error message.
403 Forbidden
User not authenticated. Login is required before using this endpoint. Ensure POST
/api/login was successful, and the login cookie was sent to this endpoint.
The specified target was found but is not accessible by your user (i.e., another team created
this target). Check target ID.
Check response for detailed error message.
404 Not Found Target not found. Check target ID.
413 Request Entity Too Large Image exceeded 1MB in size.

PUT /api/targets/(int: id)/image


Equivalent to POST /api/targets/(int:id)/image.
DELETE /api/targets/(int: id)/image
Delete target image thumbnail.
id is the unique identifier of a target, as returned by POST /api/targets. See GET
/api/targets/(int:id) for more information about the target ID.
This endpoint is used to delete the image associated with a target. A deleted image will not be used in scoring.

Note: You do not need to delete the target image before uploading a new image. A call to POST
/api/targets/(int:id)/image or PUT /api/targets/(int:id)/image will overwrite the
existing image.

Example request:

1.3. Interface Specification 29


AUVSI SUAS Interoperability Documentation, Release 2017.1

DELETE /api/targets/2/image HTTP/1.1


Host: 192.168.1.2:8000
Cookie: sessionid=9vepda5aorfdilwhox56zhwp8aodkxwi

Example response:
HTTP/1.1 200 OK

Image deleted.

Request Headers
Cookie The session cookie obtained from POST /api/login must be sent to authen-
ticate the request.
Status Codes
200 OK The target image has been successfully deleted.
403 Forbidden
User not authenticated. Login is required before using this endpoint. Ensure POST
/api/login was successful, and the login cookie was sent to this endpoint.
The specified target was found but is not accessible by your user (i.e., another team created
this target). Check target ID.
Check response for detailed error message.
404 Not Found
Target not found. Check target ID.
The specified target had no existing image to delete.

TargetTypes
These are the valid types of targets which may be specified.
standard - Standard targets are described in section 7.2.7 of the rules.
Describe the target characteristics with these fields (see POST /api/targets):
latitude
longitude
orientation
shape
background_color
alphanumeric
alphanumeric_color
autonomous

qrc - Quick Response Code (QRC) targets are described in section 7.2.8 of the rules.

Describe the target characteristics with these fields (see POST /api/targets):
latitude
longitude

30 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

description
This field should contain the exact QRC message.

off_axis - Off-axis targets are described in section 7.5 of the rules.

Describe the target characteristics with these fields (see POST /api/targets):
orientation
shape
background_color
alphanumeric
alphanumeric_color

emergent - Emergent targets are described in section 7.6 of the rules.

Describe the target characteristics with these fields (see POST /api/targets):
latitude
longitude
description
This field should contain a general description of the emergent target.
Orientations
These are the valid orientations that may be specified for a target. They reference true north, not magnetic north.
N - North
NE - Northeast
E - East
SE - Southeast
S - South
SW - Southwest
W - West
NW - Northwest
Shapes
These are the valid shapes that may be specified for a target.
circle
semicircle
quarter_circle
triangle
square
rectangle
trapezoid
pentagon

1.3. Interface Specification 31


AUVSI SUAS Interoperability Documentation, Release 2017.1

hexagon
heptagon
octagon
star
cross
Colors
These are the valid colors that may be specified for a target.
white
black
gray
red
blue
green
yellow
purple
brown
orange

1.4 Client Library

The competition provides a Python client library for communicating with the interoperability server. It can be found
in /client/interop/ in the repository and in the client Docker image.
Note this library does not provide client-side request validation. It relies on the server to reject invalid requests, like
rejecting Target objects with an invalid shape.
class interop.Client(url, username, password, timeout=1)
Client which provides authenticated access to interop API.
The constructor makes a login request, and all future requests will automatically send the authentication cookie.
This client uses a single session to make blocking requests to the interoperability server. This is the base core
implementation. The AsyncClient uses this base Client to add performance features.
__init__(url, username, password, timeout=1)
Create a new Client and login.
Parameters
url Base URL of interoperability server (e.g., http://localhost:8000).
username Interoperability username.
password Interoperability password.
timeout Individual session request timeout (seconds).
delete(uri)
DELETE request to server.
Parameters uri Server URI to access (without base URL).

32 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

Raises
InteropError Error from server.
requests.Timeout Request timeout.
delete_target(target_id)
DELETE target.
Parameters target_id The ID of the target to delete.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
delete_target_image(target_id)
DELETE target image.
Parameters target_id The ID of the target image to delete.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
get(uri, **kwargs)
GET request to server.
Parameters
uri Server URI to access (without base URL).
**kwargs Arguments to requests.Session.get method.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
get_missions()
GET missions.
Returns List of Mission.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
ValueError or AttributeError Malformed response from server.
get_obstacles()
GET obstacles.
Returns List of StationaryObstacles and list of MovingObstacles i.e., ([StationaryObstacle],
[MovingObstacles]).
Raises
InteropError Error from server.
requests.Timeout Request timeout.
ValueError or AttributeError Malformed response from server.

1.4. Client Library 33


AUVSI SUAS Interoperability Documentation, Release 2017.1

get_target(target_id)
GET target.
Parameters target_id The ID of the target to get.
Returns Target object with corresponding ID.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
ValueError or AttributeError Malformed response from server.
get_target_image(target_id)
GET target image.
Parameters target_id The ID of the target for which to get the image.
Returns The image data that was previously uploaded.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
get_targets()
GET targets.
Returns List of Target objects which are viewable by user.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
ValueError or AttributeError Malformed response from server.
post(uri, **kwargs)
POST request to server.
Parameters
uri Server URI to access (without base URL).
**kwargs Arguments to requests.Session.post method.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
post_target(target)
POST target.
Parameters target The target to upload.
Returns The target after upload, which will include the target ID and user.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
ValueError or AttributeError Malformed response from server.

34 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

post_target_image(target_id, image_data)
POST target image. Image must be PNG or JPEG data.
Parameters
target_id The ID of the target for which to upload an image.
image_data The image data (bytes loaded from file) to upload.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
post_telemetry(telem)
POST new telemetry.
Parameters telem Telemetry object containing telemetry state.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
put(uri, **kwargs)
PUT request to server.
Parameters
uri Server URI to access (without base URL).
**kwargs Arguments to requests.Session.put method.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
put_target(target_id, target)
PUT target.
Parameters
target_id The ID of the target to update.
target The target details to update.
Returns The target after being updated.
Raises
InteropError Error from server.
requests.Timeout Request timeout.
ValueError or AttributeError Malformed response from server.
put_target_image(target_id, image_data)
PUT target image. Image must be PNG or JPEG data.
Parameters
target_id The ID of the target for which to upload an image.
image_data The image data (bytes loaded from file) to upload.
Raises

1.4. Client Library 35


AUVSI SUAS Interoperability Documentation, Release 2017.1

InteropError Error from server.


requests.Timeout Request timeout.
class interop.AsyncClient(url, username, password, timeout=1, workers=8)
Client which uses the base to be more performant.
This client uses Futures with a ThreadPoolExecutor. This allows requests to be executed asynchronously. Asyn-
chronous execution with multiple Clients enables requests to be processed in parallel and with pipeline execution
at the server, which can drastically improve achievable interoperability rate as observed at the client.
Note that methods return Future objects. Users should handle the response and errors appropriately. If serial
request execution is desired, ensure the Future response or error is received prior to making another request.
__init__(url, username, password, timeout=1, workers=8)
Create a new AsyncClient and login.
Parameters
url Base URL of interoperability server (e.g., http://localhost:8000)
username Interoperability username
password Interoperability password
timeout Individual session request timeout (seconds)
workers Number of threads to use for sending/receiving requests.
delete_target(target_id)
DELETE target.
Parameters target_id The ID of the target to delete.
Returns Future object which contains the return value or error from the underlying Client.
delete_target_image(target_id)
DELETE target image.
Parameters target_id The ID of the target image to delete.
Returns Future object which contains the return value or error from the underlying Client.
get_missions()
GET missions.
Returns Future object which contains the return value or error from the underlying Client.
get_obstacles()
GET obstacles.
Returns Future object which contains the return value or error from the underlying Client.
get_target(target_id)
GET target.
Parameters target_id The ID of the target to get.
Returns Future object which contains the return value or error from the underlying Client.
get_target_image(target_id)
GET target image.
Parameters target_id The ID of the target for which to get the image.
Returns The image data that was previously uploaded.
Returns Future object which contains the return value or error from the underlying Client.

36 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

get_targets()
GET targets.
Returns Future object which contains the return value or error from the underlying Client.
post_target(target)
POST target.
Parameters target The target to upload.
Returns Future object which contains the return value or error from the underlying Client.
post_target_image(target_id, image_data)
POST target image. Image must be PNG or JPEG data.
Parameters
target_id The ID of the target for which to upload an image.
image_data The image data (bytes loaded from file) to upload.
Returns Future object which contains the return value or error from the underlying Client.
post_telemetry(telem)
POST new telemetry.
Parameters telem Telemetry object containing telemetry state.
Returns Future object which contains the return value or error from the underlying Client.
put_target(target_id, target)
PUT target.
Parameters
target_id The ID of the target to update.
target The target details to update.
Returns Future object which contains the return value or error from the underlying Client.
put_target_image(target_id, image_data)
PUT target image. Image must be PNG or JPEG data.
Parameters
target_id The ID of the target for which to upload an image.
image_data The image data (bytes loaded from file) to upload.
Returns Future object which contains the return value or error from the underlying Client.
exception interop.InteropError(response)
The interop server reported an error.
__init__(response)
Create an InteropError.
Parameters response requests.Response object that indicated the error.
class interop.Mission(id, active, air_drop_pos, fly_zones, home_pos, mission_waypoints,
off_axis_target_pos, search_grid_points, sric_pos)
Mission details.
id
The unique ID of the mission.

1.4. Client Library 37


AUVSI SUAS Interoperability Documentation, Release 2017.1

active
Whether the mission is active.
air_drop_pos
The GpsPosition of the air drop.
fly_zones
A list of FlyZone boundaries the UAS must be within.
home_pos
The GpsPosition of the UAS launch point (tents).
mission_waypoints
A list of Waypoint the UAS must traverse.
off_axis_target_pos
The GpsPosition of the off-axis target.
search_grid_points
List of Waypoint defining the search grid polygon.
sric_pos
The GpsPosition of the SRIC.

Raises ValueError Argument not convertable to int or float.

class interop.FlyZone(boundary_pts, altitude_msl_min, altitude_msl_max)


Flight boundary consisting of GPS polygon and altitude range.
boundary_pts
List of Waypoint defining a polygon.
altitude_msl_min
Minimum altitude in feet MSL.
altitude_msl_max
Maximum altitude in feet MSL.

Raises ValueError Argument not convertable to float.

class interop.Waypoint(order, latitude, longitude, altitude_msl=None)


Waypoint consisting of an order, GPS position, and optional altitude.
order
An ID giving relative order in a set of waypoints.
latitude
Latitude in decimal degrees.
longitude
Longitude in decimal degrees.
altitude
Optional. Altitude in feet MSL.

Raises ValueError Argument not convertable to int or float.

class interop.GpsPosition(latitude, longitude)


GPS position consisting of a latitude and longitude.

38 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

latitude
Latitude in decimal degrees.
longitude
Longitude in decimal degrees.

Raises ValueError Argument not convertable to float.

class interop.Telemetry(latitude, longitude, altitude_msl, uas_heading)


UAS Telemetry at a single point in time.
latitude
Latitude in decimal degrees.
longitude
Longitude in decimal degrees.
altitude_msl
Altitude MSL in feet.
uas_heading
Aircraft heading (true north) in degrees (0-360).

Raises ValueError Argument not convertable to float.

class interop.StationaryObstacle(latitude, longitude, cylinder_radius, cylinder_height)


A stationary obstacle.
This obstacle is a cylinder with a given location, height, and radius.
latitude
Latitude of the center of the cylinder in decimal degrees
longitude
Longitude of the center of the cylinder in decimal degrees
cylinder_radius
Radius in feet
cylinder_height
Height in feet

Raises ValueError Argument not convertable to float.

class interop.MovingObstacle(latitude, longitude, altitude_msl, sphere_radius)


A moving obstacle.
This obstacle is a sphere with a given location, altitude, and radius.
latitude
Latitude of the center of the cylinder in decimal degrees
longitude
Longitude of the center of the cylinder in decimal degrees
altitude_msl
Sphere centroid altitude MSL in feet
sphere_radius
Radius in feet

1.4. Client Library 39


AUVSI SUAS Interoperability Documentation, Release 2017.1

Raises ValueError Argument not convertable to float.

class interop.Target(id=None, user=None, type=None, latitude=None, longitude=None, orienta-


tion=None, shape=None, background_color=None, alphanumeric=None, al-
phanumeric_color=None, description=None, autonomous=False)
A target.
id
Optional. The ID of the target. Assigned by the interoperability server.
user
Optional. The ID of the user who created the target. Assigned by the interoperability server.
type
Target type, must be one of TargetType.
latitude
Optional. Target latitude in decimal degrees. If provided, longitude must also be provided.
longitude
Optional. Target longitude in decimal degrees. If provided, latitude must also be provided.
orientation
Optional. Target orientation.
shape
Optional. Target shape.
background_color
Optional. Target color.
alphanumeric
Optional. Target alphanumeric. [0-9, a-z, A-Z].
alphanumeric_color
Optional. Target alphanumeric color.
description
Optional. Free-form description of the target, used for certain target types.
autonomous
Optional; defaults to False. Indicates that this is an ADLC target.

Raises ValueError Argument not valid.

1.5 Debugging

This document contains useful means of debugging problems.


Server Log File. The competition server logs important events and debug information to a temporary log file. The
server writes useful debugging information to /var/log/apache2/interop_server_error.log. Users
can inspect this file during or after competition server execution to debug interoperability. For example, if your
implementation is getting denied due to invalid user credentials, the log will contain a message stating such and what
request parameters were provided at time of denial.
From a bash shell in the container, print out the log:
cat /var/log/apache2/interop_server_error.log

Watch for changes to the log:

40 Chapter 1. Contents
AUVSI SUAS Interoperability Documentation, Release 2017.1

tail -f /var/log/apache2/interop_server_error.log

Debug Mode. The settings.py file contains useful settings. One such setting is Debug, which you can set to True to
get additional debugging information. You need to restart the server for it to take affect.
sudo service apache2 restart

1.6 Automation

This section describes how to write admin automation for the interop server by writing scripts which connect directly
to the database and bypass the webserver. Note that the database and Django configurations only permit local access,
so youll need to run any such scripts locally. This may be useful while testing to automatically setup test cases (e.g.
test mission) or analyze results (e.g. turning radius).
Configure Django. The first step when writing a script is to import Django and have it setup for programmatic access.
Start the script with the following:
import os
import sys

# Add server code to Python PATH for imports.


sys.path.append('/path/to/server')
# Add environment variable to get Django settings file.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "server.settings")

# Setup Django.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Import SUAS Code. The next step is to import the various models that you want to access. The following shows how
to import the MissionConfig and GpsPosition models.
from auvsi_suas.models.gps_position import GpsPosition
from auvsi_suas.models.mission_config import MissionConfig

Read & Write Objects. The following shows how to read all MissionConfig objects and save a GpsPosition
object. For details on how to perform actions like this on Django models, see the Django Tutorials.
# Print all mission objects.
print MissionConfig.objects.all()

# Create and save a GPS position.


gpos = GpsPosition(latitudel=38.145335, longitude=-76.427512)
gpos.save()

Full Example. See the create_teams.py script for an end-to-end example of how the judges use this programmatic
access to automate team account creation.

1.6. Automation 41
AUVSI SUAS Interoperability Documentation, Release 2017.1

42 Chapter 1. Contents
CHAPTER 2

Indices & Tables

genindex
modindex
search

43
AUVSI SUAS Interoperability Documentation, Release 2017.1

44 Chapter 2. Indices & Tables


HTTP Routing Table

/api
GET /api/missions, 15
GET /api/missions/(int:id), 16
GET /api/obstacles, 19
GET /api/targets, 23
GET /api/targets/(int:id), 24
GET /api/targets/(int:id)/image, 27
POST /api/login, 14
POST /api/targets, 21
POST /api/targets/(int:id)/image, 28
POST /api/telemetry, 20
PUT /api/targets/(int:id), 25
PUT /api/targets/(int:id)/image, 29
DELETE /api/targets/(int:id), 27
DELETE /api/targets/(int:id)/image, 29

45
AUVSI SUAS Interoperability Documentation, Release 2017.1

46 HTTP Routing Table


Python Module Index

i
interop, 32

47
AUVSI SUAS Interoperability Documentation, Release 2017.1

48 Python Module Index


Index

Symbols D
__init__() (interop.AsyncClient method), 36 delete() (interop.Client method), 32
__init__() (interop.Client method), 32 delete_target() (interop.AsyncClient method), 36
__init__() (interop.InteropError method), 37 delete_target() (interop.Client method), 33
delete_target_image() (interop.AsyncClient method), 36
A delete_target_image() (interop.Client method), 33
active (interop.Mission attribute), 37 description (interop.Target attribute), 40
AerialPosition (class in auvsi_suas.models), 10 description (Target attribute), 10
air_drop_pos (interop.Mission attribute), 38
air_drop_pos (MissionConfig attribute), 12 E
alphanumeric (interop.Target attribute), 40 emergent_last_known_pos (MissionConfig attribute), 12
alphanumeric (Target attribute), 10
alphanumeric_color (interop.Target attribute), 40 F
alphanumeric_color (Target attribute), 10 fly_zones (interop.Mission attribute), 38
altitude (interop.Waypoint attribute), 38 fly_zones (MissionConfig attribute), 12
altitude_msl (AerialPosition attribute), 10 FlyZone (class in auvsi_suas.models), 11
altitude_msl (interop.MovingObstacle attribute), 39 FlyZone (class in interop), 38
altitude_msl (interop.Telemetry attribute), 39
altitude_msl_max (FlyZone attribute), 11 G
altitude_msl_max (interop.FlyZone attribute), 38 get() (interop.Client method), 33
altitude_msl_min (FlyZone attribute), 11 get_missions() (interop.AsyncClient method), 36
altitude_msl_min (interop.FlyZone attribute), 38 get_missions() (interop.Client method), 33
AsyncClient (class in interop), 36 get_obstacles() (interop.AsyncClient method), 36
autonomous (interop.Target attribute), 40 get_obstacles() (interop.Client method), 33
autonomous (Target attribute), 11 get_target() (interop.AsyncClient method), 36
get_target() (interop.Client method), 33
B get_target_image() (interop.AsyncClient method), 36
background_color (interop.Target attribute), 40 get_target_image() (interop.Client method), 34
background_color (Target attribute), 10 get_targets() (interop.AsyncClient method), 36
boundary_pts (FlyZone attribute), 11 get_targets() (interop.Client method), 34
boundary_pts (interop.FlyZone attribute), 38 gps_position (AerialPosition attribute), 10
gps_position (StationaryObstacle attribute), 11
C GpsPosition (class in auvsi_suas.models), 10
Client (class in interop), 32 GpsPosition (class in interop), 38
Colors (built-in variable), 32
creation_time (Target attribute), 11 H
cylinder_height (interop.StationaryObstacle attribute), 39 home_pos (interop.Mission attribute), 38
cylinder_height (StationaryObstacle attribute), 11 home_pos (MissionConfig attribute), 12
cylinder_radius (interop.StationaryObstacle attribute), 39
cylinder_radius (StationaryObstacle attribute), 11

49
AUVSI SUAS Interoperability Documentation, Release 2017.1

I put() (interop.Client method), 35


id (interop.Mission attribute), 37 put_target() (interop.AsyncClient method), 37
id (interop.Target attribute), 40 put_target() (interop.Client method), 35
interop (module), 32 put_target_image() (interop.AsyncClient method), 37
InteropError, 37 put_target_image() (interop.Client method), 35
is_active (MissionConfig attribute), 12
S
L search_grid_points (interop.Mission attribute), 38
last_modified_time (Target attribute), 11 search_grid_points (MissionConfig attribute), 12
latitude (GpsPosition attribute), 10 shape (interop.Target attribute), 40
latitude (interop.GpsPosition attribute), 38 shape (Target attribute), 10
latitude (interop.MovingObstacle attribute), 39 Shapes (built-in variable), 31
latitude (interop.StationaryObstacle attribute), 39 speed_avg (MovingObstacle attribute), 11
latitude (interop.Target attribute), 40 sphere_radius (interop.MovingObstacle attribute), 39
latitude (interop.Telemetry attribute), 39 sphere_radius (MovingObstacle attribute), 11
latitude (interop.Waypoint attribute), 38 sric_pos (interop.Mission attribute), 38
location (Target attribute), 10 stationary_obstacles (MissionConfig attribute), 12
longitude (GpsPosition attribute), 10 StationaryObstacle (class in auvsi_suas.models), 11
longitude (interop.GpsPosition attribute), 39 StationaryObstacle (class in interop), 39
longitude (interop.MovingObstacle attribute), 39
longitude (interop.StationaryObstacle attribute), 39 T
longitude (interop.Target attribute), 40 TakeoffOrLandingEvent (class in auvsi_suas.models), 12
longitude (interop.Telemetry attribute), 39 Target (class in auvsi_suas.models), 10
longitude (interop.Waypoint attribute), 38 Target (class in interop), 40
target_type (Target attribute), 10
M targets (MissionConfig attribute), 12
Mission (class in interop), 37 TargetTypes (built-in variable), 30
mission_waypoints (interop.Mission attribute), 38 team_on_clock (MissionClockEvent attribute), 12
mission_waypoints (MissionConfig attribute), 12 team_on_timeout (MissionClockEvent attribute), 12
MissionClockEvent (class in auvsi_suas.models), 12 Telemetry (class in interop), 39
MissionConfig (class in auvsi_suas.models), 11 thumbnail (Target attribute), 11
moving_obstacles (MissionConfig attribute), 12 thumbnail_approved (Target attribute), 11
MovingObstacle (class in auvsi_suas.models), 11 type (interop.Target attribute), 40
MovingObstacle (class in interop), 39
U
O uas_heading (interop.Telemetry attribute), 39
off_axis_target_pos (interop.Mission attribute), 38 uas_heading (UasTelemetry attribute), 10
off_axis_target_pos (MissionConfig attribute), 12 uas_in_air (TakeoffOrLandingEvent attribute), 12
order (interop.Waypoint attribute), 38 uas_position (UasTelemetry attribute), 10
order (Waypoint attribute), 11 UasTelemetry (class in auvsi_suas.models), 10
orientation (interop.Target attribute), 40 user (interop.Target attribute), 40
orientation (Target attribute), 10 user (Target attribute), 10
Orientations (built-in variable), 31
W
P Waypoint (class in auvsi_suas.models), 11
position (Waypoint attribute), 11 Waypoint (class in interop), 38
post() (interop.Client method), 34 waypoints (MovingObstacle attribute), 11
post_target() (interop.AsyncClient method), 37
post_target() (interop.Client method), 34
post_target_image() (interop.AsyncClient method), 37
post_target_image() (interop.Client method), 34
post_telemetry() (interop.AsyncClient method), 37
post_telemetry() (interop.Client method), 35

50 Index

Vous aimerez peut-être aussi