Skip to content

Autonomous Navigation and Obstacle Avoidance

This is the ultimate challenge of the advanced tutorials! You will integrate all the knowledge from previous projects to build a complete autonomous navigation and obstacle avoidance system.

  • System integration
  • Real-time operating systems
  • Multi-threaded programming
  • Debugging complex systems
ItemQuantityNotes
ESP32-S3 Drone1-
OV2640 Camera Module1-
VL53L0X Laser Ranging Module1-
MicroSD Card18GB+
  • Camera (visual obstacle avoidance)
  • Laser ranging (short-range obstacle avoidance)
  • IMU (attitude estimation)
  • A* algorithm (global path planning)
  • DWA algorithm (local dynamic obstacle avoidance)
  • LQR controller (attitude control)
  • Velocity controller (position tracking)
  • Wi-Fi (communication with the ground station)

Install all sensors and make sure all wiring is correct.

  1. Integrate the A* path planning algorithm into path_planning.c
  2. Integrate visual and laser obstacle avoidance into obstacle_avoid.c
  3. Integrate multi-sensor fusion into sensor_fusion.c

Open autonomous_flight.c and implement the main control loop:

void autonomous_flight(void) {
while (1) {
// 1. Read sensor data
get_sensor_data();
// 2. Update the global path
update_global_path();
// 3. Perform local obstacle avoidance
perform_local_avoidance();
// 4. Compute control commands
calculate_control_commands();
// 5. Send commands to the motors
send_motor_commands();
// 6. Send telemetry back to the ground station
send_telemetry();
// 7. Check if the goal has been reached
if (reached_goal()) {
land();
break;
}
}
}
  1. Set up obstacles indoors (cardboard boxes, chairs, etc.)
  2. Configure the start and goal positions from the ground station
  3. Start “autonomous navigation” mode
  4. Observe whether the drone can avoid obstacles and reach the goal
  • Check the interface between each module
  • Optimize thread synchronization
  • Optimize algorithm efficiency
  • Reduce unnecessary computation

Congratulations! You have completed every project in the advanced tutorials and built a full autonomous navigation and obstacle avoidance system!

This is an important milestone on your journey to become the “chief designer” of your drone!

Through these 11 advanced projects, you have mastered:

  • Advanced control algorithms (LQR, MPC)
  • Sensor fusion (EKF)
  • Visual navigation (VIO)
  • Path planning (A*)
  • Real-time obstacle avoidance (DWA)
  • Target tracking
  • AI recognition
  • Multi-drone collaboration
  • System integration

You are ready to build your own drone applications!

  • Industry applications: agricultural protection, inspection, logistics
  • Academic research: multi-agent collaboration, autonomous navigation
  • Startup projects: distinctive drone products
  • Open source: contributing to the open source ecosystem

Wishing you the best on your continued journey in the world of drones!