Duckietown
Software Infrastructure
for Autonomous Robotics

Welcome toDuckietown

Hello Duckietown!
● Low-cost platform for autonomy education and research● Robotics and machine learning for students of all ages
● Teaches concepts in perception, planning, and control
with miniature autonomous vehicles in the classroom

Watchtower
April Tag

Tra

ffic

cameraDuckiebot

4

Mo

tor

Hat

Duckie

Raspb

erry
P

i3

B+

Duckiebots and Deep Learning● Duckiebots are battery-powered vehicles○○Camera is the only sensor
Classic computer vision pipeline■ Multiple stages of hand-designed image processing■ Proportional integral derivative (PID) controller■ Each robot needs to be individually calibrated● Mila is a deep learning research lab○○Students interested in applying DL & RL
Teach students to teach robots how to driveA Tale of Two Duckietowns● Gathering real data is real slow
○ Time consuming and tedious to collect■ Real robots break down, drain batteries○ Even worse if you need a diverse dataset■ Need to vary lighting conditions, etc.

● Simulation is an appealing alternative...
○ Can produce arbitrary amounts of data
○ Easy to augment with generated data
○ Simplifies reproducibility and verifiability
7

Machine learning is a changin’● Evolving tools, frameworks, and languages● Evolving domain models and architectures● Evolving hardware technology and platforms

Simulators and environments
Brockman, Greg, et al. "Openai gym." arXiv:1606.01540 (2016).

https://arxiv.org/pdf/1606.01540.pdf

Problem: Bias-Variance and Overfitting

Software is a changin’● Karpathy, Andrej. "Software 2.0." (2017).
https://medium.com/@karpathy/software-2-0-a64152b37c35

Benefits(Current) Limitations

●●
●
●

●
●
●
●

Computationally homogeneous
Portability & runtime characteristics
Predictable latency/accuracy tradeoffs
Modularity, portability, agility

Low interpretability
Unintuitive failure modes
Software stack is immature
Difficult to train and test

Robotics is a changin’

AgentEnvironment

Idealized Agent

Reality
Agent

ROS / Duckietown Tools (rviz, rqt_*, sh)Let’s try to make installs more repeatable
Step 1. Partition hard drive
Step 2. Install Ubuntu
Step 3. Install ROS
Step 4. Install Python stuff
Step 5. Configure network…
Step 98. source environment.sh
Step 99. catkin_make -C ...

$ dts init_sd_card

Containerization: A User Story
1.
2.
3.
4.
5.
6.

Type a short command, e.g. $ dts init_sd_card
Follow the installation wizard to flash an image.
Transfer flashed SD card to Duckiebot and boot.
Open a URL, e.g. http://duckiebot.local:9000/
Start or download a container, e.g. duckietown/rpi-duckiebot-base,duckietown/gym-duckietown-agent, duckietown/rpi-joystick-demo
Open a browser console and run, e.g. roslaunch joystick ...

Duckietown ROS Nodes

Reproducible Builds & Containerization● Benefits of containerization:○ Reproducible build and deployment artifacts○ Specified, documented software environments○ Reusable, multi-platform applications● Disadvantages:○ Learning curve for Docker containers○ GUI applications and X11○ Migration complexity

Docker management web UI

Docker management web UIContainerization: Deployment Models

Lessons Learned●

Be careful with Docker inheritance○●●Use a versioning scheme from the outset
Don’t try to over automate○●Prevents changes from propagating downstreamUtilize emulator tools for cross-building
Don’t compile libraries unnecessarily○○●

There is still value in teaching manual commands

Compile nodes and run tests in the build○●●Rebuilds can play havoc on a large tree

PiWheels et al. have precompile binaries for ARM
Long builds will slow down your development

Utilize caching whenever possible

AI Driving Olympics
Three principal challenges:● Lane following● Lane following with obstacles● Fleet management / mobility on demand
We evaluate your submission in a simulator and run it on a real Duckiebot!
Coming to NIPS 2018 and ICRA 2019. Register today at duckietown.org

Recap and future work●

Two groups of users: researchers and students
○●
●
●
●
●
●

One wants reproducibility, both want user friendly tooling

Need to facilitate comparability with baseline implementations
Simplify deployment model to fleet with easy rollbacks
Gracefully degrade services and exert precise control over QOS
Docker helps us achieve this, but it is not a silver bullet for reproducibility
By utilizing emulation, we can gradually deploy and fail early
Hardware-in-the-loop testing can give us further predictabilityHelp Wanted: Hatchery, a ROS IDE

Learn more at github.com/duckietown/hatcherySpecial ThanksRusi Hristov
Liam Paull
Andrea Censi