AMCL Python Bindings
Reason this release was yanked:
unsupported abi on python <3.12
Project description
AMCL Python Bindings
Python bindings for Adaptive Monte Carlo Localization (AMCL) adapted from the Nav2 AMCL.
Vibe-coded with love ❤️
📦 Installation
git clone https://github.com/damanikjosh/amcl_python.git
cd amcl_python
pip install -e .
🎯 Quick Start
Basic Usage
import amcl
import numpy as np
# Create motion and laser parameters
motion_params = amcl.MotionParameters(0.1, 0.1, 0.1, 0.1, 0.1)
laser_params = amcl.LaserParameters()
# Create AMCL localizer
localizer = amcl.AMCL(
min_particles=100,
max_particles=500,
alpha_slow=0.001,
alpha_fast=0.1,
motion_params=motion_params,
laser_likelihood_max_dist=2.0,
laser_params=laser_params,
robot_model_type="differential"
)
# Create occupancy grid map
grid_data = [[0 for _ in range(100)] for _ in range(100)]
grid_data[50][50] = 100 # Add obstacle
grid = amcl.create_occupancy_grid_from_list(grid_data, 0.1, -5.0, -5.0)
# Set map and initial pose
localizer.set_map(grid)
initial_pose = amcl.Vector3D(0.0, 0.0, 0.0)
initial_cov = amcl.Matrix3D()
localizer.set_initial_pose(initial_pose, initial_cov)
# Update with laser scan
ranges = [[i * 0.1, i * 0.017] for i in range(181)] # [range, bearing] pairs
scan = amcl.create_laser_scan_from_list(ranges, 10.0)
odom_pose = amcl.Vector3D(0.1, 0.0, 0.0)
localizer.update(scan, odom_pose)
pose = localizer.get_pose_mean()
print(f"Estimated pose: ({pose.x:.3f}, {pose.y:.3f}, {pose.theta:.3f})")
📚 API Reference
Core Classes
AMCL: Main localization class implementing particle filterVector3D: 3D vector for poses (x, y, theta)Matrix3D: 3x3 matrix for covariancesLaserScan: Laser scanner data structureOccupancyGrid: 2D occupancy grid mapMotionParameters: Robot motion model parametersLaserParameters: Laser sensor model parameters
Utility Functions
create_laser_scan_from_list(): Create LaserScan from Python listscreate_occupancy_grid_from_list(): Create OccupancyGrid from Python listsget_version(): Get library version
NumPy Integration (amcl_numpy module)
create_occupancy_grid_from_numpy(): Create OccupancyGrid from NumPy arraycreate_laser_scan_from_numpy(): Create LaserScan from NumPy arrayoccupancy_grid_to_numpy(): Convert OccupancyGrid to NumPy arraylaser_scan_to_numpy(): Convert LaserScan to NumPy array
📄 License
This project is licensed under the GPLv3 License - see the LICENSE file for details.
🙏 Acknowledgments
- Nav2 Team: Original AMCL implementation
- ROS Community: Foundational robotics algorithms
- nanobind: Excellent Python binding framework
- Claude Sonnet 4: For helping with code generation
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 Distributions
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 amcl-0.1.0.tar.gz.
File metadata
- Download URL: amcl-0.1.0.tar.gz
- Upload date:
- Size: 52.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
749846c03948edb8429bea161c2e98498679af05fd6c7201524a5e5df01c8840
|
|
| MD5 |
6860847c721ef1272adcfed34a500133
|
|
| BLAKE2b-256 |
5c16339e0e9aea9b2930538302f99b5b9589c179cf2f2728fb15fd2e62f26b30
|
File details
Details for the file amcl-0.1.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: amcl-0.1.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 123.3 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
525e0f8b447ae8adf33c2a65b0647eb26ea4f9c4e1e1e2b16dbe7750d6001f9d
|
|
| MD5 |
d403540062015845762994233131e6f6
|
|
| BLAKE2b-256 |
fe34c82bf7262816bda9237af06b7b570f50e8eb7671cefd02cc718e99567ef6
|
File details
Details for the file amcl-0.1.0-cp38-abi3-macosx_14_0_arm64.whl.
File metadata
- Download URL: amcl-0.1.0-cp38-abi3-macosx_14_0_arm64.whl
- Upload date:
- Size: 83.6 kB
- Tags: CPython 3.8+, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ed0790a6cb8193fc8921513c3dfbdcf6568bf9ed5d8cb185828d7a60144861
|
|
| MD5 |
d3eb20da81a71146cbafe3a78328a2a5
|
|
| BLAKE2b-256 |
6830ddc376d6adcca515660ca9e98d42cece0d6c2526d88ad051fbf147ebee9e
|