Skip to main content

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 (default allowDiagonal is False)
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


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.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

pyhpp-0.0.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file pyhpp-0.0.2.tar.gz.

File metadata

  • Download URL: pyhpp-0.0.2.tar.gz
  • Upload date:
  • Size: 5.4 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

Hashes for pyhpp-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e6271f5068b5f804b1d13ce0642c8df43c26ac94e668e1f6af1a0d7e5cdf8497
MD5 04b52793604bd3c5c756d2130d5c8cac
BLAKE2b-256 20046f79b00d6f6b48b79b158939db7d68e7cea143b736b891c6c2ed480a8205

See more details on using hashes here.

File details

Details for the file pyhpp-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyhpp-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.8 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

Hashes for pyhpp-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e7f4ed0f252b6f7fadaff6b5608884b283e0497ebea2f54864e9cfd0b8fd8b1
MD5 5100baeb8e83e20e1be3ea2f2f7d38f0
BLAKE2b-256 cca5eb0f012275892c9109044e8b37b3a804e94ec228e6858397ef96414b0787

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