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

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 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.1.tar.gz (52.5 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.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (120.8 kB view details)

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

amcl-0.1.1-cp312-abi3-macosx_14_0_arm64.whl (82.2 kB view details)

Uploaded CPython 3.12+macOS 14.0+ ARM64

amcl-0.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (123.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

amcl-0.1.1-cp311-cp311-macosx_14_0_arm64.whl (83.9 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

amcl-0.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (124.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

amcl-0.1.1-cp310-cp310-macosx_14_0_arm64.whl (84.0 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

amcl-0.1.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (124.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

amcl-0.1.1-cp39-cp39-macosx_14_0_arm64.whl (84.1 kB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

amcl-0.1.1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (123.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

amcl-0.1.1-cp38-cp38-macosx_14_0_arm64.whl (83.6 kB view details)

Uploaded CPython 3.8macOS 14.0+ ARM64

File details

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

File metadata

  • Download URL: amcl-0.1.1.tar.gz
  • Upload date:
  • Size: 52.5 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.1.tar.gz
Algorithm Hash digest
SHA256 97ddf998ce8720fc5d1ee4a34189faecdb85c36abc7ae150672413778d8a5f8e
MD5 e4c712568356310434cd7503ee719876
BLAKE2b-256 f30832d02d1555621c496023c3baaf393d6ca3fcac98394d6b5626e828fed208

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amcl-0.1.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e960521d757c4a6f98ffcc673c4377fbc1f4a818067f0d4180472b34bd1b6fbc
MD5 ded94bebfd4608c7b72f2932db2cb786
BLAKE2b-256 9d1ccfe3b84290399462bfcaf52d57e85f635d61d9b2d6d1bf5fee5955cf773d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amcl-0.1.1-cp312-abi3-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 82.2 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.1-cp312-abi3-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 87c57da7067b0d7524ab99e78683442622f393933f7513e4bb85530ade677b9c
MD5 50c1014682266350c8e04147969c41a6
BLAKE2b-256 efcca913e826d1de3dc535e841df552a6a2e156f35197409089aa262eca15d8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amcl-0.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7385fd051a03c0d468fb2a23af596dca29924dbda958976273ef833e93f63728
MD5 652752ffcf8a8eff4649f781740210fb
BLAKE2b-256 65070c4cad49edab54c41075ef2e073b2e0ae3a94f621ad9922508dd01b11994

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amcl-0.1.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 aa38019beeb45c72e8156975cf0c874469cc44b59afd8fbeec36bd7380516f62
MD5 0a92408b3300b2931be9f192aaf845fa
BLAKE2b-256 e667fcb7f4be2ca7f22ae02ebe4fc282e40626ea535bb3f8558ab47b49503fb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amcl-0.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 be8cefc9f09f8ee364ef66c590b41bb7aeefc2b042d83122980b797ded8e58ed
MD5 38b8b09e6d86356781a0fc0980bd17a7
BLAKE2b-256 f56172eb1d2bb7aa9bc72c882d8088c195f6e4cd250dcbc37cee186952d8be8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amcl-0.1.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0ff534c8c717b6c5771223d1fa2d9ff5cf149bec705e54cdd00585850e9e4b4d
MD5 77edaed8fd9784d4d2c85f1fede10d6d
BLAKE2b-256 8e474368d158a9c133cdc3332c737e379edba2b22107ea03bd5103055644e2d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amcl-0.1.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 71c14a918f1043d7ce5b5116a8aa6cb97aab66999d4b778087465ffc40e02347
MD5 978fdaf6ee5b8aa61baadaae984035c1
BLAKE2b-256 50b656ed6e032a7dcbd769c0afe8915a38a0b3e6cc9bf6e337ecdefb22a86ca4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amcl-0.1.1-cp39-cp39-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 84.1 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.1-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 dd259a61202cd159cf40f96d84ea428813e6f8dd58bde8ca3a45cba5d148bf83
MD5 9ca932ae8cfaa5896cd572b237126484
BLAKE2b-256 b1527d8cd384e2af84fe38746a324605d217764368564164e83aabc5583357b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amcl-0.1.1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 269d18315ab6af893d7747265673686f736aea6d1fd03ccc972ef1dbf5a9060d
MD5 3d88f3139ad7d6f976193aaa5e57f26a
BLAKE2b-256 99b71dad2054e728510e4eb6f28976a7f5c0c84d8323991aa8201bb5168c71d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: amcl-0.1.1-cp38-cp38-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

Hashes for amcl-0.1.1-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ea7782aa44510d7df8b6163b3f9b8e0699c414059a79e15046e3fc63b1eb1ff6
MD5 96dd764cf58aa6088e8972dec3db0e56
BLAKE2b-256 ad10db6b1fd3f597519acddff7d7eade2e737833c7d0bb072aa21158a6c28d3b

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