A simple map representation and path planning library for 2D occupancy grids.
Project description
cartoblobpy
cartoblobpy is a small Python library for working with 2D occupancy grids, map images, and weighted graph representations for path planning. It can load maps from PNG images or YAML map descriptions, convert between world and grid coordinates, inspect occupancy values, plot maps, inflate obstacles, and build NetworkX graphs from free space.
Features
- Load maps from image files or YAML map descriptions.
- Work with start/goal markers embedded in map images.
- Convert between world coordinates and grid coordinates in ENU or NED frames.
- Query occupancy, free space, path validity, and distance to obstacles.
- Plot occupancy grids and named layers with Matplotlib.
- Build weighted graphs with NetworkX for path-planning workflows.
- Access bundled example maps and persisted results from
cartoblobpy.assets.
Installation
Install the package into your environment from the project root:
pip install -e .
If you prefer a regular install:
pip install .
The runtime dependencies are listed in requirements.txt.
Quick Start
Load a bundled example map, inspect it, and plot it:
from cartoblobpy.assets import get_map_path
from cartoblobpy.graph import Graph
graph = Graph()
graph.load_from_yaml(get_map_path("map012.yaml"))
print("grid shape:", graph.grid.shape)
print("resolution:", graph.resolution)
print("start:", graph.start)
print("goal:", graph.goal)
ax = graph.plot(show_start_goal=True, show_colorbar=True, cmap="gray_r")
If you already have a map image, load it directly:
from cartoblobpy.graph import Graph
graph = Graph()
graph.load_from_image("path/to/map.png")
Working With Maps
YAML map files are expected to define at least:
image: path to the map image, absolute or relative to the YAML file.resolution: meters per pixel.origin: map origin as[x, y, yaw].
Optional keys include:
start: start position in grid coordinates.goal: goal position in grid coordinates.layers: named layer images, optionally with value mappings.
Typical operations after loading a map include:
point = [2.5, 4.0]
graph.is_free(point)
graph.is_free_path([0.0, 0.0], [5.0, 5.0])
graph.value_at(point)
graph.distance_to_closest_obstacle(point)
graph.inflate_obstacles(radius=1.5)
graph.build_graph()
The graph object supports ENU and NED coordinate frames through the
coordinate_frame property.
Bundled Assets
The cartoblobpy.assets module provides helpers for example data and saved
results:
list_example_maps()lists the packaged YAML maps.get_map_path(name)returns the absolute path to a bundled map.save_result(result, filename)stores a pickle underassets/results.load_result(filename)loads a saved result.list_available_results()lists saved.pklfiles.
Running Tests
Run the unittest suite with Python on Windows (PowerShell):
py -m unittest discover -s tests -p "test_*.py" -v
If py is unavailable, use your environment's Python:
python -m unittest discover -s tests -p "test_*.py" -v
Documentation
Sphinx documentation lives under docs/. Build it from the project root if you
want the generated HTML docs.
License
cartoblobpy is distributed under the European Union Public Licence 1.2 (EUPL 1.2).
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cartoblobpy-0.0.10.tar.gz.
File metadata
- Download URL: cartoblobpy-0.0.10.tar.gz
- Upload date:
- Size: 17.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4537f3ca1b969d216df885d555637bfecacad0ab2df680c06da3719b7e686d66
|
|
| MD5 |
f34a4691d6e82add0d40daf3bd1561dd
|
|
| BLAKE2b-256 |
0fc0a044f52fa948fd7902a54ec77bd16030f5d6d5f74ba5c1c25c2f24af9596
|
Provenance
The following attestation bundles were made for cartoblobpy-0.0.10.tar.gz:
Publisher:
publish.yml on incebellipipo/cartoblobpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cartoblobpy-0.0.10.tar.gz -
Subject digest:
4537f3ca1b969d216df885d555637bfecacad0ab2df680c06da3719b7e686d66 - Sigstore transparency entry: 1787466353
- Sigstore integration time:
-
Permalink:
incebellipipo/cartoblobpy@fb9b8fae44eb30e1eae58664140ed8e89a680893 -
Branch / Tag:
refs/tags/v0.0.10 - Owner: https://github.com/incebellipipo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fb9b8fae44eb30e1eae58664140ed8e89a680893 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cartoblobpy-0.0.10-py3-none-any.whl.
File metadata
- Download URL: cartoblobpy-0.0.10-py3-none-any.whl
- Upload date:
- Size: 16.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07814c439f36606d21d5246acc62897d19d471c33a39f81051ef37b0ef8879e9
|
|
| MD5 |
7f2e4e35ce0a2701bac06b59b3df6b7d
|
|
| BLAKE2b-256 |
f83bc0f508322b687001e322a25c1c41e636154181cb82f71db1c92e93e592e2
|
Provenance
The following attestation bundles were made for cartoblobpy-0.0.10-py3-none-any.whl:
Publisher:
publish.yml on incebellipipo/cartoblobpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cartoblobpy-0.0.10-py3-none-any.whl -
Subject digest:
07814c439f36606d21d5246acc62897d19d471c33a39f81051ef37b0ef8879e9 - Sigstore transparency entry: 1787466658
- Sigstore integration time:
-
Permalink:
incebellipipo/cartoblobpy@fb9b8fae44eb30e1eae58664140ed8e89a680893 -
Branch / Tag:
refs/tags/v0.0.10 - Owner: https://github.com/incebellipipo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fb9b8fae44eb30e1eae58664140ed8e89a680893 -
Trigger Event:
release
-
Statement type: