Skip to content

Commit

Permalink
update the whole readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy-Zhang13798 committed Dec 22, 2023
1 parent ad70605 commit 4ec0a67
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 211 deletions.
146 changes: 98 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,115 @@
# signal-image-keypoints-odom
## WILL DO THE README UPDATE SOON
## Installation
# Signal-image-keypoints-odom


![Alt text](/imgs/Kiss_55_sup.png)

## Introduction
We present a novel approach to estimate the LiDAR-based odometry by using signal image keypoints.

Our work contributes in three main aspects:

* We conduct an extensive study of the optimal resolution and interpolation approaches for enhancing the low-resolution LiDAR-generated data to extract keypoints more effectively.

* We investigate the efficacy of the existing keypoint detectors and descriptors on LiDAR-generated images with multiple specialized metrics providing a quantitative evaluation.

For more details on these two aspects, please refer to this [folder](detector_descriptor_for_LiDARimg), which contains detailed introductions and experimental results.

* We propose a novel approach that leverages the detected keypoints and their neighbors to extract a reliable point cloud (downsampling) for the purpose of point cloud registration with reduced computational overhead and fewer deficiencies in valuable point acquisition.

For more details, please refer to our paper: [LiDAR-Generated Images Derived Keypoints Assisted Point Cloud Registration Scheme in Odometry Estimation](https://www.mdpi.com/2072-4292/15/20/5074).


## Repository Structure
- `detector_descriptor_for_LiDARimg`: The first two contributions of our work, firstly, we explore a preprocessing method for enhancing low-resolution LiDAR-generated data to extract keypoints more effectively. Second and more important, we assess the effectiveness of the current keypoint detectors and descriptors on LiDAR-generated images using multiple specialized metrics. Please refer to the more detailed [README](detector_descriptor_for_LiDARimg/README.md) inside the folder.
- `src`:
* signal-image-keypoints-odom: Source code of our new odometry approach.
* libs: libtorch--The C++ version for Pytorch.
* kiss-icp: The original kiss-icp (After you run 'git submodule update --init --recursive')
* cpu_monitor: A cpu monitor for monitoring the performance of our method. (After you run 'git submodule update --init --recursive')


- `scripts`: several python scripts to print out the CPU and memory usage of our method. you don't have to run them.


And the original rosbag dataset we used is available at the [University of Turku servers](https://utufi.sharepoint.com/:f:/s/msteams_0ed7e9/Etwsa7m8hxhMk9H3x-K6DfUBgU3x-ZK9vMeD_V0J2mdHwA).




## Run our code

### Clone our repo
```
git clone [email protected]:RealYXJ/ws-lidar-as-camera-odom.git
cd ws-lidar-as-camera-odom
git checkout optimize_code_zhz
git submodule update --init --recursive
```
### Update the submodules

Since we have use some submodules, so we need to update the submodules.
```
git submodule update --init --recursive
```

### Install libstorch

### Install Dependency
```
<!-- libtorch -->
cd ws-lidar-as-camera-odom/src/ && mkdir libs && cd libs
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.11.0%2Bcpu.zip
unzip libtorch-cxx11-abi-shared-with-deps-1.11.0+cpu.zip
rm libtorch-cxx11-abi-shared-with-deps-1.11.0+cpu.zip
```

Note: The lastest version will cause problems like unference to ros::init even though I have linked with `${catkin_LIBRARIES}`. Same problem has met by other people in https://github.com/pytorch/pytorch/issues/60178. I followed the solution provided by mmurooka commented on Nov 2, 2022 (https://github.com/mmurooka/SMPLpp/issues/1). Issue solved.

## Remember to check several files to make sure that we have the right absolute path

## cmake build oand run our project
```
cd ws-lidar-as-camera-odom/
catkin build
### Other requirements

The code has been tested on Ubuntu 20.04 with ROS Noetic. And we use the following common libraries. You can check the [CMakeLists.txt](src/signal-image-keypoints-odom/CMakeLists.txt) for more details.

* opencv
* pcl


### Make sure you have the right path


We found that there is a path in our code, it has to be the absolute path, so you need to change it to your own path.
This line of code is inside the [signal_image_keypoints_odom.hpp](src/signal-image-keypoints-odom/include/signal_image_keypoints_odom/signal_image_keypoints_odom.hpp) file.

Line 79:
```cpp
std::string weight_path_ = "/home/jimmy/Downloads/ws-lidar-as-camera-odom/src/signal-image-keypoints-odom/model/superpoint_v2.pt";
```


## Optimize step
### cmake build oand run our project
```
cd ws-lidar-as-camera-odom/
catkin build
source devel/setup.bash
```


Run the keypoint extractor ros node
### Run the keypoint extractor ros node
```
roslaunch signal-image-keypoints-odom signal-feature-odom.launch
```
Run the pointcloud matching approach for the odometry, or you can choose topic:=//os_cloud_node/points


### Run the pointcloud matching approach

Run the pointcloud matching approach for the odometry ( or you can choose topic:=//os_cloud_node/points, to try the kiss-icp with raw point cloud)

```
roslaunch kiss_icp odometry.launch topic:=/keypoint_point_cloud
```

Run CPU_monitor

### Run CPU_monitor
Run CPU_monitor (You don't have to run it, it's just for monitoring the CPU and memory usage of our method)
```
roslaunch cpu_monitor cpu_monitor.launch poll_period:=1
```
Expand All @@ -59,44 +120,33 @@ Run python scripts to show CPU and memory usage of our nodes, cpu_mem2.py will p
python cpu_mem2.py
```

Play the rosbag
### Play the rosbag

```
rosbag play [rosbag that you have]
```

### What I modified:
1. delele several useless variable and function inside the class
1. rearrange the class member,change the name of many function and variable, to make them more clear
2. inside pointCloudCallback function, can just use one line: pcl::fromROSMsg(*msg, *entirePointCloudPtr_);
3. unify the signalImageCallback and rangeImageCallback function, just use cv_bridge::toCvShare, no need to use cv_bridge::toCvCopy, because we always copy the variable inside the superpoint_timerCallback function
4. turn extract_neighbourhood into a class member function, so increase encapsulation
5. threshold inside the extract_neighbourhood, is weird, 300 will not work as we want, because the image range in between [0,1]
6. we can just use signal_mp.convertTo(signal_mp, CV_32F, 1.0 / 65535.0), it's more loseless compared to the previous one.
7. if (u>SH_ || v > SW_)....... these if situations will not happen, so we don't need them.
8. add cpu_monitor to submodule


### KISS-ICP with raw point cloud

![](./imgs/kiss-icp-raw.png)

### KISS-ICP with conventional keypoint extractors

![](./imgs/kiss-icp-a.png)

### KISS-ICP with the superpoint feature extractor




### KISS-ICP with raw point cloud

![](./imgs/kiss-icp-raw.png)
## Citation
If you find our work useful in your research, please consider citing:
```
@Article{rs15205074,
AUTHOR = {Zhang, Haizhou and Yu, Xianjia and Ha, Sier and Westerlund, Tomi},
TITLE = {LiDAR-Generated Images Derived Keypoints Assisted Point Cloud Registration Scheme in Odometry Estimation},
JOURNAL = {Remote Sensing},
VOLUME = {15},
YEAR = {2023},
NUMBER = {20},
ARTICLE-NUMBER = {5074},
URL = {https://www.mdpi.com/2072-4292/15/20/5074},
ISSN = {2072-4292},
DOI = {10.3390/rs15205074}
}
```

### KISS-ICP with conventional keypoint extractors
## License
Distributed under the MIT License. See LICENSE for more information.

![](./imgs/kiss-icp-a.png)
## Contact
For any queries regarding the code or the paper, please open an issue in this repository.

### KISS-ICP with the superpoint feature extractor

Empty file.
Binary file added imgs/Kiss_55_sup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/feature-lo-diagram_page-0001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed imgs/kiss-icp-a.png
Binary file not shown.
Binary file removed imgs/kiss-icp-raw.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/signal-image-keypoints-odom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ message(" libraries:" ${OpenCV_LIBS})
message(" include path:" ${OpenCV_INCLUDE_DIRS})

# find torch
set(CMAKE_PREFIX_PATH "/home/jimmy/Downloads/Performance_comparison/ws-lidar-as-camera-odom/src/libs/libtorch/share/cmake/Torch")
set(CMAKE_PREFIX_PATH "../libs/libtorch/share/cmake/Torch")
find_package(Torch REQUIRED)

# include pcl libraries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class lidarImageKeypointOdom



std::string weight_path_ = "/home/jimmy/Downloads/Performance_comparison/ws-lidar-as-camera-odom/src/signal-image-keypoints-odom/model/superpoint_v2.pt";
std::string weight_path_ = "/home/jimmy/Downloads/ws-lidar-as-camera-odom/src/signal-image-keypoints-odom/model/superpoint_v2.pt";
SPFrontend spfrontend_{weight_path_, 4, 0.015, 0.4};


Expand Down
42 changes: 0 additions & 42 deletions src/signal-image-keypoints-odom/src/superpoint/CMakeLists.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions src/signal-image-keypoints-odom/src/superpoint/test.cpp

This file was deleted.

0 comments on commit 4ec0a67

Please sign in to comment.