Skip to content

Renadat/Baseer

Repository files navigation

Baseer

Safety monitoring in industrial and construction sites is traditionally done manually by safety officers. This process is time-consuming, prone to human error, and exposes inspectors to hazardous environments (like high-altitude structures or toxic zones).

Project Report: Baseer - Autonomous Safety Inspection Drone

1. Project Idea, Need & Innovation

The Core Problem

Safety monitoring in industrial and construction sites is traditionally done manually by safety officers. This process is time-consuming, prone to human error, and exposes inspectors to hazardous environments (like high-altitude structures or toxic zones).

Our Solution: "Baseer"

Baseer is an autonomous UAV (Drone) system designed to fully automate safety compliance inspections. The drone flies completely on its own along a pre-programmed path, scanning the environment using an integrated downward camera.

The Innovation & AI Role

Instead of just recording video, Baseer integrates real-time computer vision using YOLOv8. The system automatically processes the live video feed to:

  1. Detect safety elements like traffic cones and hazard walls.
  2. Monitor worker safety compliance by detecting standing personnel.
  3. Trigger an automatic SOS emergency alert in the terminal the exact second a fallen worker is detected on the ground.

system arch

[Simulation & Environment] [AI & Response Layer] │ │ ┌─────▼─────┐ ┌───────▼───────┐ │ Gazebo │ ◀───── (Movement Cmds) ──── │ MAVSDK-Python │ │ Simulator │ │ Mission Logic │ └─────┬─────┘ └───────┬───────┘ │ │ (Live Video / Coordinates) (Image Analysis / Decision) │ │ ┌─────▼─────┐ ┌───────▼───────┐ │ PX4 │ ◀────── (MAVLink UDP) ────▶ │ YOLOv8 Engine │ │ Autopilot │ │ (Edge AI) │ └─────┬─────┘ └───────┬───────┘ │ │ └──────────► [ Emergency SOS Protocol ] ◄───┘ - Extract live GPS telemetry - Dispatch critical medical alert - Trigger Return-to-Base (RTB)

2. Technical Architecture & Integration

The system establishes a stable, low-latency bridge between three main components:

  • PX4 Autopilot (SITL): Handles the core flight dynamics, takeoff, navigation, and landing states.
  • Gazebo Simulator: Manages the 3D physics, lighting, and renders our custom world and drone sensors.
  • MAVSDK (Python): Connects via UDP to send high-level asynchronous flight coordinates (PositionNedYaw).
  • YOLOv8 & OpenCV: Ingests the camera stream via UDP to execute real-time object detection models.

3. Custom Simulation Design (.SDF Model Hierarchy)

To achieve a clean, professional simulation setup, we decoupled the environment map from the robotic asset:

A. The Custom World (project.sdf)

The environment was custom-built to simulate a realistic hazardous work site. It features:

  • A dense city environment base model (model://city).
  • Target 1 (Safety Compliance): A standing worker model (worker_1_standing) surrounded by safety cones.
  • Target 2 (Emergency Scenario): A fallen worker model (worker_2_fallen_sos) lying down to simulate an accident.
  • Obstacles: Industrial hazard barriers (jersey_barrier) to test perimeter security.

B. The Drone Model Setup

The drone utilizes the gz_x500_mono_cam_down platform. This setup integrates:

  • A monocular camera sensor fixed downward to provide an un-obstructed field of view of the ground.
  • A 2D LiDAR distance sensor attached to the principal base_link via rigid joints to maintain precise altitude measurements above the structures.

4. Environment Setup & Prerequisites

Follow these exact steps to prepare the environment workspace:

Step 1: Install PX4 and Gazebo Dependencies

cd ~ git clone https://github.com/PX4/PX4-Autopilot.git --recursive cd PX4-Autopilot bash ./Tools/setup/ubuntu.sh make px4_sitl

Step 2: Configure PyCharm Virtual Environment (.venv)

Navigate to the PyCharm project directory and install the machine learning and drone SDK libraries directly into the local environment: cd ~/PyCharmMiscProject ./.venv/bin/pip install opencv-python ultralytics mavsdk


5. Execution & Deployment Sequence

Always launch the simulator environment first, allow it to stabilize, and then trigger the Python AI mission.

1. Launch the Simulation World

cd ~/PX4-Autopilot PX4_GZ_WORLD=project make px4_sitl gz_x500_mono_cam_down

2. Run the Autonomous AI Mission

source ~/PyCharmMiscProject/.venv/bin/activate python /home/renad/baseer_mission.py


6. Real Engineering Challenges & Solutions (Development Journey)

During development, we faced major technical bugs that required deep troubleshooting:

Challenge 1: Gazebo Server Crashes (Error Code 14 & 20) with Joint Failures

  • The Problem: We initially tried pasting the camera and laser <joint> and <include> XML blocks directly inside the global world file (project.sdf). Gazebo crashed with multiple red errors because it tried to attach joints to a drone frame (base_drone::base_link) that did not exist yet in the world scope.
  • The Solution: We realized that from a proper engineering perspective, sensors must be embedded within the drone's model framework, not the environment. We cleaned the world file back to its clean state and utilized the official gz_x500_mono_cam_down model which correctly encapsulates the camera and joints out-of-the-box.

Challenge 2: Environment Confusion & Coordinate Drift

  • The Problem: During testing, there was confusion between different test environments (the gaz_station_project using a gimbal drone at fixed coordinates 11.68,8.13,8 versus our actual main project world). This caused the python script to look for wrong camera ports and missing models.
  • The Solution: We strictly isolated the codebases. We targeted the exact world (PX4_GZ_WORLD=project) and synchronized the Python coordinates to navigate precisely over our unique asset locations.

Challenge 3: PyCharm Environment Isolation (ModuleNotFoundError: No module named 'cv2')

  • The Problem: Even after installing OpenCV using standard pip, the Python script kept crashing with missing module errors inside PyCharm.
  • The Solution: The global system Python interpreter

About

Safety monitoring in industrial and construction sites is traditionally done manually by safety officers. This process is time-consuming, prone to human error, and exposes inspectors to hazardous environments (like high-altitude structures or toxic zones).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages