Skip to main content

Multi-goal A* with cpp bindings to python

Project description

Multi-Goal A-star

This repo contains code to search for multiple goals with heterogenous values using a 3D A-star discrete planner. The majority of the code is written in C++ with Python bindings. This planner was used in the paper Map-Based Planning for Small Unmanned Aircraft Rooftop Landing

What do you mean by discrete?

The map provided should be a 3D voxel grid(i, j, k), a 3D NumPy array, which the planner searches. A cell with the value 0.0 is considered free space. A cell with the value 1.0 is considered an obstacle and cannot be traversed (this value is configurable). Values between 0.0 and 1.0 can be traversed but with a penalty (penalty weight is configurable).

What do you mean by multiple goals with heterogenous values?

A normal A-star planner has a start location and one goal. This Multi-Goal planner allows you to provide multiple goal cells each having different values. Goals with lower values are more desirable. This planner will try to find the optimal goal and path which minimizes an objective function. It must be understood that the planner doesn't just find a path. It finds the one goal and the corresponding optimal path that minimizes some larger objective function.

What is the larger objective function?

The objective function is the minimization of total risk ($r_t$), which is the combination of path risk ($r_p$) and goal risk $r_g$. In my research the goals were landing sites, therefore I called the latter landing site risk $r_l$. Below is an excerpt from my paper that discusses this trade-off between objectives:

The figure below shows an example Pareto frontier that minimizes two objectives: landing
site risk and path risk. Each purple dot represents a landing site. The x-axis represents
landing site risk and the y-axis represents path risk to that site. The green line
connects five points on the Pareto frontier, the set of non-dominated landing sites
for which any improvement in one objective results in a negative trade-off in the other.
Each of these five landing sites is “optimal”, and a quantifiable relationship between
each objective must be constructed to select a final choice. A linear weighting scheme
is used for these purposes

$$ r_t = w_l \cdot r_l + w_p · r_p $$

Tradeoff

Given the weighting between the two objectives, one of the purple dots on the green line is considered the "best" goal/path pair and will have minimum total risk. Here's the kicker though: you do not know the path risk until you do path planning. However, path planning is very expensive. PyMultiAStar will search for the optimal goal/path such that we minimize our expensive path planning procedures, often only needing to perform path planning 1-3 times on average.

How do you minimize path planning? How do you know when to stop searching?

We first sort the goals by their minimum total risk $r_{t,min}$ where

$$r_{t,min} = w_{g} \cdot r_{g} + w_p \cdot h(\mathbf{start}, \mathbf{goal}) / R$$

where $h$ is an admissible heuristic and $R$ is a normalizing constant. Basically, we are bounding the minimum path distance which in turn bounds total risk. $R$ is usually the largest distance permissible during path planning. This entire list is very cheap to compute and sort.

The first goal in this sorted list is the most likely to be the lowest total risk, but we don't know until we do path planning. After path planning to this goal, we can determine the true path risk and calculate the total risk. If the goal's total risk is less than the next goal's minimum total risk, we can guarantee we found the optimal solution to our objective function. We can stop searching!

What precisely are these objectives and where are the details of the planner?

See the following sections in the paper linked above:

  • Definition of Path Cost: Section 1.3.2, Equations 1.6-1.8
  • Definition of Path Risk: Section 1.5, Equation 1.17
  • Definition of Landing Site (Goal) Risk: Section 1.4.4, Equation 1.9. This can be defined as anything for your specific problem.
  • Definition of Total Risk: Section 1.6.2, Equation 1.18.
  • Proof of Planner: Section 1.6.3

Install

Binary Wheels are provided for you on PyPi:

  1. Discrete Multi-Goal Planner - pip install pymultiastar - This exposes the class PyMultiAStar
    1. This planner only knows about Voxel Grid to traverse.
  2. Geographically Aware Planner - pip install pymultiastar[geo] - This also exposes the class GeoPlanner
    1. This is a geographically aware wrapper around PyMultiAStar. You give a georeferenced voxel map and start conditions in GPS and landing sites in GPS and it will do the conversions between GPS to voxel cell for you.

How to use

Below are some examples:

  1. run_simple_world_3d.py. Shows a very simple example of a small 3D world with multiple goals.
  2. run_maze_2d.py - Demonstrates that 2D A-star path planning is a subset of the Multi-Goal Planner. It loads a 2D image of a maze as a single slice in a 3D world and has only 1 goal.
  3. run_scenarios.py - Shows how to use the GeoPlanner and plan in a 3D world.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymultiastar-0.0.10.tar.gz (48.0 MB view details)

Uploaded Source

Built Distributions

pymultiastar-0.0.10-cp311-cp311-win_arm64.whl (96.3 kB view details)

Uploaded CPython 3.11 Windows ARM64

pymultiastar-0.0.10-cp311-cp311-win_amd64.whl (102.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

pymultiastar-0.0.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (127.9 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pymultiastar-0.0.10-cp311-cp311-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (175.2 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 macOS 11.0+ universal2 (ARM64, x86-64)

pymultiastar-0.0.10-cp310-cp310-win_arm64.whl (96.4 kB view details)

Uploaded CPython 3.10 Windows ARM64

pymultiastar-0.0.10-cp310-cp310-win_amd64.whl (102.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

pymultiastar-0.0.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (127.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pymultiastar-0.0.10-cp310-cp310-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (175.2 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 macOS 11.0+ universal2 (ARM64, x86-64)

pymultiastar-0.0.10-cp39-cp39-win_arm64.whl (96.3 kB view details)

Uploaded CPython 3.9 Windows ARM64

pymultiastar-0.0.10-cp39-cp39-win_amd64.whl (102.6 kB view details)

Uploaded CPython 3.9 Windows x86-64

pymultiastar-0.0.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (128.2 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pymultiastar-0.0.10-cp39-cp39-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (175.4 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file pymultiastar-0.0.10.tar.gz.

File metadata

  • Download URL: pymultiastar-0.0.10.tar.gz
  • Upload date:
  • Size: 48.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for pymultiastar-0.0.10.tar.gz
Algorithm Hash digest
SHA256 700603e48ee263bdce8ad0c6c0d318277b7822314528d4846f6d531e123ace92
MD5 36d0cd2c2c1555d44d6adc21af5d8b20
BLAKE2b-256 764f72575e5f6e04682c0fc5fe508446c3e41c7e722e7beed49d903195d6221b

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp311-cp311-win_arm64.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp311-cp311-win_arm64.whl
Algorithm Hash digest
SHA256 6a620bb46dea632b71fbffea64a4e4327e920c05d8a296f744a836ae6b43a79b
MD5 efa892ed14d13c175df0f75ce49e80d6
BLAKE2b-256 52275ce7f2d658629695141629a213319413c34f9d895c60d03f622b1dafd9bd

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2b5032f243c1bdf050a3b20044ab27e62fca994fa8966ef512f63d7a2abc3f5e
MD5 29e053ac95da72fa052275ee4d79ff27
BLAKE2b-256 c328cb6264e22d9a59b3e8213f58d435a9517cbbdcddff45592b1da2345684d2

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 45b66be566f2fbb57e6c0b9db53381c1349e1e8b3e70e887c2e197c811f38e35
MD5 6c1f518c4c2f6c62f668e0730f280660
BLAKE2b-256 739c7d2a9680b99e5e03d5cf6be778175272f3bf3bd9da3a6d7c753babc00d42

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp311-cp311-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp311-cp311-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 c8c4b501817e60d00c39b0531d7b430a1f429815371eb0e06b456ec8bc8d5472
MD5 9ff4c047064644e47031e2820dc208db
BLAKE2b-256 71fb0cbbc03934d6ff6fbc4d2071266adde6a01aa3623ea73d990dbe2836dff2

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp310-cp310-win_arm64.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp310-cp310-win_arm64.whl
Algorithm Hash digest
SHA256 cae0a179bb387722acec3b89b6b7719cc4433a6af4e5c16548b0d66fccca03e2
MD5 7e1a3a03ec887d6efa3bed2391f0a3c6
BLAKE2b-256 08935ae9ee63dc92225b235809aacd3ebdf30e358eceb16a097cdc75149b0ed6

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c86eff397a9ce9265f6e6c8d4c35e57b23236f1ec81ecfa87f1519f94d3932d9
MD5 64813654e266c054c60e549531e0a8a7
BLAKE2b-256 9b0d4989389db95a1feec9fe58ad1a20ffc2fff9fc48b75fdcfb1332496cef9a

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 359b5116ebafe30b713e3da21e10d98c7592c254a4c7dcbc9c073ade2a9f2633
MD5 e2056cc320aa3a2098eeba417ecb4531
BLAKE2b-256 66377671b4f2d67643b78b8dcc4362ad16d836b143f118c2ac70c8952b40d753

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp310-cp310-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp310-cp310-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 d6778448f21a4388cd5ab7ceea882f28cdc0e7c5db1151ba624b00bdf9cd41af
MD5 9d91a741453be62a642083bcf0baec87
BLAKE2b-256 69c24e8c2b1874253a56000777873fbb0321655fbcc447e395fbc4bba93c1ce7

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp39-cp39-win_arm64.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp39-cp39-win_arm64.whl
Algorithm Hash digest
SHA256 4edefda5b537c3740c1fd09022b9b012a0d993f350acc315c762aca5042c4f23
MD5 5aecfa4fd8bb58aa46d36f6ce4ee42e6
BLAKE2b-256 0d2ba76de64086ff5d4b6da3c3faa09079056e3b7ae8a5c0edb3ab19738894d2

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c0e4962b2b3d34839d19949579c21bbf9c587785ae8062e2e20aaacbaa2f5ff5
MD5 d82d8db26a26cfa9559eddd74c65d04d
BLAKE2b-256 91622ea2419f47867b80ee78cc19feb8b35fe63334971a5a46534b8439c48a2d

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 914d263a4ac21584b83276ec549d24a039aa363c1a7fd056dbc12585d3172472
MD5 cf8a80baa1e9e36bc225f97160a8a27a
BLAKE2b-256 d421d7b27740b04a5a5608464b8ef4d871c75eec5e4874e1130b2a46794de7e5

See more details on using hashes here.

File details

Details for the file pymultiastar-0.0.10-cp39-cp39-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for pymultiastar-0.0.10-cp39-cp39-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 19d7ed25d435b446c08e2ffbf3fb9026abf0fb03389d15535c5779db9da50044
MD5 cc14def7ebe11a5003b7c36e6a381316
BLAKE2b-256 54dc4f76737041f0dddba5412a7eef54064d9810888b49a743e5e8699ff524ee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page