Skip to main content

AMCL Python Bindings

Project description

AMCL Python Bindings

Python C++17 License: GPLv3 Build

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 filter
  • Vector3D: 3D vector for poses (x, y, theta)
  • Matrix3D: 3x3 matrix for covariances
  • LaserScan: Laser scanner data structure
  • OccupancyGrid: 2D occupancy grid map
  • MotionParameters: Robot motion model parameters
  • LaserParameters: Laser sensor model parameters

Utility Functions

  • create_laser_scan_from_list(): Create LaserScan from Python lists
  • create_occupancy_grid_from_list(): Create OccupancyGrid from Python lists
  • get_version(): Get library version

NumPy Integration (amcl_numpy module)

  • create_occupancy_grid_from_numpy(): Create OccupancyGrid from NumPy array
  • create_laser_scan_from_numpy(): Create LaserScan from NumPy array
  • occupancy_grid_to_numpy(): Convert OccupancyGrid to NumPy array
  • laser_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amcl-0.1.2.tar.gz (53.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

amcl-0.1.2-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (121.3 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

amcl-0.1.2-cp312-abi3-macosx_14_0_arm64.whl (82.8 kB view details)

Uploaded CPython 3.12+macOS 14.0+ ARM64

amcl-0.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (124.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

amcl-0.1.2-cp311-cp311-macosx_14_0_arm64.whl (84.4 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

amcl-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (124.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

amcl-0.1.2-cp310-cp310-macosx_14_0_arm64.whl (84.5 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

amcl-0.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (124.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

amcl-0.1.2-cp39-cp39-macosx_14_0_arm64.whl (84.7 kB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

amcl-0.1.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (123.7 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

amcl-0.1.2-cp38-cp38-macosx_14_0_arm64.whl (84.1 kB view details)

Uploaded CPython 3.8macOS 14.0+ ARM64

File details

Details for the file amcl-0.1.2.tar.gz.

File metadata

  • Download URL: amcl-0.1.2.tar.gz
  • Upload date:
  • Size: 53.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for amcl-0.1.2.tar.gz
Algorithm Hash digest
SHA256 578cc16e3e0e921b44337c4a12c2ba50be262b2830471d4ba23d4eb9a150c7ff
MD5 f07a3f1470165acfa17552342600317f
BLAKE2b-256 08fbae3fb98e6f9d773fb07448c8603930207c1e4c36cc71fd126f47a963978a

See more details on using hashes here.

File details

Details for the file amcl-0.1.2-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for amcl-0.1.2-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2f832ec5d9038488c7f0ac2c787fcbaebc27f23061b99b8fd0247aeea8c300f1
MD5 ee7cd621f4df3af7578fb55197d64181
BLAKE2b-256 c5b16b2c2f739ae6910d81ddf93c66c8d5545f14941f549f9504639e3304432a

See more details on using hashes here.

File details

Details for the file amcl-0.1.2-cp312-abi3-macosx_14_0_arm64.whl.

File metadata

  • Download URL: amcl-0.1.2-cp312-abi3-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 82.8 kB
  • Tags: CPython 3.12+, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for amcl-0.1.2-cp312-abi3-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4ccb0806d4b2f6da2a3bf39f7092ec5a329b68d250ca46a9a244f799add67751
MD5 ac4ef319b4755aecbcfb9ffddf96e3a9
BLAKE2b-256 b72aa2469e825fe35c2c64e159d1f2a4d54bf4b57d273eb61d1ca8273e663a33

See more details on using hashes here.

File details

Details for the file amcl-0.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for amcl-0.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 921036192682cabf6e693d59ea5ca4f9d4aa463517357d4723cacee381d349c6
MD5 da541cded36b6af9f9d3038bf0797980
BLAKE2b-256 63ffa69141e1dacaf63e6779b03e55a766d78bcaa667c4199d11d0ac7d80567d

See more details on using hashes here.

File details

Details for the file amcl-0.1.2-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for amcl-0.1.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9c250659c003e575b63101f1d2cadfff3bc224dbd9235afd891cd2da5f69db09
MD5 7e8ef07be5757102fbca087ae1600b36
BLAKE2b-256 71e82a053e85b49c0abf24b7a89461176f924be0047832aa5811e037f3d3dff1

See more details on using hashes here.

File details

Details for the file amcl-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for amcl-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 58fa264f38ce22c5ca862262bcf3ce75d1d86a09cbe73974e436ee032425a8f4
MD5 f576fa823039ccc0cb3fef8c0e951630
BLAKE2b-256 07f24e236d9de96db14935c700d561e40cb8ab8a060c28476bea3dce6b18afaa

See more details on using hashes here.

File details

Details for the file amcl-0.1.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for amcl-0.1.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0394d2cdd31bbb61368c2bfce8ca01f2577d3c302effa58fc1eafa3f4d864a23
MD5 47252a50ceb49f394a475ed40df22955
BLAKE2b-256 6b3ac75217c17ba2d4ecd9fe073971a190c22c0d279ccd072fb0cd9eab49c9e1

See more details on using hashes here.

File details

Details for the file amcl-0.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for amcl-0.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 013290e5d9fb331f9b195365abe5625aef8ac5ae5855126dd0b0dea911c36d12
MD5 94c1e4011627b3f606d84ffd9fd41129
BLAKE2b-256 36139015ab2c44be86ebfdd26e8d3cae538c88f8961c29843efbe6958e5c31cc

See more details on using hashes here.

File details

Details for the file amcl-0.1.2-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

  • Download URL: amcl-0.1.2-cp39-cp39-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 84.7 kB
  • Tags: CPython 3.9, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for amcl-0.1.2-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d130382d47d97c2535b8f7bffd278232bfd9cdd5d718807f93088f5c26a1fd47
MD5 f90e4c014096ca079162d61826a9a650
BLAKE2b-256 e48afeb1da1a8dbbc2b34b765eab264847d3c25ef75ff4885960a8da0626425e

See more details on using hashes here.

File details

Details for the file amcl-0.1.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for amcl-0.1.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2eb831ff3557dbf1bad05c4ca900c42c239a563e5bd5d7131934f8a7e56240c9
MD5 3d2b74988ed7cd58541f0a3cb6e4ee52
BLAKE2b-256 c259b811369029e480df69de80c1960f38ade01530fb24b1f1768cfe4bab2406

See more details on using hashes here.

File details

Details for the file amcl-0.1.2-cp38-cp38-macosx_14_0_arm64.whl.

File metadata

  • Download URL: amcl-0.1.2-cp38-cp38-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 84.1 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

Hashes for amcl-0.1.2-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 83794268e7527f931315e8c7e5eee233182aecb8ea9ef32e10cba9cf8c882778
MD5 3f9583b4fa89a5108b40b8318af1b948
BLAKE2b-256 f25691df416d2bc526709d02863d5ca9fe21a8f5391c74a02729aaf463c493a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page