Skip to content

PX4 + ROS2 + Visual SLAM + VIO + Obstacle Avoidance + Autonomous Return Home A fully autonomous drone capable of navigating, mapping, avoiding obstacles, detecting targets, and returning to its launch position without GPS. Designed for research-grade missions, ISRO-style No-GPS challenges, DARPA-style underground navigation, and autonomous flight.

License

Notifications You must be signed in to change notification settings

Yarok14Technologies/No-GPS_Autonomous-Drone-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›°οΈ No-GPS Autonomous Drone System

PX4 + ROS2 + Visual SLAM + VIO + Obstacle Avoidance + Autonomous Return-Home

This repository contains the full software stack for a fully autonomous drone capable of navigating, mapping, avoiding obstacles, detecting targets, and returning to its launch position without GPS.

Designed for research-grade missions, ISRO-style No-GPS challenges, DARPA-style underground navigation, and indoor autonomous flight.


πŸš€ Key Capabilities

βœ” GPS-Denied Navigation βœ” Visual SLAM + VIO Fusion βœ” Autonomous Exploration βœ” Obstacle Detection & Avoidance βœ” Visual Landing Pad Detection βœ” No-GPS Return-to-Home (Keyframe Homing) βœ” Fully ROS2-based Modular Architecture βœ” PX4 Offboard Flight Control βœ” Simulation Ready (PX4 SITL + Gazebo/Ignition)


🧱 System Architecture

πŸ”΅ 1. Visual SLAM (ORB-SLAM3 / RTAB-Map)

  • Frontend: Feature extraction + tracking
  • Backend: Bundle adjustment + loop closure
  • Output: /slam/pose, /slam/map

πŸ”΅ 2. State Estimation (EKF Fusion)

  • IMU + SLAM + optical flow + barometer
  • Provides /odom, /tf
  • Smooth, drift-corrected pose

πŸ”΅ 3. Perception

  • Depth obstacle detection
  • Optical flow for drift control
  • AprilTag / landing pad tracking

πŸ”΅ 4. Mapping

  • Voxel map / Octomap generation
  • Used by local planner for obstacle avoidance

πŸ”΅ 5. Planning

  • Global Planner β†’ A* / D* Lite
  • Local Planner β†’ MPC / DWA
  • Trajectory smoothing β†’ Polynomial/MPC

πŸ”΅ 6. Mission Manager

  • Flight FSM
  • Exploration logic
  • Fail-safe handling
  • Visual return-home
  • Battery-aware landing

πŸ”΅ 7. PX4 Bridge

  • Offboard mode control
  • Setpoint publishing
  • Arm/takeoff/land API

πŸ“ Repository Structure

no_gps_drone/
β”œβ”€β”€ README.md
β”œβ”€β”€ docker/
β”œβ”€β”€ environment/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ slam/
β”‚   β”œβ”€β”€ perception/
β”‚   β”œβ”€β”€ state_estimation/
β”‚   β”œβ”€β”€ mapping/
β”‚   β”œβ”€β”€ planning/
β”‚   β”œβ”€β”€ mission_manager/
β”‚   β”œβ”€β”€ px4_bridge/
β”‚   β”œβ”€β”€ control/
β”‚   └── simulation/
β”œβ”€β”€ launch/
β”œβ”€β”€ config/
β”œβ”€β”€ data/
β”œβ”€β”€ tests/
└── docs/

πŸ“ Detailed Repository Structure

no_gps_drone/
β”‚
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ .gitignore
β”œβ”€β”€ docker/
β”‚   β”œβ”€β”€ Dockerfile.dev
β”‚   β”œβ”€β”€ Dockerfile.sim
β”‚   β”œβ”€β”€ docker-compose.yml
β”‚   └── entrypoint.sh
β”‚
β”œβ”€β”€ environment/
β”‚   β”œβ”€β”€ ros2.repos            # vcs import repos (ORB-SLAM3, mavlink, perception libs)
β”‚   β”œβ”€β”€ requirements.txt      # Python requirements
β”‚   └── setup_instructions.md
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ slam/
β”‚   β”‚   β”œβ”€β”€ orb_slam3_ros/
β”‚   β”‚   β”œβ”€β”€ rtabmap_ros/
β”‚   β”‚   └── vio_fusion/       # VIO/IMU fusion wrapper (ekf2 alternative)
β”‚   β”‚
β”‚   β”œβ”€β”€ perception/
β”‚   β”‚   β”œβ”€β”€ apriltag_detector/
β”‚   β”‚   β”œβ”€β”€ optical_flow/
β”‚   β”‚   β”œβ”€β”€ obstacle_depth/
β”‚   β”‚   └── landing_pad_detector/
β”‚   β”‚
β”‚   β”œβ”€β”€ state_estimation/
β”‚   β”‚   β”œβ”€β”€ ekf_fusion/
β”‚   β”‚   β”œβ”€β”€ imu_preintegration/
β”‚   β”‚   └── tf_manager/
β”‚   β”‚
β”‚   β”œβ”€β”€ mapping/
β”‚   β”‚   β”œβ”€β”€ octomap_server/
β”‚   β”‚   β”œβ”€β”€ voxel_map/
β”‚   β”‚   └── occupancy_grid_tools/
β”‚   β”‚
β”‚   β”œβ”€β”€ planning/
β”‚   β”‚   β”œβ”€β”€ global_planner/        # A*/D* Lite / RRT*
β”‚   β”‚   β”œβ”€β”€ local_planner/         # MPC / DWA / APF
β”‚   β”‚   β”œβ”€β”€ trajectory_optimizer/   # polynomial, bezier, or MPC smoothening
β”‚   β”‚   └── path_follower/         # converts path->waypoints->commands
β”‚   β”‚
β”‚   β”œβ”€β”€ mission_manager/
β”‚   β”‚   β”œβ”€β”€ autonomous_flight_node/
β”‚   β”‚   β”œβ”€β”€ return_home_manager/
β”‚   β”‚   β”œβ”€β”€ keyframe_homing/
β”‚   β”‚   β”œβ”€β”€ failsafe_manager/
β”‚   β”‚   β”œβ”€β”€ battery_monitor/
β”‚   β”‚   └── mission_api.srv
β”‚   β”‚
β”‚   β”œβ”€β”€ px4_bridge/
β”‚   β”‚   β”œβ”€β”€ microRTPS_agent/
β”‚   β”‚   β”œβ”€β”€ px4_msgs/
β”‚   β”‚   β”œβ”€β”€ mavros_plugins/
β”‚   β”‚   └── setpoint_api/
β”‚   β”‚
β”‚   β”œβ”€β”€ control/
β”‚   β”‚   β”œβ”€β”€ attitude_controller/
β”‚   β”‚   β”œβ”€β”€ velocity_controller/
β”‚   β”‚   └── landing_controller/
β”‚   β”‚
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ transforms/
β”‚   β”‚   β”œβ”€β”€ logging_tools/
β”‚   β”‚   β”œβ”€β”€ calibration/
β”‚   β”‚   └── math_lib/
β”‚   β”‚
β”‚   └── simulation/
β”‚       β”œβ”€β”€ gazebo_worlds/
β”‚       β”œβ”€β”€ px4_sitl_launcher/
β”‚       β”œβ”€β”€ sensor_emulators/
β”‚       β”œβ”€β”€ fake_vio/
β”‚       β”œβ”€β”€ fake_apriltag/
β”‚       └── challenge_worlds/
β”‚
β”œβ”€β”€ launch/
β”‚   β”œβ”€β”€ full_system.launch.py
β”‚   β”œβ”€β”€ slam_only.launch.py
β”‚   β”œβ”€β”€ perception.launch.py
β”‚   β”œβ”€β”€ planning.launch.py
β”‚   β”œβ”€β”€ mission.launch.py
β”‚   β”œβ”€β”€ return_home_test.launch.py
β”‚   └── sim_world.launch.py
β”‚
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ cameras/
β”‚   β”‚   β”œβ”€β”€ calibration.yaml
β”‚   β”‚   β”œβ”€β”€ stereo_params.yaml
β”‚   β”‚   └── rectification.yaml
β”‚   β”œβ”€β”€ ekf/
β”‚   β”‚   β”œβ”€β”€ ekf_params.yaml
β”‚   β”‚   └── noise_models.yaml
β”‚   β”œβ”€β”€ planners/
β”‚   β”‚   β”œβ”€β”€ global_planner.yaml
β”‚   β”‚   β”œβ”€β”€ local_planner.yaml
β”‚   β”‚   └── mpc.yaml
β”‚   β”œβ”€β”€ slam/
β”‚   β”‚   β”œβ”€β”€ orb_slam3.yaml
β”‚   β”‚   └── rtabmap.yaml
β”‚   β”œβ”€β”€ mission/
β”‚   β”‚   └── mission_params.yaml
β”‚   └── px4/
β”‚       β”œβ”€β”€ fw_params.params
β”‚       β”œβ”€β”€ ekf2_no_gps.params
β”‚       └── vision_yaw_fusion.params
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ bags/
β”‚   β”‚   β”œβ”€β”€ flight1/
β”‚   β”‚   └── slam_debug/
β”‚   β”œβ”€β”€ logs/
β”‚   β”‚   β”œβ”€β”€ test_runs/
β”‚   β”‚   └── errors/
β”‚   β”œβ”€β”€ maps/
β”‚   β”‚   β”œβ”€β”€ octomap/
β”‚   β”‚   └── voxel/
β”‚   └── keyframes/
β”‚
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ hardware_tests/
β”‚   β”‚   β”œβ”€β”€ imu_noise_test.md
β”‚   β”‚   β”œβ”€β”€ camera_latency_test.md
β”‚   β”‚   └── system_id/
β”‚   β”‚
β”‚   β”œβ”€β”€ simulation_tests/
β”‚   β”‚   β”œβ”€β”€ slam_relocalization_test.md
β”‚   β”‚   β”œβ”€β”€ return_home_test.md
β”‚   β”‚   β”œβ”€β”€ obstacle_avoidance_test.md
β”‚   β”‚   └── landing_accuracy_test.md
β”‚   β”‚
β”‚   └── unit_tests/
β”‚       β”œβ”€β”€ test_slam_utils.cpp
β”‚       β”œβ”€β”€ test_planner.py
β”‚       └── test_mission_node.cpp
β”‚
└── docs/
    β”œβ”€β”€ architecture.md
    β”œβ”€β”€ sensors_and_calibration.md
    β”œβ”€β”€ mission_fsm.md
    β”œβ”€β”€ return_home_algorithm.md
    β”œβ”€β”€ failsafe_modes.md
    β”œβ”€β”€ simulation_setup.md
    └── evaluation_metrics.md

Full explanation is inside docs/architecture.md.


πŸ”§ Installation

1️⃣ Clone Repository

git clone https://github.com/your-name/no_gps_drone.git
cd no_gps_drone

2️⃣ Install ROS2 Dependencies

sudo apt install python3-colcon-common-extensions \
                 ros-humble-navigation2 \
                 ros-humble-slam-toolbox \
                 ros-humble-tf2-tools

3️⃣ Import External Packages

vcs import < environment/ros2.repos

4️⃣ Install Python Dependencies

pip install -r environment/requirements.txt

5️⃣ Build the Workspace

colcon build --symlink-install
source install/setup.bash

πŸ›« Running the System

Start PX4 SITL

cd PX4-Autopilot
make px4_sitl gazebo

Start Full Autonomy Stack

ros2 launch no_gps_drone full_system.launch.py

πŸ” Return-Home Without GPS (Core Algorithm)

The drone uses keyframe-based visual homing:

  1. Capture keyframes during outbound flight
  2. Store positions + descriptors
  3. For RTH, match live camera feed to stored keyframes
  4. Use reprojection + homography to estimate direction home
  5. Global planner generates RTH path
  6. Local planner avoids obstacles
  7. Autonomous landing at return position

Detailed in: docs/return_home_algorithm.md.


πŸ§ͺ Testing

Simulation Tests

  • SLAM drift test
  • Relocalization test
  • Obstacle avoidance test
  • No-GPS return-home test
  • Landing accuracy test

Run:

ros2 launch no_gps_drone simulation/sim_world.launch.py

πŸ“¦ Hardware Requirements

  • PX4 flight controller (Pixhawk 6C / CUAV X7 / Holybro Durandal)
  • Stereo camera (Intel Realsense D455 / ZED2 / MYNT-EYE)
  • IMU (built-in or external)
  • Companion computer (Jetson Orin Nano / Xavier NX / Raspberry Pi 5)
  • Optical flow sensor (optional)
  • LiDAR or depth camera (optional)

🧠 Software Stack

  • ROS2 Humble / Iron
  • PX4 / MAVROS / microRTPS
  • ORB-SLAM3 or RTAB-Map
  • Nav2 Stack
  • FastDDS
  • OpenCV / Eigen / g2o / Ceres

🀝 Contributing

PRs, issues, and feature requests are welcome. Follow the coding standards in: docs/contribution_guidelines.md


πŸ“œ License

MIT License


πŸ“ž Contact

For queries, reach out at: bibinnbiji924@gmail.com


About

PX4 + ROS2 + Visual SLAM + VIO + Obstacle Avoidance + Autonomous Return Home A fully autonomous drone capable of navigating, mapping, avoiding obstacles, detecting targets, and returning to its launch position without GPS. Designed for research-grade missions, ISRO-style No-GPS challenges, DARPA-style underground navigation, and autonomous flight.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published