Obstacle Avoidance

Repository: GitHub - UWARG/obstacle-avoidance

Usage

Using simulator:

  1. Setup the repository:

    git clone https://github.com/UWARG/obstacle-avoidance.git git checkout main git pull git submodule update --remote
  2. Activate the virtual environment

    1. See Autonomy Workflow Software

  3. Install requirements.

    pip install -r requirements.txt pip install -r modules/common/requirements.txt
  4. Start Mission Planner.

  5. Setup waypoints.

  6. Setup Mavlink Forwarding

    1. See Mission Planner Simulated Ardupilot

  7. Connect the LiDAR to your machine.

  8. Run the main script.

    python -m main
  9. Start the mission.

 

Using Raspberry Pi 5:

  1. Make the following hardware connections from the Raspberry Pi:

    1. Connect to LiDAR via USB-A to Micro-USB.

    2. Connect to Pixhawk Telem 2 port using FTDI cable.

    3. Connect to power source.

  2. SSH into Raspberry Pi.

    1. Refer to Raspberry Pi 5

  3. Enter the obstacle avoidance repository cd WARG/obstacle-avoidance/.

  4. Activate the virtual environment source venv/bin/activate.

  5. Ensure requirements are installed and submodules are initialized.

  6. Run the flight controller test and check for odometry output.

    1. cd modules/common/

    2. python -m mavlink.test_flight_controller

    3. If odometry is outputted, exit the program, otherwise check Pixhawk connection.

  7. Run the main script.

    1. Go back to the obstacle-avoidance directory.

    2. Run python -m main.

  8. Start an AUTO mission.

How obstacle avoidance system works:

Module Descriptions:

Detection: configuring LiDAR settings and fetching LiDAR readings.

Clustering: grouping LiDAR scans in close proximity into clusters.

Classification: assessing each cluster and assigning them a type of obstacle.

Flight Interface: sending and receiving messages from the drone.

Data Merge: combining obstacles and odometry into a data structure.

Decision: applying obstacle avoidance algorithm and sending a command.

Â