Coder Social home page Coder Social logo

prox_tof's Introduction

Copter Obstacle Avoidance for Ardupilot - PROX_ToF

The obstacle avoidance module is based on ToF (Time of Flight) distance sensors VL53L1. The module is rather small and lightweight so it can fit even 140mm frame

You can read about obstacle avoidance in Ardupilot here

What do you need:

  • PROX_ToF PCB and parts
  • Ardupilot compatible flight controller (Pixhawk, Omnibus, Pixracer, etc)
  • Optical flow sensor (FlowDeck or Cheerson CX-OF)
  • Any AVR ISP programmer to flash bootloader
  • Your favorite quad, tri, hexa, octo :)

Preparing Hardware:

  • Assemble your PROX_ToF module and flash a bootloader using AVR ISP and Arduino IDE (See Preparing Software)
  • Print a case
  • Prepare all the nessesary connectors and wires
  • Put your optical flow sensor on the bottom of the case
  • Connect the module to flight controller Connection diagram

Preparing Software:

  • Flash a bootloader using AVR ISP and Arduino IDE if you haven't done it yet
  • Compile and Upload the VL53L1_MULTI_MAVLINK.ino sketch. If you have any errors regarding libraries, install the libraries to your Arduino IDE from this repository
  • Follow the instruction how to build Ardupilot firmware;
  • After cloning the repository and succesfull building the ArduCopter firmware, change your board's hwdef.dat file (in my case it is located \libraries\AP_HAL_ChibiOS\hwdef\omnibusf4pro\hwdef.dat bacause I used Omnibus F4 RPO FC):
  1. Find the CS pins definitions (line #67) and add a line
PD2 FLOW_CS CS
  1. Find the SPI Device table and comment the OSD SPI (SPI3 DEVID4). Instead the OSD add the optical flow device:
SPIDEV pixartflow SPI3 DEVID4 FLOW_CS MODE3 2MHZ 2MHZ
env DEFINES HAL_HAVE_PIXARTFLOW_SPI
  1. Comment out the OSD defines (line #135)
#define OSD_ENABLED ENABLED
#define HAL_OSD_TYPE_DEFAULT 1
  • Configure and build the copter firmware. Flash your FC
  • Using MissionPlanner adjust the following parameters:
EK2_ALT_SOURCE = 1
EK2_GPS_TYPE = 3
FLOW_ENABLE = 1
RNGFND_TYPE = 16
RNGFND_MAX_CM = 140

Checking that everything works

  • Connect to your FC using MissionPlanner and press Ctrl+F button
  • Push the Proximity button
  • Check that you see the Radar and it reacts to distance change
  • Arm and takeoff in Altitude Hold mode, you'll notice that your drone will react on closing up objects trying to avoid any possible collision. Try Loiter.

My thanks

Thanks to patrickpoirier51 work https://github.com/patrickpoirier51/POC it was a good start for MAVLINK DISTANCE MESSAGE generation

Thanks to Vitaly Puzrin for general thoughts and instructions of writing README

prox_tof's People

Contributors

dollop80 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

teslaea winney

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.