Skip to content

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

Notifications You must be signed in to change notification settings

MatteoM95/Skymap-path-planner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published