← Work / Projects

Team & software lead · Jan – Apr 2018

Autonomous underwater torpedo

An underwater vehicle built from the ground up for autonomy (custom hull, embedded system and autonomy stack) to race through an underwater obstacle course in the shortest time. I led the team and wrote the entire autonomy stack.

Role
Team lead · autonomy stack
When
Jan – Apr 2018, UWaterloo
Team
4 engineers
Duration
3.5 months
Stack
ROSJava on Android · OpenCV on Raspberry Pi · custom PCB
The autonomous underwater torpedo
The vehicle
6 DOF
Six thrusters move and rotate the vehicle in any direction
2 cameras
Front and rear fisheye, each with its own Raspberry Pi for perception
1 phone
An Android phone runs the full autonomy stack
4 · 3.5 mo
Team size and build time

Overview

As a team of four we built, in three and a half months, an underwater autonomous torpedo to race through an underwater obstacle course. Everything was built for autonomy from the ground up: the mechanical system, the embedded system and the software.

In the render of the course, the vision targets are the coloured balls and the vehicle’s fixed path is the magenta line.

Render of the obstacle course: grey walls and panels dotted with coloured target balls, the vehicle model, and a magenta path that ends at a target on the floor
The course and the vehicle’s fixed path

As team lead I defined the scope from an analysis of the competition and our timeline, and I independently developed the vehicle’s autonomy stack.

System architecture

  1. Two fisheye cameras, front and rear, each with a dedicated Raspberry Pi running perception to locate vision targets (golf balls) along the course.
  2. Perception results, plus IMU and depth data, go over USB to an Android phone that runs the autonomy stack.
  3. The stack’s desired thrust for each of the six thrusters goes to the embedded system on a custom PCB.
  4. Six custom sensored brushless motor controllers turn desired thrust into motor commands using thrust maps calibrated offline.
  5. The thruster layout lets the vehicle translate and rotate freely in all six degrees of freedom.
Block diagram: front and rear cameras each feed a Raspberry Pi Zero running perception; a custom PCB with an Arduino, USB hub, IMU and six BLDC motor controllers links them and the depth sensor to the Android phone running the autonomy stack
System architecture

Autonomy stack

ROSJava on the phone gave us flexible code plus ROS’s visualization and networking tools with little infrastructure. Each Raspberry Pi processes its camera with OpenCV and sends target positions in the vehicle’s body frame.

Loop diagram: raw sensor data, perception, localization, trajectory planning, motion control and motor commands, with the vehicle’s movement changing what the sensors see next
Autonomy loop

A particle filter fuses those detections with orientation and depth. Scan registration against a map of known target locations sharpens both the particle weights and their propagation. With the vehicle located, pure pursuit picks the next pose along a fixed, pre-computed optimal path that takes the vehicle safely through the course, and a closed-loop LQR controller with an integrator commands the thrusters to minimize tracking error.

Autonomy stack

  1. Sensing
    Fisheye cameras ×2OpenCV target detection on Raspberry Pis
    IMU + depth sensor
  2. Localization
    Particle filterScan registration against a map of vision targets
  3. Guidance
    Pure pursuitAlong a pre-computed optimal trajectory
  4. Control
    LQR + integratorMultivariable, minimizes tracking error
  5. Actuation
    6 motor controllersCustom brushless, calibrated thrust maps
    6 thrusters
Sensors to thrustersSimplified

Related