Python wrapper for RPLIDAR SDK using nanobind
Project description
PyRPLIDARSDK
Python wrapper for the Slamtec RPLIDAR SDK using nanobind.
This package provides a high-performance Python interface to RPLIDAR series laser range scanners, supporting both serial and UDP connections.
Installation
From PyPI
pip install pyrplidarsdk
From Source
# Clone the repository with submodules
git clone --recursive https://github.com/dexmate-ai/pyrplidarsdk.git
cd pyrplidarsdk
# Install in development mode
pip install -e .
Quick Start
Serial Connection
import pyrplidarsdk
import time
# Create driver instance for serial connection
driver = pyrplidarsdk.RplidarDriver(port="/dev/ttyUSB0")
# Connect to the device
if not driver.connect():
print("Failed to connect!")
exit(1)
# Get device information
info = driver.get_device_info()
if info:
print(f"Connected to RPLIDAR model {info.model}")
print(f"Firmware: {info.firmware_version}")
print(f"Hardware: {info.hardware_version}")
print(f"Serial: {info.serial_number}")
# Check device health
health = driver.get_health()
if health:
print(f"Device health: {health.status}")
# Start scanning
if driver.start_scan():
print("Scanning started...")
try:
for i in range(10): # Get 10 scans
scan_data = driver.get_scan_data()
if scan_data:
angles, ranges, qualities = scan_data
print(f"Scan {i+1}: {len(angles)} points")
time.sleep(0.1)
finally:
driver.stop_scan()
driver.disconnect()
UDP Connection
import pyrplidarsdk
# Create driver instance for UDP connection
driver = pyrplidarsdk.RplidarDriver(ip_address="192.168.1.100")
# Rest of the code is the same...
API Reference
RplidarDriver
Main class for controlling RPLIDAR devices.
Constructor
RplidarDriver(port=None, ip_address=None, baudrate=1000000, udp_port=8089)
port(str, optional): Serial port path (e.g., "/dev/ttyUSB0", "COM3")ip_address(str, optional): IP address for UDP connectionbaudrate(int): Serial baudrate (default: 1000000)udp_port(int): UDP port (default: 8089)
Methods
connect() -> bool: Connect to the devicedisconnect(): Disconnect from the deviceget_device_info() -> DeviceInfo | None: Get device informationget_health() -> DeviceHealth | None: Get device health statusstart_scan() -> bool: Start laser scanningstop_scan(): Stop laser scanningget_scan_data() -> tuple[list[float], list[float], list[int]] | None: Get scan data
DeviceInfo
Device information structure.
model(int): Device model numberfirmware_version(int): Firmware versionhardware_version(int): Hardware versionserial_number(str): Device serial number (hex string)
DeviceHealth
Device health information.
status(int): Health status codeerror_code(int): Error code if any
Utility Functions
The package includes utility functions in pyrplidarsdk.utils:
from pyrplidarsdk.utils import polar_to_cartesian, filter_by_range
# Convert polar to cartesian coordinates
x_coords, y_coords = polar_to_cartesian(angles, ranges)
# Filter by range
filtered_angles, filtered_ranges, filtered_qualities = filter_by_range(
angles, ranges, qualities, min_range=0.1, max_range=5.0
)
Support
- Issues: GitHub Issues
- Email: contact@dexmate.ai
Acknowledgments
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 Distributions
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 pyrplidarsdk-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyrplidarsdk-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 105.5 kB
- Tags: CPython 3.13, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02d897878344f370efa01aa6bd99797325bac75a6e4521cc5624a1e23b159f7c
|
|
| MD5 |
e5259313ffba10c0d00e9a928b45d339
|
|
| BLAKE2b-256 |
dfb164e5f5a5ff2da59ed13d1448082e157b8cc72008395307d4938480fc1e62
|
File details
Details for the file pyrplidarsdk-0.1.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pyrplidarsdk-0.1.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 98.8 kB
- Tags: CPython 3.13, manylinux: glibc 2.27+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
640fd06f119243744eb6a7801180fc1002ba2c15c766f370784406899fbddd25
|
|
| MD5 |
30d4e7766a95c49e1a36e1d79400f971
|
|
| BLAKE2b-256 |
512d000c46fde86dbd91a8825880659d8543451133b379e812badcd01286a55f
|
File details
Details for the file pyrplidarsdk-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyrplidarsdk-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 105.5 kB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e821aaea014313cc24a0592b63a97e5322c2017a1c977ed2e0805bb31557bcf7
|
|
| MD5 |
50b7576cae6f85e4419bce78c16d7bcc
|
|
| BLAKE2b-256 |
9c0978bb8da57c6750d62b93ac08fc56c8c312f6596061adef169a7b972b149d
|
File details
Details for the file pyrplidarsdk-0.1.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pyrplidarsdk-0.1.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 98.9 kB
- Tags: CPython 3.12, manylinux: glibc 2.27+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32d7c2b00ac527fdf1d2daba700d93e10a93006f1d70bcf86a19ed44a207ccb1
|
|
| MD5 |
c3b394e269953a8bb21bbd2c1a94b70b
|
|
| BLAKE2b-256 |
4d7c22f1fd885fc89655457bc12cf6732f8bccf405e81a4ddd883ad4fd881ae6
|
File details
Details for the file pyrplidarsdk-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyrplidarsdk-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 106.3 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a533876ad24ea56cde437c3e17b082c02e791ca6dbc7b29bc6267c4a995a9be2
|
|
| MD5 |
387606fed4f495a2e6045191b1f0b773
|
|
| BLAKE2b-256 |
f00c52f2bd6b634280d0aeda678f6e0eb9b16917a197a9518cec784ef268726f
|
File details
Details for the file pyrplidarsdk-0.1.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pyrplidarsdk-0.1.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 100.3 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
903c90a60ec9a46807b060c55e870f4b2f1fa47199f4cf9a758e824be4cb151b
|
|
| MD5 |
bd4910bfc285cc1f01073984a165289e
|
|
| BLAKE2b-256 |
c735affa1752277e935a1919620cd4aac1030e3d27b29401d677f6b1a79ff20b
|
File details
Details for the file pyrplidarsdk-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyrplidarsdk-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 106.5 kB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3529564cde32bc2ebbbdfa1d039cb57fb520e48fd41517a5f09290abe921dd82
|
|
| MD5 |
fe485f1fa5eb036de01690f45fda8416
|
|
| BLAKE2b-256 |
b277f3f5fba003e265179aad7996de0966840ccd7cf8707665b669575ea457b0
|
File details
Details for the file pyrplidarsdk-0.1.1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pyrplidarsdk-0.1.1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 100.5 kB
- Tags: CPython 3.10, manylinux: glibc 2.27+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0de3419e26585e1cc67ae0c07e841f5747875f3182cc288540ef9240520f0cdc
|
|
| MD5 |
57df2229121e3c99f51db4a796039f8b
|
|
| BLAKE2b-256 |
1183d456458b81b4b5505f07ad76b4d9665d0d914c7d611865472161e3964e1e
|