Skip to main content

SE(3) LiDAR-Inertial Odometry Python bindings

Project description

SE(3)-LIO Python bindings

Python bindings for the ROS-agnostic SE(3) LiDAR-Inertial Odometry C++ core.

Build

The bindings link the C++ core, which requires PCL, Eigen, Sophus and OpenMP. Build inside the project's ROS2 Docker image (docker/ros2/), where these are available.

# inside the container, from the repo root
pip install --no-build-isolation -ve ./python/   # requires: pip install pybind11 scikit-build-core
# or, with build isolation (pulls build deps automatically):
pip install -ve ./python/

Usage (high-level API)

import numpy as np
from se3_lio import SE3LIO, SE3LIOConfig, load_node_params

config = SE3LIOConfig(downsample_resolution=0.5, max_iter=4, verbose=False)
odom = SE3LIO(config, lidar_extrinsic=np.eye(4))

# or load the ROS2 node's params.yaml (same mapping as lio_node.cpp):
params = load_node_params("pipelines/ros2/config/params.yaml")
odom = SE3LIO(params["config"], params["extrinsic"])

# points:      (N, 3) float xyz in the LiDAR frame
# point_times: (N,)   float per-point time offset from frame start [s]
# imu:         (M, 7) float rows of [t, ax, ay, az, gx, gy, gz]
state = odom.register_frame(points, point_times, imu, frame_stamp)
print(state.pose, state.vel, state.covariance)

register_frame mirrors the per-frame data path of the ROS2 node: it builds a synced measurement, applies the LiDAR extrinsic, sorts points by relative timestamp, and runs one estimatePose step. Set verbose=True to enable the core's per-frame stdout logging (off by default).

CLI pipeline

se3_lio_pipeline runs odometry over a rosbag and writes a TUM trajectory — the Python equivalent of the node, offline. The input format is auto-detected:

input format LiDAR reader
rosbag2 directory ROS2 Livox CustomMsg rosbag2_py
*.bag file ROS1 Ouster PointCloud2 rosbags
# ROS2 / Livox (rosbag2 directory)
se3_lio_pipeline <rosbag_dir> --params pipelines/ros2/config/params.yaml \
    --max-frames 300 --output results/

# ROS1 / Ouster (e.g. NTU VIRAL .bag)
se3_lio_pipeline eee_01.bag --params pipelines/ros1/config/ntu.yaml \
    --max-frames 1500 --output results/
# -> results/<bag>_se3lio.tum  + a summary (frames, path length, final pose)

Use --input-type ros2-livox|ros1-ouster to override auto-detection. It reads the bag, reproduces the node's conversion + synchronization (rosbag.py / ros1bag.py), and runs OdometryPipeline over the frames. Use the same pieces programmatically:

from se3_lio import load_node_params
from se3_lio.datasets import RosbagDataset
from se3_lio.pipeline import OdometryPipeline

p = load_node_params("pipelines/ros2/config/params.yaml")
dataset = RosbagDataset(bag_dir, p["imu_topic"], p["lidar_topic"], p["min_range"])
pipeline = OdometryPipeline(dataset, p["config"], p["extrinsic"]).run()
pipeline.save_tum("traj.tum")
print(pipeline.summary())

Visualization (Rerun)

se3_lio_pipeline accepts --rerun-save <path.rrd> (and --rerun-spawn to open the viewer live). Per frame the estimated pose, the scan transformed into the world frame, and the trajectory are logged; Rerun accumulates the world scans across the timeline, so playing it back shows the map being built.

pip install -e ./python/[viz]          # adds rerun-sdk
se3_lio_pipeline eee_01.bag --params pipelines/ros1/config/ntu.yaml \
    --max-frames 2500 --output results/ --rerun-save results/eee_01.rrd
rerun results/eee_01.rrd               # open the recording (match the rerun-sdk version)

The logger lives in se3_lio/viz/rerun_logger.py (lidar_to_world, RerunLogger, read_rrd_trajectory). tests/test_rerun_viz.py covers it (transform math + .rrd round-trip, runnable without the binding). Current logging uses the raw input scan; logging the undistorted + downsampled cloud needs exposing it from the core (planned next).

Raw binding

The _-prefixed names (se3_lio_pybind._SE3LIO, _SE3LIOConfig, _State) are the raw binding the high-level API is built on.

import numpy as np
from se3_lio import se3_lio_pybind as lio

config = lio._SE3LIOConfig()
config.downsample_resolution = 0.5
config.max_iter = 4

odom = lio._SE3LIO(config, np.eye(4))  # second arg: 4x4 LiDAR->body extrinsic

# points:      (N, 3) float64 xyz in the LiDAR frame
# point_times: (N,)   float64 per-point time offset from frame start [s]
# imu:         (M, 7) float64 rows of [t, ax, ay, az, gx, gy, gz]
state = odom._register_frame(points, point_times, imu, frame_stamp)

print(state.pose)        # 4x4 SE(3) pose
print(state.vel, state.bg, state.ba, state.grav)
print(state.covariance)  # 18x18

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

se3_lio-0.1.0.tar.gz (24.2 kB view details)

Uploaded Source

Built Distributions

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

se3_lio-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (458.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

se3_lio-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (457.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

se3_lio-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (456.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

se3_lio-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (456.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

se3_lio-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (456.5 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file se3_lio-0.1.0.tar.gz.

File metadata

  • Download URL: se3_lio-0.1.0.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for se3_lio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1945800a353ffb2046c7adee183514f8e3a12d8bce64f5b24041bc5c83d29272
MD5 9a4c0555ef7ef1a12879a3548c18ea7c
BLAKE2b-256 b08768a3aed124d08afcfb8cf3b2722fa6d1cfa33e9b18c6f10437167a371c1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for se3_lio-0.1.0.tar.gz:

Publisher: pypi.yml on url-kaist/se3-lio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file se3_lio-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for se3_lio-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a315f15c59fda30535e42c8d948e4295622c2cc94472e52a8bb35fa70a76798a
MD5 0cfb478fc0837db33a2e6526e47396d0
BLAKE2b-256 029a59ca1a6fb2eb8fb186f12e508ac045a839de200004babe1f2b643019cc96

See more details on using hashes here.

Provenance

The following attestation bundles were made for se3_lio-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on url-kaist/se3-lio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file se3_lio-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for se3_lio-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5d95eab62df1367664b128da5aa9d210de5910fdf1d773d9536f73d6dc1f89ec
MD5 5e383f9a5fbc0b626f0705450610754e
BLAKE2b-256 8ad4606bd0628ca03cfee42516518ec5ade1e23763b43738e76c37f95b600e9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for se3_lio-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on url-kaist/se3-lio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file se3_lio-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for se3_lio-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 32e53a4c13e5b981fb5caf84f7634581b6b28391b04a56e877bc9c602a45a409
MD5 6567ae64ae60494b2e9cfa8b3c444fbe
BLAKE2b-256 ee3a2a50cbd80372673070beba8870b9fc5a6e37352163a5a643c975f145c9b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for se3_lio-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on url-kaist/se3-lio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file se3_lio-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for se3_lio-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc59c645efd2def84a2c26979a233696530444ea520c3dd9909aad37d5bb6c24
MD5 fb48540e49b395b45821ba7217e731b9
BLAKE2b-256 d5924044d123307c0f7d284814cffebc7be827c6024c0f2a08b4254f5aed51d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for se3_lio-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on url-kaist/se3-lio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file se3_lio-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for se3_lio-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4770905e3950d78f9afa8768c32bcd3e58cbea6bd3ef13d886cf9412a777c62f
MD5 beb0e1e784afe479d5f2a2bd3fee025a
BLAKE2b-256 4db27165e1b41971fcf7d16405ea8c9568256407bf28429fb009b60830db0cbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for se3_lio-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on url-kaist/se3-lio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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