Nitish Poojari
Published

Dodger Drone

This project enables an educational Nano drone called Pluto created by Drona Aviation to dodge obstacles from the frontal direction.

IntermediateFull instructions provided2 hours123
Dodger Drone

Things used in this project

Hardware components

Pluto X Nano Drone
×1
X Breakout
×1
IR Sensor
×1

Software apps and online services

PlutoBlocks
Cygnus

Hand tools and fabrication machines

Extraction Tool, 6 Piece Screw Extractor & Screwdriver Set
Extraction Tool, 6 Piece Screw Extractor & Screwdriver Set

Story

Read more

Schematics

Obstacle Avoidance

Code

Dodger Drone Code

C/C++
You need to use this code in Cygnus IDE created by Drona Aviation which is a C++ coding IDE. Paste this code in your Cygnus IDE project and connect your drone's ESP WiFi to your laptop and flash this code.
Further, use the Pluto Controller Application in your phone to connect to your drone and press on developer mode. While you are flying the drone, you can notice that when you pitch forward towards an obstacle, the drone would automatically dodge it by pitching backwards.
#include "PlutoPilot.h"


  void onLoopStartAutoInsertion() {
  }

  void onLoopStopAutoInsertion() {
  }

  void plutoInit() {
    setUserLoopFrequency(100);
    GPIO.init(Pin10,INPUT);
  }


  // Problem Statement: To use the IR sensor to avoid Pluto from crashing from the front.
  void onLoopStart () {
    onLoopStartAutoInsertion();
  }

  void plutoLoop () {
    // - DO NOT USE "DESIRED PITCH"
    // - GIVE A STRONG NEGATIVE PITCH AS THE MOMENTUM OF THE DRONE IS HIGH
    if (!GPIO.read(Pin10)) {
      RcCommand.set(RC_PITCH,1000);
    } else {
      RcCommand.set(RC_PITCH,RcData.get(RC_PITCH));
    }
  }

  void onLoopFinish() {
    onLoopStopAutoInsertion();
  }

Credits

Nitish Poojari

Nitish Poojari

5 projects • 0 followers
Mechatronic engineer at Drona Aviation, innovating Nano drones with PlutoBlocks/Cygnus. Used Ansys Fluent/Fusion 360 for guard optimization.

Comments