GithubHelp home page GithubHelp logo

matteom95 / skymap-path-planner Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 36.86 MB

Path planner for UAV that search the best flight route through the clouds from NOAA weather forecast. The pathfinding algorithm tested are A* and Dijkstra

C++ 45.99% C 11.85% C# 42.16%
astar-algorithm cpp csharp curl-library dijkstra-algorithm graph-algorithms grib2 grib2-decoder grib2json path-planning pathfinding-algorithm weather

skymap-path-planner's Introduction

Skymap-path-planner

Contents

The following program calculate the best path between two given point on a weighted matrix. The weighted matrix represents the percentage of clouds in the sky in a certain moment. The UAV uses photovoltaic power to fly and should avoid clouds in upper level in the sky. The weather is provided by the American NOAA service in grib2 file format (file.grb2).

Xplane has its own weather plugin, which uses the same data, to install it you need to get the zip file and manually copy the files to the folder. Here is a tutorial how to install it

The grib files are binary files and it is necessary to "unpack" them (degrib, like unzipping file) and save the interested data in a .csv or ASCII file. To visualize grib files use the XyGrib GUI.

The NOAA site freely provides data with maximum resolution 0.25 degrees which correspond to squares of 30 Km per side. Higher resolution is provided by French system via AROME 0.025 degree
Other resolutions are available here

The grib files are generated by NOAA and downloaded through the website The precision selected is Gfs 0.25 degree filter Then select the most recent date of the last update and hours. The forecast bulletin are only available for the last ten days and then updated every 6 hours: from midnight (00) until 18 PM in the evening (18). The actual forecast is only avalaible for the next 120 hours from the meteorological sampling date.

WARNING: do not select .anl files, but only those ending with f000 - f0120

Now select the parameter interested, such as barometric pressure and altitude. Here is available a parameter table Select the region by ticking the box and then download. There is also the possibility to inspect the corresponding URL, checking the box next to it.

The file will be downloaded without extension, a .grb2 extension should be added to the end of filename. Now the file is displayed as grb2 and can be visualize in Xygrib.

Here there is the official NOAA page about degrib and tutorial how to use it

The degrib program is used to decompresses and convert it in ASCII. Download and install Degrib program: Two executables will be created (in the installation folder) from the installation:

  • degrib.exe
  • tkdegrib.exe

The first program is runned from the command line, the second is the same program with the user interface.

WARNING: The degrib.exe file must be in the same folder of compiled code of the Skymap path planner.

Convert binary file to ASCII Comma Separated file:

You can use degrib to convert a given binary grib2 to a .csv file, which each line contains x, y, lat, lon, value for each cell of the map.

  • In the GUI tkdegrib: Click on the "GIS" tab, and browse for your file. Double click on it in the top half, and it should fill out the inventory part in the bottom half. Select the message that you want in the bottom half, and choose the output name (or press "Recommend" to have tkdegrib "recommend" one. Next choose "CSV" for "File Type", and press the "Generate .csv file" button at the bottom. The TkDegrib manual is available here
  • For the Degrib.exe use the following command lines:
/degrib /bin /degrib GRIB_filename.grb2 -C -msg 1 -Csv
/degrib /bin /degrib GRIB_filename.grb2 -C -msg all -nMet -Csv

where "GRIB_filename" is replaced with your GRIB filename.

The -Csv option tells it to create the .csv file. See the Degrib manual, in particular the "CONVERT OPTIONS" section.

There are various code:

  • A program executable in CPP with command line parameters here
  • The same program with a GUI in C # with dijkstra here
  • A program with the openweather.org API has also been created test but never used here

CPP SkymapPathfinder

In the CPP SkymapPathfinder.exe command line the parameters are in order:

  1. Program name and path folder
  2. Hours from now forecast (max 120) and must be 3 digit ie. 030
  3. North latitude area to explore
  4. South latitude area to explore
  5. West longitude area to explore
  6. East longitude area to explore
  7. Parameter to extract (see on tkdegrib.exe which value to choose)
  8. Folder where save the files
  9. Start point Latitude
  10. Start point Longitude
  11. Finish point Latitude
  12. Finish point Longitude

Example:

SkymapPathfinder.exe 030 48 40 10 20 25 C:\Skymap 46 11 42 19.5

In the example above, the weather forecast requested is 30 hours from now with an area bounded to north 48, south 40, west 10 and east 20 degrees, taking only the parameter 25 (high level cloud), the working directory where stores files is "C:\Skymap", with a start point in 46 N 11 E and a finish point in 42 N 19.5 E

The final path will be saved in .csv file, in each rows is saved the Latitude and Longitude of the point.

The result as it should appear is displayed below:

skymap-path-planner's People

Contributors

matteom95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

makalnuhba

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.