PRBonn / kiss-icp

A LiDAR odometry pipeline that just works
https://www.ipb.uni-bonn.de/wp-content/papercite-data/pdf/vizzo2023ral.pdf
MIT License
1.61k stars 322 forks source link

Help, where can I find documentation on how to use kiss-icp from a script, not from the command line? #308

Closed joostzaalberg closed 8 months ago

joostzaalberg commented 8 months ago

Hi!

First of all, thanks for all the great work that has been done developing the Kiss-ICP pipeline. So far, my registration has been done accurately and swiftly, so thanks a lot for that.

Last week I was able to to successfully run Kiss-ICP from the command line on my custom, nuScenes-based dataset. However, it would be very convenient to integrate Kiss-ICP from within a script. I have not found any documentation on how to run Kiss-ICP in a Python script. Have I missed it somewhere? Currently, I'm reading through the code (finding classes like OdometryPipeline), but it is not making me much wiser. Could someone maybe share some insights on how this can be used? Thanks! Best, Joost

joostzaalberg commented 8 months ago

Nevermind, it resolved itself. It took an hour to get what I needed, which are the homogeneous transformations for my dataset. I used the following code:

# kiss imports
from kiss_icp.datasets.generic import GenericDataset
from kiss_icp.pipeline import OdometryPipeline

# other imports
from pathlib import Path

# define path to folder with .obj files
data_dir = Path('code/pcl')

dataset = GenericDataset(data_dir)
kus = OdometryPipeline(dataset=dataset)

# Custom pipeline to homogeneous transformations:
kus._run_pipeline()
kus._run_evaluation()
poses = kus._calibrate_poses(kus.poses)

Although not documented, the code was written well enough to extract this info. Thanks!!