David Lammering personal site

Autonomous Robot Navigation

A* path planning for a TurtleBot, with a post-processing pass that turns its grid zigzags into straight lines. Then PID control and Kalman-filter tuning for a simulated quadcopter. ROS2 and C++.

Raw A* on the physical TurtleBot.
Context
Robotics course, National University of Singapore, exchange semester, spring 2026
Team size
3, this page covers only my parts
My part
Line-of-sight post-processing on the TurtleBot, plus pure pursuit (the latter following the course manual); PID control and Kalman-filter noise tuning on the quadcopter
Status
Completed

Planning on the TurtleBot

A* finds the shortest path, but only on the 8-connected grid it searches. In the real room, that path isn't the shortest.

Diagram: on the left a three-by-three grid of square cells, an arrow, and on the right the same cells drawn as nine nodes each connected to its eight neighbors.
The map as an 8-connected graph.

On that grid, every step is a multiple of 45°, so the paths come out as zigzags: optimal on the grid, but not the straight lines the robot could drive. So I added a post-processing pass: walk the path, and wherever two nodes have line of sight, delete everything between them and refill the straight segment by line rasterization.

Four-step diagram. A chain of orange path nodes runs around a blue triangular obstacle from a blue start dot to a green goal dot. In the second panel an anchor marks the start node and red crosses mark the nodes that have line of sight to it. In the third the anchor has moved to the far end of that straight run and the next set of crossed-out nodes is marked. In the fourth only the start, one corner node and the goal are left.
Post-processing visualized.
Detail of the costmap with the planned path drawn as a thin red line: it runs flat to the right, breaks into a 45-degree diagonal at a sharp corner, and meets the corridor mouth. The same detail with the same start and goal: the two legs have been replaced by one straight red line at a shallow angle running the whole way to the corridor mouth.
Before and after post-processing (corners rounded by the team's Savitzky–Golay smoother).

Over the whole plan, the path got about 3% shorter (9.54 m to 9.23 m), with long straight segments instead of a correction at every grid corner.

The rasterization is a supercover variant of Bresenham. It flags every cell the straight line touches rather than a one-cell-wide trace, so a shortcut cannot slip diagonally between two obstacle cells. A teammate wrote that part.

Control and localization on the quadcopter

Part two: a simulated quadcopter that follows a TurtleBot. I wrote its controller and tuned the noise model of the team's Kalman filter.

Screenshot in two halves. On the left, a terminal scrolling the estimator's output: GPS, barometer, sonar and magnetometer readings next to the estimated pose and its error. On the right, RViz showing the house map from above with inflated walls, the drone's planned path as a green line and its estimated position and heading as a red arrow.
Estimator output (left) and the drone's path and estimated pose (right).

The controller is pure pursuit with PID terms, tuned with Ziegler–Nichols and then by hand.

I measured each sensor's noise on the ground, but the measured IMU variance made the filter drift between the 2 Hz GPS fixes. Raising the IMU variance lets the GPS dominate more, while the IMU fills the 0.5 s gaps between fixes. Holding each GPS reading would lag up to 0.5 m behind a moving drone; the filter stays around 0.2 m off, at 30 Hz.

Four plots of error from ground truth over about 110 seconds, for x, y, z and yaw. In each, a dashed orange line for integrating the IMU alone runs off the bottom of the axis within seconds for x, y and z, and drifts slowly for yaw. A thin red line for the raw sensor and a green line for the filter stay near zero; in z the raw barometer sits about 0.2 m below zero while the filter stays on it.
Error against ground truth. Orange: IMU alone. Red: raw sensor (GPS, barometer, magnetometer; interpolated between readings). Green: the filter.
A single plot of x error over about 130 seconds. The green filter line now swings in slow waves of up to plus or minus 0.8 m, well outside the thin red raw-GPS line, which stays within about 0.2 m of zero.
x error with a lower IMU variance: up to 0.8 m.

With this tuning, the drone flew the whole mission on its estimate. The benchmark against ground truth was only run at the very end, for the report. Looking at it afterwards, the variance assigned to the GPS was too high, and pure GPS signal (at correction time) was closer to ground truth than our filtered estimate: A better approach would have been to give the GPS 100% authority upon correction, and to use IMU data only to fill the gaps between corrections.