AMCL Python Bindings
Python bindings for Adaptive Monte Carlo Localization (AMCL) adapted from the Nav2 AMCL.
Vibe-coded with love ❤️
📦 Installation
You can install the package using pip:
pip install amcl
Or install from source:
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(
alpha1=0.1,
alpha2=0.1,
alpha3=0.1,
alpha4=0.1,
alpha5=0.1
)
laser_params = amcl.LaserParameters(
z_hit=0.5,
z_short=0.05,
z_max=0.05,
z_rand=0.5,
sigma_hit=0.2,
lambda_short=0.1,
chi_outlier=0.05,
max_beams=60
)
# 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)
# Set laser pose relative to robot base
localizer.set_laser_pose(amcl.Vector3D(0.0, 0.0, 0.0))
# 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
Metadata
Release files for amcl 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| amcl-0.1.2.tar.gz | 53.0 kB | Details |
Built distributions (wheels)
Total release size: 1.1 MB
Release files / amcl-0.1.2.tar.gz
| Download URL | amcl-0.1.2.tar.gz |
|---|---|
| Size | 53.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
578cc16e3e0e921b44337c4a12c2ba50be262b2830471d4ba23d4eb9a150c7ff
|
|
BLAKE2b-256 checksum How to use checksums |
08fbae3fb98e6f9d773fb07448c8603930207c1e4c36cc71fd126f47a963978a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / amcl-0.1.2-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | amcl-0.1.2-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 121.3 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2f832ec5d9038488c7f0ac2c787fcbaebc27f23061b99b8fd0247aeea8c300f1
|
|
BLAKE2b-256 checksum How to use checksums |
c5b16b2c2f739ae6910d81ddf93c66c8d5545f14941f549f9504639e3304432a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / amcl-0.1.2-cp312-abi3-macosx_14_0_arm64.whl
| Download URL | amcl-0.1.2-cp312-abi3-macosx_14_0_arm64.whl |
|---|---|
| Size | 82.8 kB |
| Tags | CPython 3.12 abi3 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4ccb0806d4b2f6da2a3bf39f7092ec5a329b68d250ca46a9a244f799add67751
|
|
BLAKE2b-256 checksum How to use checksums |
b72aa2469e825fe35c2c64e159d1f2a4d54bf4b57d273eb61d1ca8273e663a33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / amcl-0.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | amcl-0.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 124.3 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
921036192682cabf6e693d59ea5ca4f9d4aa463517357d4723cacee381d349c6
|
|
BLAKE2b-256 checksum How to use checksums |
63ffa69141e1dacaf63e6779b03e55a766d78bcaa667c4199d11d0ac7d80567d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / amcl-0.1.2-cp311-cp311-macosx_14_0_arm64.whl
| Download URL | amcl-0.1.2-cp311-cp311-macosx_14_0_arm64.whl |
|---|---|
| Size | 84.4 kB |
| Tags | CPython 3.11 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9c250659c003e575b63101f1d2cadfff3bc224dbd9235afd891cd2da5f69db09
|
|
BLAKE2b-256 checksum How to use checksums |
71e82a053e85b49c0abf24b7a89461176f924be0047832aa5811e037f3d3dff1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / amcl-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | amcl-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 124.6 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
58fa264f38ce22c5ca862262bcf3ce75d1d86a09cbe73974e436ee032425a8f4
|
|
BLAKE2b-256 checksum How to use checksums |
07f24e236d9de96db14935c700d561e40cb8ab8a060c28476bea3dce6b18afaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / amcl-0.1.2-cp310-cp310-macosx_14_0_arm64.whl
| Download URL | amcl-0.1.2-cp310-cp310-macosx_14_0_arm64.whl |
|---|---|
| Size | 84.5 kB |
| Tags | CPython 3.10 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0394d2cdd31bbb61368c2bfce8ca01f2577d3c302effa58fc1eafa3f4d864a23
|
|
BLAKE2b-256 checksum How to use checksums |
6b3ac75217c17ba2d4ecd9fe073971a190c22c0d279ccd072fb0cd9eab49c9e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / amcl-0.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | amcl-0.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 124.8 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
013290e5d9fb331f9b195365abe5625aef8ac5ae5855126dd0b0dea911c36d12
|
|
BLAKE2b-256 checksum How to use checksums |
36139015ab2c44be86ebfdd26e8d3cae538c88f8961c29843efbe6958e5c31cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / amcl-0.1.2-cp39-cp39-macosx_14_0_arm64.whl
| Download URL | amcl-0.1.2-cp39-cp39-macosx_14_0_arm64.whl |
|---|---|
| Size | 84.7 kB |
| Tags | CPython 3.9 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d130382d47d97c2535b8f7bffd278232bfd9cdd5d718807f93088f5c26a1fd47
|
|
BLAKE2b-256 checksum How to use checksums |
e48afeb1da1a8dbbc2b34b765eab264847d3c25ef75ff4885960a8da0626425e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / amcl-0.1.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | amcl-0.1.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 123.7 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2eb831ff3557dbf1bad05c4ca900c42c239a563e5bd5d7131934f8a7e56240c9
|
|
BLAKE2b-256 checksum How to use checksums |
c259b811369029e480df69de80c1960f38ade01530fb24b1f1768cfe4bab2406
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / amcl-0.1.2-cp38-cp38-macosx_14_0_arm64.whl
| Download URL | amcl-0.1.2-cp38-cp38-macosx_14_0_arm64.whl |
|---|---|
| Size | 84.1 kB |
| Tags | CPython 3.8 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
83794268e7527f931315e8c7e5eee233182aecb8ea9ef32e10cba9cf8c882778
|
|
BLAKE2b-256 checksum How to use checksums |
f25691df416d2bc526709d02863d5ca9fe21a8f5391c74a02729aaf463c493a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|