donkeycar@locate

We’re hosting a Donkeycar Race at Locate! This race will take place Day 2 in the parking lot right next to the conference venue.

On this page, you’ll find the software you need to integrate in your car in order to be able to compete. We call it the “Donkeycar Maps SDK” and at its core, it uses the same technology Mapbox embeds in real-world autonomous cars.

Note: Donkeycar is our reference platform, but all types of Robocars are allowed.

Sign Up Now!

donkeycar maps SDK

The SDK is composed of two elements:

  • A vector tile (download) that encodes the shape of the tracks for the race.
  • An open source Python SDK that you would use to decode the Vector Tile on-device.

vector tile track information

We have encoded real GPS coordinates of the track at Locate in the vector tile. Vector tiles are an open standard developed by Mapbox for caching, scaling, and serving map imagery rapidly. You can read more about vector tiles here.

We can use vector tiles to encode HD maps information for autonomous driving. For this race, we’ve encoded the tracks. They look like the large L (for Locate) drawn over the parking lot:

Decode the track coordinates

Use our Python SDK to decode the binary content of the vector tiles. It’s important to note, vector tiles do not include the raw GPS coordinates. Instead, coordinates are transformed into vector tile grid coordinates.

This is the code that we used to encode the vector tile linked above. The race begins now! In order to compete on race day, you’ll need to implement code that allows you to decode the data to obtain the actual track GPS coordinates:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import json
import sys
import vector_tile_base

# Locate's parking lot
origin = (-122.4020257, 37.8052695)

# Encoding function
def encode(ring):
  return [(int((coordinate[0] - origin[0]) * 1e7),
            int((coordinate[1] - origin[1]) * -1e7)) for coordinate in ring]

# Read GeoJSJON
source = sys.argv[1]
target = sys.argv[2]

with open(source, 'r') as geojson:
  polygon_data = json.load(geojson)

# Encode into Vector Tile
vt = vector_tile_base.VectorTile()
layer = vt.add_layer('robocar')
feature = layer.add_polygon_feature()
feature.add_ring(encode(polygon_data['geometry']['coordinates'][0]))

# Save to file
encoded_tile = vt.serialize()
f = open(target, "wb")
f.write(encoded_tile)
f.close()

That’s all - once you’ve decoded the vector tile, you can use the coordinates to instruct your Robocar to follow the tracks. Some participants will do all analysis on-device, others will transmit the data from their on-board sensors (cameras, sonar, LIDAR, radar, GPS or whatever else you have) via WiFi to a laptop that runs pro-grade AI and robotics software, including TensorFlow, ROS or the Udacity Self-Driving Car Nanodegree toolchain. Both approaches are allowed.

Rules and Judging

Rules for the race:

  • No tele-operators.
  • No V2V lasers to intentionally interfere with other cars.
  • Mapping software used to mine bitcoin needs to be disclosed to the SEC.

Judging is based on four best-of-class categories:

  • Neural networks FPS rate on front facing cameras
  • Localization using high percision GPS
  • LIDAR implementation under $100k
  • Last car standing

We will also give awards to anyone who open sources their training model or code as part of their entry.

questions

If you have any questions about this SDK or the Robocar race please email our Senior Robocar Driver.

For other questions about Locate, reach out via locate@mapbox.com.