Code Monkey home page Code Monkey logo

fcnd-motion-planning's Introduction

Project: 3D Motion Planning

Quad Image In this project,I have developed an algorithm for 3D motion planning. To perform the motion planning, the destination location is given in GPS coordinates. The motion planning algorithm estimates the waypoints using A* algorithm, optimizes it, and then executes the plan to make the drone reach the destination location.

The following section explains the various steps I followed to develop this algorithm.

Motion Planning Vs Backyard Flyer

The motion planning project is the extension of the backyard flyer project. In the backyard flyer, waypoints are fixed and given is a list, where as in motion planning, the goal position is ten meters away from the origin in both north and east direction. The backyard flyer project calculates the waypoints to the goal position using A* algorithm, but waypoints are directly mentioned in the backyard flyer.

###Extracting lat0 and lon0

The motion planning algorithm uses the discretized 2.5D map given in the colliders.csv file. The discretized map must align with the simulation environment to make the algorithm work properly. So the global home is set to the original location given in the colliders.csv file. The following code segment shows how the global home is set with the 2.5D map file's origin. Setting the origin

Takeoff the Drone From Anywhere

By default, The drone always takeoff from the map origin. To make the drone take off from anywhere, I have set the starting location to the current global location. In the first step, the global location is converted into local coordinates, and then it is mapped to grid location. Setting the start location

Changing the Start Location

Starting location is changed to the current location, by setting the variable grid_start. Setting the start location

Setting the Goal Location

The flight plan's goal location needs to be mentioned in the GPS coordinate system, but the planning algorithm understands only the map coordinates. GPS coordinates give more flexibility to the user. The goal GPS coordinates are first converted into local coordinates, and then it is converted into map coordinates. Setting the start location

Modified A* implementation

I use the A* algorithm to find the path from the start location to the goal location. I have added diagonal motion on the grid to improve the planning.

Adding the diagonal motion introduces four more actions into the Action class. The cost of the diagonal is taken as sqrt(2). Setting the start location

Valid_actions method is modified to check the diagonal directions. Grid out of range is checked by the following code snippet. Setting the start location

The following code checks the obstacles in the diagonal direction and removes the valid actions accordingly. Setting the start location

Collinearity Test

Collinearity check is done on the flight plan generated from the A* algorithm. Collinearity check removes the unwanted intermediate waypoints and makes the drone fly smoothly. Setting the start location Setting the start location

Waypoints Before Linearity Check

Setting the start location

Waypoints After Linearity Check

Setting the start location

After introducing the linearity check, the drone flies smooth and fast.

Executing the Flight Plan

The planning algorithm is verified by selecting a few goal locations in GPS coordinates. Setting the start location

Setting the start location

fcnd-motion-planning's People

Contributors

obedotto avatar ryan-keenan avatar

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.