Algorithms for Path Planning
Project description
pyhpp
Python Package for A* Algorithms
- Step 1: import A* algorithm
from pyhpp.a_star import AStar
- Step 2: prepare a JSON type scenario, e.g.,
scenario = {
"dimension": {"x": 10, "y": 10, "z": 10},
"waypoint": {
"start": {"x": 5, "y": 9, "z": 2},
"stop": {"x": 5, "y": 0, "z": 4},
"allowDiagonal": False
},
"data": {
"size": 16,
"x": [4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7],
"y": [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6],
"z": [2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5]
},
"boundary": {
"zCeil": 6,
"zFloor": 1
}
}
dimension
: [required] whole dimension of the scenario
waypoint
: [required] start and stop positions (defaultallowDiagonal
isFalse
)
data
: obstacle data (set as empty if none)
boundary
: the z-axis boundary of path for calculation
- Step 3: create an A* instance
a_star = AStar(scenario)
- Step 4: calculate and get the results
result = a_star.calculate_path()
# visited_Q = result["visitedQ"]
# final_Q = result["finalQ"]
path = result["path"]
visitedQ
: all the visited positions
finalQ
: all the positions in the A* path
path
: the A* path that is from start to stop
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyhpp-0.0.3.tar.gz
(5.5 kB
view details)
Built Distribution
pyhpp-0.0.3-py3-none-any.whl
(7.9 kB
view details)
File details
Details for the file pyhpp-0.0.3.tar.gz
.
File metadata
- Download URL: pyhpp-0.0.3.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f17131996597046ce4724f69ee56073a8b2623d8c185dd9aeedae483679d1d9 |
|
MD5 | 4d94900cbccc787b59e51a75de6e40a4 |
|
BLAKE2b-256 | 164b6ecc2325e1169fee38f135e94e9d640ae58843692da9255e42ec8ce49546 |
File details
Details for the file pyhpp-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: pyhpp-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 394d52efa888eeb2bd7cd50b8d6a8c088ee917fe0b3b8431c264899c4ede4e5c |
|
MD5 | b232519ded41a1419eeabec15b271563 |
|
BLAKE2b-256 | 13902d797d418f3f8cf4ad4d0ac34e3ce8ea540ad9f4a29099e7855ffb124e43 |