← Work / Projects

Side project · 2017

Robot localization in ROS

At Varden and Embark I helped design perception and localization but relied on my co-founders to implement it. After leaving, I learned ROS and built those algorithms myself on a simulated robot: mapping, an extended Kalman filter, and ICP scan matching feeding a particle filter.

Role
Solo project
When
2017, after Embark
Stack
ROS · simulated lidar · RViz
Screenshot of the simulation: a teleop terminal and C++ code on the left, the walled Gazebo world top right, and RViz bottom right showing lidar returns and a blue EKF error ellipse and heading arc
Gazebo and RViz, with the EKF error ellipse and heading arc in blue

Why

Throughout Varden Labs and Embark I helped develop a lot of the perception and localization algorithms, but my co-founders implemented them. After leaving, I wanted to build them myself, so I learned ROS.

Set-up

Using ROS simulation libraries, I built an environment for a robot to drive around and sense with a simulated lidar, and published artificial wheel-encoder and GPS data with added noise to develop against.

The screenshot at the top shows it running: the Gazebo world top right and RViz below it, with the keyboard-teleop terminal and the code that generates the noisy encoder data on the left.

What I built

  1. Path recording and trajectory following: record waypoint paths, follow them, and visualize them in ROS.
  2. A probabilistic 2D occupancy-grid map built from lidar and robot state, saved to disk for later localization.
  3. An extended Kalman filter fusing encoders with poor GPS, with the error ellipse and heading-error arc drawn in RViz (the blue circle and arc in the screenshot).
  4. ICP scan registration from the robot’s lidar frame to the global map, feeding a particle filter that moves particles with the ICP transform and the EKF, and resamples them using the ICP fitness score. The particle filter was still in development when I wrote this up.

Localization pipeline

  1. Simulated sensors
    Lidar
    Wheel encodersWith added noise
    GPSDeliberately poor
  2. Dead reckoning
    Extended Kalman filterState estimate with error ellipse
  3. Map matching
    ICP scan registrationAgainst a saved occupancy-grid map
  4. Estimate
    Particle filterParticles moved by ICP + EKF, resampled by ICP fitness
Noisy sensors to a map-referenced poseSimplified

Related