Skip to main content

Simultaneous localization and mapping (SLAM) tools in 3D

Project description

slam3d

Simultaneous localization and mapping (SLAM) tools in 3D

Python Wrapper

Currently implements particleFilterLoc. Supports Python 3.6+.

Installation

Install the slam3d package from PyPi:

python3 -m pip install slam3d

Or use the source distribution or wheels in the latest release.

To install the latest unreleased code, download or clone this source repository and run the following to build and install:

python3 -m pip install .

Example

import numpy as np
from particlefilter import ParticleFilterLoc, setSeed

# If deterministic tests are needed, call this before anything else
setSeed(123456789) # Argument is np.uint32

pf = ParticleFilterLoc()

pf.depositVio(t: np.float64, x: np.float32, y: np.float32, z: np.float32, dist: np.float32)
pf.depositRange(bx: np.float32, by: np.float32, bz: np.float32, range: np.float32, stdRange: np.float32)
pf.depositRssi(bx: np.float32, by: np.float32, bz: np.float32, rssi: np.int32)
pf.getTagLoc() # returns tuple: (status: np.int32, t: np.float64, x: np.float32, y: np.float32, z: np.float32, theta: np.float32)

Development

To install for development, download or clone and run:

python3 -m pip install -e .

Source found in ./particlefilter/cython.

C

Source found in ./particlefilter. A bundled version of MUSL rand_r() is included for Windows builds. Force it on other platforms with -DPF_FORCE_MUSL_RANDR=1. Precompiled shared libraries can be found in the latest release.

Shared library

gcc -fPIC -shared -o particlefilter.so -Iparticlefilter/include particlefilter/src/*.c -lm

Or on Windows with cl.exe:

cl.exe particlefilter/src/*.c /Iparticlefilter/include /MT /link /DLL /OUT:build/particlefilter.dll

Development

Compile tests with:

gcc -o build/test -Iparticlefilter/include particlefilter/src/*.c test/test.c -lm

On Windows cl.exe also works (from Development Command Prompt):

cl.exe -o build/test -Iparticlefilter/include particlefilter/src/*.c test/test.c -lm

Compile and debug tests with:

gcc -o build/test -Iparticlefilter/include particlefilter/src/*.c test/test.c -lm -g
gdb ./build/test

Tests

Both test/test.c and test/test.py implement mostly the same test.

test [--nofail] <test folder> <output file> [expected file (required without --nofail)]

The currently provided test folder is ./test/data. --nofail will cause the test to always exit with status code 0 and allow omitting testing against an expected file (by not providing the last argument).

When running the C test, some expected files are provided in ./test/data for various operating systems and compilers. When running the Python test, you should test against the output of running the C test on your system. The Python test will also for some floating point precision deviation. Since the Python test tests each value individually, it is impervious to CRLF/LF differences.

License

Copyright (c) 2021, Wireless Sensing and Embedded Systems Lab, Carnegie Mellon University All rights reserved.

This source code is licensed under the BSD-3-Clause license found in the LICENSE file in the root directory of this source tree.

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

slam3d-0.1.1.tar.gz (6.8 MB view hashes)

Uploaded Source

Built Distributions

slam3d-0.1.1-pp37-pypy37_pp73-win_amd64.whl (27.4 kB view hashes)

Uploaded PyPy Windows x86-64

slam3d-0.1.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (31.3 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

slam3d-0.1.1-cp39-cp39-win_amd64.whl (32.6 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

slam3d-0.1.1-cp39-cp39-win32.whl (28.4 kB view hashes)

Uploaded CPython 3.9 Windows x86

slam3d-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (131.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

slam3d-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (29.2 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

slam3d-0.1.1-cp39-cp39-macosx_10_9_x86_64.whl (30.7 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

slam3d-0.1.1-cp39-cp39-macosx_10_9_universal2.whl (56.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

slam3d-0.1.1-cp38-cp38-win_amd64.whl (32.5 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

slam3d-0.1.1-cp38-cp38-win32.whl (28.3 kB view hashes)

Uploaded CPython 3.8 Windows x86

slam3d-0.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (134.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

slam3d-0.1.1-cp38-cp38-macosx_11_0_arm64.whl (29.0 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

slam3d-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl (30.4 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

slam3d-0.1.1-cp38-cp38-macosx_10_9_universal2.whl (55.8 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)

slam3d-0.1.1-cp37-cp37m-win_amd64.whl (32.3 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

slam3d-0.1.1-cp37-cp37m-win32.whl (28.0 kB view hashes)

Uploaded CPython 3.7m Windows x86

slam3d-0.1.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (126.1 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

slam3d-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl (30.2 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

slam3d-0.1.1-cp36-cp36m-win_amd64.whl (32.1 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

slam3d-0.1.1-cp36-cp36m-win32.whl (27.9 kB view hashes)

Uploaded CPython 3.6m Windows x86

slam3d-0.1.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (125.8 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

slam3d-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl (29.6 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

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