Post

Obstacle Avoidance

Safe autonomous navigation of ground robots using depth sensing.

Obstacle Avoidance

Overview

Obstacle avoidance is a core capability for autonomous robots operating in real-world environments. Applications range from hospital robots navigating crowded hallways, to indoor delivery and cleaning systems, to autonomous vehicles and search-and-rescue platforms operating in hazardous conditions.

This project focuses on developing and evaluating depth-camera–based obstacle avoidance algorithms for ground robots. Our goal was to explore how different perception and planning pipelines affect safety and performance, and to understand the tradeoffs between local reactive methods and global planning approaches.


Problem Setup

The robot operates in a simulated environment built using PyBullet, consisting of:

  • An empty plane
  • Randomly generated cylindrical obstacles

The robot follows a standard Ackermann drive model, parameterized by:

  • Position and orientation
  • Steering angle
  • Linear velocity

A forward-facing depth camera provides distance measurements to obstacles directly ahead. The objective is to navigate safely around obstacles while maintaining a reasonable speed.

Performance is evaluated using:

  • Average distance traveled without collision
  • Average speed

Method 1: Planning-Based Obstacle Avoidance

Perception Pipeline

The planning-based approach follows a multi-stage pipeline:

  1. Receive depth images from the camera
  2. Convert depth images into a 3D point cloud
  3. Project the point cloud into a 2D occupancy map
  4. Inflate obstacles in the map to maintain safe clearance
  5. Use A* to plan a collision-free path
Depth image
Depth image
Point cloud
Point cloud
2D map
2D occupancy map

A* planning GIF A* path planning with inflated obstacles


Path Following

Once a path is generated:

  • The robot follows it using a P controller
  • The controller steers the robot toward successive waypoints
  • Velocity is held constant during execution

This approach emphasizes global structure and explicit safety margins but depends heavily on map accuracy.


Method 2: Local Reactive Obstacle Avoidance

We also implemented a simpler, purely reactive method that does not rely on mapping or global planning.

Depth-Based Steering

  • The depth image is split into left and right halves
  • Depth values in each half are summed
  • The robot steers toward the side with greater free space (larger depth sum)

This approach is lightweight, fast, and avoids errors introduced by imperfect mapping.


Optimal Target Selection

To improve steering behavior, we computed an optimal target direction by:

  • Identifying gaps large enough for the robot to pass through
  • Selecting the gap closest to the robot’s current trajectory
  • Minimizing unnecessary lateral movement

Optimal target placeholder Selection of optimal target gap for navigation


Results & Evaluation

Each algorithm was tested over 20 independent trials.

Performance Metrics

Local Reactive Avoidance

  • Average distance traveled without collision: 19.56 m
  • Average speed: 0.52 m/s

Planning + Local Avoidance

  • Average distance traveled without collision: 13.33 m
  • Average speed: 0.29 m/s

Results graph placeholder Comparison of performance with and without planning

Surprisingly, the local-only method outperformed the combined planning approach. We believe this is primarily due to map inaccuracies caused by PyBullet camera intrinsics, which made it difficult to construct a perfectly accurate local map. These inaccuracies occasionally caused collisions despite planned paths.


Discussion

This project highlights an important insight in robotics:

More complex pipelines do not always lead to better real-world performance.

While planning-based approaches provide structure and interpretability, they are sensitive to perception errors. In contrast, simple reactive methods can be more robust when sensing is noisy or imperfect.


Future Work

Potential directions for improvement include:

  • Improved map accuracy through better camera calibration and higher-resolution maps
  • Advanced path-following controllers, such as Pure Pursuit combined with PID control
  • Adaptive velocity control that slows near obstacles and accelerates on clear paths
  • Dynamic environments with moving obstacles of varying shapes and speeds

Demo

Full demonstration of obstacle avoidance behaviors

This post is licensed under CC BY 4.0 by the author.