Coder Social home page Coder Social logo

limhyungtae / erasor Goto Github PK

View Code? Open in Web Editor NEW
408.0 7.0 75.0 43.18 MB

Official page of ERASOR (Egocentric Ratio of pSeudo Occupancy-based Dynamic Object Removal), which is accepted @ RA-L'21 with ICRA'21

License: GNU General Public License v3.0

CMake 0.96% C++ 47.99% Python 51.05%
lidar-point-cloud static-map-building lidar lidar-slam

erasor's Introduction

🌈 ERASOR (RA-L'21 with ICRA Option)

Official page of "ERASOR: Egocentric Ratio of Pseudo Occupancy-based Dynamic Object Removal for Static 3D Point Cloud Map Building", which is accepted by RA-L with ICRA'21 option [Video] [Preprint Paper]

overview

We provide all contents including

  • Source code of ERASOR
  • All outputs of the State-of-the-arts
  • Visualization
  • Calculation code of Preservation Rate/Rejection Rate

So enjoy our codes! :)

Contact: Hyungtae Lim (shapelimatkaistdotacdotkr)

Advisor: Hyun Myung (hmyungatkaistdotacdotkr)

NEWS (Recent update: Oct., 2021)

  • An example of running ERASOR in your own env. is provided.
    • Please refer to please refer to src/offline_map_updater/main_in_your_env.cpp and launch/run_erasor_in_your_env_vel16.launch. The more details are here.

Contents

  1. Test Env.
  2. Requirements
  3. How to Run ERASOR
  4. Calculate PR/RR
  5. Benchmark
  6. Visualization of All the State-of-the-arts
  7. ERASOR in the Wild
  8. Citation

Test Env.

The code is tested successfully at

  • Linux 18.04 LTS
  • ROS Melodic

Requirements

ROS Setting

  • Install ROS on a machine.
  • Also, jsk-visualization is required to visualize Scan Ratio Test (SRT) status.
sudo apt-get install ros-melodic-jsk-recognition
sudo apt-get install ros-melodic-jsk-common-msgs
sudo apt-get install ros-melodic-jsk-rviz-plugins

Build Our Package

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/LimHyungTae/ERASOR.git
cd .. && catkin build erasor 

Python Setting

  • Our metric calculation for PR/RR code is implemented by python2.7
  • To run the python code, following pakages are necessary: pypcd, tqdm, scikit-learn, and tabulate
pip install pypcd
pip install tqdm	
pip install scikit-learn
pip install tabulate

Prepared dataset

  • Download the preprocessed KITTI data encoded into rosbag.
  • The downloading process might take five minutes or so. All rosbags requires total 2.3G of storage space
wget https://urserver.kaist.ac.kr/publicdata/erasor/rosbag/00_4390_to_4530_w_interval_2_node.bag
wget https://urserver.kaist.ac.kr/publicdata/erasor/rosbag/01_150_to_250_w_interval_1_node.bag
wget https://urserver.kaist.ac.kr/publicdata/erasor/rosbag/02_860_to_950_w_interval_2_node.bag
wget https://urserver.kaist.ac.kr/publicdata/erasor/rosbag/05_2350_to_2670_w_interval_2_node.bag
wget https://urserver.kaist.ac.kr/publicdata/erasor/rosbag/07_630_to_820_w_interval_2_node.bag

Description of Preprocessed Rosbag Files

  • Please note that the rosbag consists of node. Refer to msg/node.msg.
  • Note that each label of the point is assigned in intensity for the sake of convenience.
  • And we set the following classes are dynamic classes:
# 252: "moving-car"
# 253: "moving-bicyclist"
# 254: "moving-person"
# 255: "moving-motorcyclist"
# 256: "moving-on-rails"
# 257: "moving-bus"
# 258: "moving-truck"
# 259: "moving-other-vehicle"
  • Please refer to std::vector<int> DYNAMIC_CLASSES in our code :).

How to Run ERASOR

We will explain how to run our code on seq 05 of the KITTI dataset as an example.

Step 1. Build naive map

kittimapgen

  • Set the following parameters in launch/mapgen.launch.
    • target_rosbag: The name of target rosbag, e.g. 05_2350_to_2670_w_interval_2_node.bag
    • save_path: The path where the naively accumulated map is saved.
  • Launch mapgen.launch and play corresponding rosbag on the other bash as follows:
roscore # (Optional)
roslaunch erasor mapgen.launch
rosbag play 05_2350_to_2670_w_interval_2_node.bag
  • Then, dense map and voxelized map are auto-saved at the save path. Note that the dense map is used for evaluation to fill corresponding labels. The voxelized map will be an input of step 2 as a naively accumulated map.

Step 2. Run ERASOR erasor

  • Set the following parameters in config/seq_05.yaml.

    • initial_map_path: The path of naively accumulated map
    • save_path: The path where the filtered static map is saved.
  • Run the following command for each bash.

roscore # (Optional)
roslaunch erasor run_erasor.launch target_seq:="05"
rosbag play 05_2350_to_2670_w_interval_2_node.bag

News (22.03.01): The submap module is employed to speed up when extracing map VOI.

Plase check the below rosparams in run_erasor.launch:

<rosparam param="/large_scale/is_large_scale">true</rosparam>
<rosparam param="/large_scale/submap_size">160.0</rosparam>

Note that appropriate submap_size is > 2 * max_range.

  • IMPORTANT: After finishing running ERASOR, run the following command to save the static map as a pcd file on another bash.
  • "0.2" denotes voxelization size.
rostopic pub /saveflag std_msgs/Float32 "data: 0.2"
  • Then, you can see the printed command as follows:

fig_command

  • The results will be saved under the save_path folder, i.e. $save_path$/05_result.pcd.

Calculate PR/RR

You can check our results directly.

  • First, download all pcd materials.
wget https://urserver.kaist.ac.kr/publicdata/erasor/erasor_paper_pcds.zip
unzip erasor_paper_pcds.zip

Then, run the analysis code as follows:

python analysis.py --gt $GT_PCD_PATH$ --est $EST_PCD_PATH$

E.g,

python analysis.py --gt /home/shapelim/erasor_paper_pcds/gt/05_voxel_0_2.pcd --est /home/shapelim/erasor_paper_pcds/estimate/05_ERASOR.pcd

NOTE: For estimating PR/RR, more dense pcd file, which is generated in the mapgen.launch procedure, is better to estimate PR/RR precisely.

Benchmark

  • Error metrics are a little bit different from those in the paper:

    Seq. PR [%] RR [%]
    00 91.72 97.00
    01 91.93 94.63
    02 81.08 99.11
    05 86.98 97.88
    07 92.00 98.33
  • But we provide all pcd files! Don't worry. See Visualization of All the State-of-the-arts Section.

Visualization of All the State-of-the-arts

  • First, download all pcd materials.
wget https://urserver.kaist.ac.kr/publicdata/erasor/erasor_paper_pcds.zip
unzip erasor_paper_pcds.zip
  • Set parameters in config/viz_params.yaml correctly

    • abs_dir: The absolute directory of pcd directory
    • seq: Target sequence (00, 01, 02, 05, or 07)
  • After setting the parameters, launch following command:

roslaunch erasor compare_results.launch

ERASOR in the Wild

In your own dataset

To check generalization of ERASOR, we tested ERASOR in more crowded environments. In that experiment, Velodyne Puck 16 was employed, and poses are estimated by LIO-SAM.

Satellite map Pcd map by LIO-SAM

When running ERASOR in your own environments, please refer to src/offline_map_updater/main_in_your_env.cpp file and launch/run_erasor_in_your_env_vel16.launch.

You can learn how to set experimental setting by repeating our pre-set configurations. Please follow our instructions.

  • First, download pre-set dataset.
wget https://urserver.kaist.ac.kr/publicdata/erasor/bongeunsa_dataset.zip
unzip bongeunsa_dataset.zip
  • Modify data_dir, MapUpdater/initial_map_path, and MapUpdater/save_path in config/your_own_env_vel16.yaml to be right directory for your machine, where data_dir should consist of following components as follows:
`data_dir`
_____pcds
     |___000000.pcd
     |___000001.pcd
     |___000002.pcd
     |...
_____dense_global_map.pcd
_____poses_lidar2body.csv
_____...
  • Next, launch launch/run_erasor_in_your_env_vel16.launch as follows:
roslaunch erasor run_erasor_in_your_env_vel16.launch

Results

Note: Setting appropriate parameters

  • As shown in config, depending on your own sensor configuration, parameters must be changed. In particular, min_h and max_h, and th_bin_max_h should be changed (note that min_h and max_h, and th_bin_max_h is w.r.t. your body frame of a query pcd file.)
  • If you use a low-channel LiDAR sensor such as Velodyne Puck-16, max_r and num_rings must be set as smaller values like config/your_own_env_vel16.yaml to guarantee the estimated normal vector for each bin is considered to be orthogonal to the ground.
  • If too many points are considered as ground points for each bin, then reduce the value of gf_dist_thr.

Citation

If you use our code or method in your work, please consider citing the following:

@article{lim2021erasor,
title={ERASOR: Egocentric Ratio of Pseudo Occupancy-Based Dynamic Object Removal for Static 3D Point Cloud Map Building},
author={Lim, Hyungtae and Hwang, Sungwon and Myung, Hyun},
journal={IEEE Robotics and Automation Letters},
volume={6},
number={2},
pages={2272--2279},
year={2021},
publisher={IEEE}
}

erasor's People

Contributors

chen-xieyuanli avatar kin-zhang avatar limhyungtae avatar urlkaist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

erasor's Issues

roslaunch erasor run_erasor.launch target_seq:="05"

When I run roslaunch erasor run_erasor.launch target_seq:="05", I encountered the following error, and my system is ubuntu20.04

roslaunch erasor run_erasor.launch target_seq:="05"
... logging to /home/doongli/.ros/log/195c78c0-504d-11ee-ba99-4f48c8864c97/roslaunch-doongli-Precision-5820-Tower-X-Series-990898.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/init.py", line 347, in main
p.start()
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/parent.py", line 305, in start
self._start_infrastructure()
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/parent.py", line 254, in _start_infrastructure
self._load_config()
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/parent.py", line 156, in _load_config
self.config = roslaunch.config.load_config_default(self.roslaunch_files, self.port,
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/config.py", line 461, in load_config_default
loader.load(f, config, argv=args, verbose=verbose)
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 763, in load
self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 735, in _load_launch
self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 665, in _recurse_load
if ifunless_test(self, tag, context):
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 74, in ifunless_test
if_val, unless_val = obj.opt_attrs(tag, context, ['if', 'unless'])
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 208, in opt_attrs
return [self.resolve_args(tag_value(tag,a), context) for a in attrs]
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 208, in
return [self.resolve_args(tag_value(tag,a), context) for a in attrs]
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 189, in resolve_args
return substitution_args.resolve_args(args, context=context.resolve_dict, resolve_anon=self.resolve_anon)
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/substitution_args.py", line 378, in resolve_args
return _eval(arg_str[7:-1], context)
File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/substitution_args.py", line 347, in _eval
return str(eval(s, {}, _DictWrapper(context['arg'], functions)))
File "", line 1
arg('target_seq') ==01
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

ERROR, when i run "roslaunch erasor run_erasor_in_your_env.launch"

main_in_your_env: /usr/include/eigen3/Eigen/src/Core/util/XprHelper.h:110: Eigen::internal::variable_if_dynamic<T, Value>::variable_if_dynamic(T) [with T = long int; int Value = 3]: Assertion v == T(Value)' failed.
[main_in_your_env-2] process has died [pid 32096, exit code -6, cmd /home/dt/ROS_WS/erasor_ws/devel/lib/erasor/main_in_your_env __name:=main_in_your_env __log:=/home/dt/.ros/log/5305fe14-348b-11ec-9ebf-081f7134fb94/main_in_your_env-2.log].
log file: /home/dt/.ros/log/5305fe14-348b-11ec-9ebf-081f7134fb94/main_in_your_env-2*.log`

how to run this on on single part in the whole map

hi , i recently tried your work and merged it to our work and it was excellent! thanks for your wonderful contribution to the dynamic objects removing! and i wonder if there is a way to just run your ERASOR to remove objects in just a part of a whole map bag, which means i don't have to run it on my whole map since it may inevitably delete some static pointcloud.
looking forward to your reply!

point color

Where can I view the colors displayed by various point clouds?

How to build a whole map

Hi ! This is such a nice work and thank you very much for your contribution ! My question is that how can I run the whole KITTI05 instead of a part of the dataset? I would be very grateful if you can give me some advice! Thank you for seeing my question!

Eigen::internal::variable_if_dynamic<T, Value>::variable_if_dynamic(T) [with T = long int; int Value = 3]: Assertion `v == T(Value)' failed.

main_in_your_env_ros: /usr/include/eigen3/Eigen/src/Core/util/XprHelper.h:110: Eigen::internal::variable_if_dynamic<T, Value>::variable_if_dynamic(T) [with T = long int; int Value = 3]: Assertion `v == T(Value)' failed.
[main_in_your_env_ros-1] process has died [pid 32655, exit code -6, cmd /home/dsj/catkin_erasor/devel/lib/erasor/main_in_your_env_ros __name:=main_in_your_env_ros __log:=/home/dsj/.ros/log/4f1bf28e-2dac-11ed-a109-d05099fb0c81/main_in_your_env_ros-1.log].
log file: /home/dsj/.ros/log/4f1bf28e-2dac-11ed-a109-d05099fb0c81/main_in_your_env_ros-1*.log

use HDL 32E Velodyne's data

Hi @LimHyungTae, thank you for your great work! I have one question. If i use Velodyne 32E's data, what parameters should be changed? The parameters of Lidar are below.
image

Assertion `cloud.points.size () == cloud.width * cloud.height' failed.

Hi @LimHyungTae ! Thank you for your excellent work. I ran the demo on my computer and the result looks great. However, when I tried ERASOR on my own dataset, I encountered the following error:

main_in_your_env: /usr/include/pcl-1.8/pcl/conversions.h:252: void pcl::toPCLPointCloud2(const pcl::PointCloud<PointT>&, pcl::PCLPointCloud2&) [with PointT = pcl::PointXYZI]: Assertion `cloud.points.size () == cloud.width * cloud.height' failed.

This happens on a specific frame. I checked the corresponding .pcd file but it looked alright. I also tried this suggestion but it did not work. Could you please give me some hints on how to solve this, thanks!

How to determine the size of the max_r parameter

Hi, I noticed that you set max_r as 10, but the range of velodyne_64e is 120m, will this result in a small erasoring range? I want to use different datasets, but I don't know how to set new parameters, could you give me some tips?
Thanks a lot!

Error when run 'roslaunch erasor run_erasor_in_your_env_vel16.launch'

[ INFO] [1668568723.312462663]: PASS!
[ INFO] [1668568723.411885393]: 1303th frame is comming
[ INFO] [1668568723.490956884]: 1014759=1014759| 138259 + 876500
[ INFO] [1668568723.607537384]: Extracting VoI takes 0.1828s
main_in_your_env_ros: /usr/include/pcl-1.8/pcl/conversions.h:252: void pcl::toPCLPointCloud2(const pcl::PointCloud&, pcl::PCLPointCloud2&) [with PointT = pcl::PointXYZI]: Assertion `cloud.points.size () == cloud.width * cloud.height' failed.

Calculate PR/RR

Dear Author,
I'm sorry to bother you, I have some questions about the calculation of pr/rr. I notice the gt pcd files in the erasor_paper_pcds are generated by your mapgen.cpp method, so when you generate the estimated maps by other methods such as Removert, did you take any steps such as ensuring the consistency of downsample_voxel_size to get more accurate results?
I'm waiting for your reply!
Best Wishes!

convert bag

How to convert the bag file recorded by myself into the bag file required by ERASOR?

Remove much more static points(false positive) than expectation

Hello, I'm sorry to bother you. I test your method in my own datasets, but I found the false positive points is very large. In the raw map, the stat. pts is 844762, and in the estimated map, the est.stat.pts is 475379, which leading the preservation rate is very low. Is it because of the parameter setting that causes this situation? How to deal with it?
I'm waiting for your reply!
Best!

roslaunch erasor run_erasor_in_your_env_vel16.launch

[main_in_your_env_ros-2] process has died [pid 7642, exit code -9, cmd /home/xxz/catkin_ws/devel/lib/erasor/main_in_your_env_ros __name:=main_in_your_env_ros __log:=/home/xxz/.ros/log/498c0ec0-3d92-11ee-a9fb-000c296bcaf2/main_in_your_env_ros-2.log].
log file: /home/xxz/.ros/log/498c0ec0-3d92-11ee-a9fb-000c296bcaf2/main_in_your_env_ros-2*.log

Hello, I meat some questions when I test on my data, how can i solve it ??

License info missing

The package.xml of this package has the default TODO entry for the license used, which makes it quite difficult use it in a legally consistent manner. Would be great if a valid license entry could be added.

save map error!!!

when running
roslaunch erasor mapgen.launch
rosbag play /home/mohamed/02_860_to_950_w_interval_2_node.bag

i got his error
terminate called after throwing an instance of 'pcl::IOException'
what(): : [pcl::PCDWriter::writeASCII] Could not open file for writing!
[kitti_mapgen-1] process has died [pid 91485, exit code -6, cmd /home/mohamed/catkin_ws/devel/lib/erasor/kitti_mapgen __name:=kitti_mapgen __log:=/home/mohamed/.ros/log/e74d25a6-5357-11ee-b334-557d0f89a6e3/kitti_mapgen-1.log].
log file: /home/mohamed/.ros/log/e74d25a6-5357-11ee-b334-557d0f89a6e3/kitti_mapgen-1*.log

how can be solved ??
thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.