Giter VIP home page Giter VIP logo

densesurfelmapping's Introduction

DenseSurfelMapping

News: You can find the paper here. If the project helps you in your paper, PLEASE cite it.

News: we have updated VINS-Supported branch. The code is not fully checked after refactoring. If you encounted any problems, please let us know.

A depth map fusion method

This is a depth map fusion method following the ICRA 2019 submission Real-time Scalable Dense Surfel Mapping, Kaixuan Wang, Fei Gao, and Shaojie Shen.

Given a sequence of depth images, intensity images, and camera poses, the proposed methods can fuse them into a globally consistent model using surfel representation. The fusion method supports both ORB-SLAM2 and VINS-Mono (a little modification is required) so that you can use it in RGB-D, stereo, or visual-inertial cases according to your setups. We develop the method based on the motivation that the fusion method: (1) can support loop closure (so that it can be consistent with other state-of-the-art SLAM methods), (2) do not require much CPU/memory resources to reconstruct a fine model in real-time, (3) can be scaled to large environments. These requirements are of vital importance in robot navigation tasks that the robot can safly navigate in the environment with odometry-consistent dense maps.

An example to show the usage of the surfel mapping is shown below.

mapping example

Left is the overview of the environment, the middle is the reconstructed results (visualized as point clouds in rviz of ROS) of our method, and right is the result using OpenChisel. We use VINS-Mono to track the camera motion with loop closure, and MVDepthNet to estimate the depth maps. The black line is the path of the camera. In the reconstruction, loop closure is enabled to correct the detected drift. OpenChisel is a great project to reconstruct the environment using the truncated signed distance function (TSDF). However, as shown in the example, it is not suitable to be used with SLAM systems that have loop closure abilities.

The system can also be applied to the KITTI datasets in real-time with only CPU computation.

mapping example

The top row is the reconstruction using stereo cameras and the bottom row is the reconstruction using only the left camera. Details can be found in the paper.

A video can be used to illustrate the performance of the system and how we apply it into an autonomous navigation:

video

Software

The open-sourced surfel fusion system is used for reconstructing the KITTI dataset using ORB_SLAM2. For VINS-MONO, we are using it in a teach-and-repeat project and will opensource lately. This project consists of three parts: the surfel_fusion, a modified ORB_SLAM2, and a kitti publisher.

ORB_SLAM2

The ORB_SLAM2 is from the original one and is modified to publish necessary information. You may install the ORB_SLAM2 following the original instructions.

Surfel_fusion

Surfel_fusion can be installed in ros catkin workspace by

catkin_make

Kitti publisher

kitti publisher is a simple python warper to publish the Kitti dataset along with the pre-calculated depth maps (using PSMNet).

Data

Here, we provide sequence 00 from the kitti dataset so that you can easily run the code. You can download the dataset from this_link.

Run the code

If you have installed all three components from the software

  1. change line 23 in ./kitti_publisher/scripts/publisher.py according to your downloaded dataset path.

  2. change the path /home/wang/software/ORB_SLAM2/Vocabulary/ORBvoc.txt and /home/wang/software/ORB_SLAM2/Examples/Stereo/KITTI00-02.yaml in /ORB_SLAM2/orb_kitti_launch.sh according to your environment.

  3. open four terminal windows: run the ORB_SLAM2 by

./orb_kitti_launch.sh 

, run the surfel fusion by

roslaunch surfel_fusion kitti_orb.launch

, and run the kitti publisher by

rosrun kitti_publisher publisher.py

, and run the rviz by

rviz

(you can load the rviz_config.rviz in the project to load published messages).

  1. the kitti publisher will initialize a window and you can start the publisher by press any key on that window. Press Esc will quit the publisher.

Save the result

The code also supports saving the reconstructed model by changing line 22 in /surfel_fusion/launch/kitti_orb.launch. Just press crtl+c on surfel fusion will cause the software to save meshes into the defined the path and quit the process. You can view the saved mash using CloudCompare or other softwares.

densesurfelmapping's People

Contributors

wang-kx 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  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

densesurfelmapping's Issues

Enable Colorized pointcloud

Really appreciate your work on the Surfel-Fusion. It is not really an issue but is there a possible way that i can actually turn the plain/boring single colored pointcloud into something nicer like endowing the true color of the object to that point?

The question about vins-supported

I run vins-mono (not vins-fusion) with mynteye camera, and set estimate_extrinsic to 2 to calibrate the camera and imu. When I run roslaunch surfel_fusion fuse_depthnet.launch, the information is displayed as follows.
process[surfel_fusion-1]: started with pid [13628] Have the following settings: camera matrix: 358.474 0 388.407 0 359.527 254.769 0 0 1 fuse the distence between 0.500000 m and 3.000000 m. loop_path_input size: =30 poses_database size: =0 loop_path_input size: =31 poses_database size: =0 loop_path_input size: =32 poses_database size: =2 loop_path_input size: =33 poses_database size: =3 loop_path_input size: =34 poses_database size: =4
But when I run rostopic pub / surfel_cmd std_msgs/Int16 "data: 2" is used to end the map creation, the error shown below will appear.
loop_path_input size: =234 poses_database size: =204 [ WARN] [1596005843.725373460]: Surfel STOP! saving pointcloud ... terminate called after throwing an instance of 'pcl::IOException' what(): : [pcl::PCDWriter::writeASCII] Input point cloud has no data! [surfel_fusion-1] process has died [pid 13628, exit code -6, cmd /home/jgx/catkin_surfelmapping_vins/devel/lib/surfel_fusion/surfel_fusion ~grey_image:=/mynteye/left/image_raw ~depth:=/mynteye/depth/image_raw ~loop_path:=/pose_graph/pose_graph_path ~extrinsic_pose:=/vins_estimator/extrinsic __name:=surfel_fusion __log:=/home/jgx/.ros/log/5ea3157c-d168-11ea-b86a-983f9f190824/surfel_fusion-1.log]. log file: /home/jgx/.ros/log/5ea3157c-d168-11ea-b86a-983f9f190824/surfel_fusion-1*.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete done
My camera only has grayscale images and no color images. I don't know if this is the cause.could you help me solve this issue,thans very much.

surfel map

您好,运行kitti数据集时没有问题,换做自己的realsense d435i相机后,运行surfel map时,程序没有继续执行,一直显示:
begin new frame process!!!
warp the surfels according to the loop!
warp end! cost 0.000224 ms.

Some data

Hello, Dr. Wang, I saw on the author's Github of MMGCN that you reproduced the paper and raised some questions to the author at that time. Do you still have the data set of that paper?Can you share it with me?

problem when running on the ICL-NUIM dataset

Thank for your nice work!
I would like to reproduce the result on ICL-NUIM dataset of DSM in the paper.
I choose sequence living_room_traj0n_frei as test sequence. ORB-SLAM2 works well in RGBD mode, but surfel_fusion died.
the launch file is as follows:
image
After tracking the errors, I found that the position where the problem occured:
image
When fusing surfels, the variable sp_index sometimes is -1 which is out of range.
I'd like to know whether if it is normal that the superpixel index is -1 after superpixel segmentation in DSM. Or there exists some errors in my parameter setting?

The surfel fusion can not work when I use realsense D435

I changed the camera parameters and topic name to realsense in kitti_orb.launch. What I changed are as follows:

<launch>
  <node pkg="surfel_fusion" type="surfel_fusion" name="surfel_fusion" clear_params="true" output="screen">

    <!-- camera parameter -->
    <param name="cam_width" value="640" />
    <param name="cam_height" value="480" />

    <!--input image info-->
    <param name="cam_fx" value="614.4114379882812" />
    <param name="cam_cx" value="324.2138671875" />
    <param name="cam_fy" value="614.7125244140625" />
    <param name="cam_cy" value="236.86329650878906" />

    <!-- fusion parameter, all in meter -->
    <param name="fuse_far_distence" value="30.0" />
    <param name="fuse_near_distence" value="0.5" />

    <!-- for deform the map -->
    <param name="drift_free_poses" value="30" />

    <!-- for data save -->
    <!-- <param name="save_name" value="/home/wangxinxin/bag/surfel_fusion/results/rgbd/realsense_loop" /> -->

    <remap from="~image" to="/camera/color/image_raw" />
    <remap from="~depth" to="/camera/depth/image_rect_raw" />
    <remap from="~loop_path" to="/orb_slam/path" />
    <remap from="~this_pose" to="/orb_slam/pose" />
    <remap from="~loop_stamps" to="/orb_slam/loop" />
  </node>
</launch>

But surfel fusion can not work as follow:

Screenshot from 2020-06-28 17-29-56

When I use kitti which you used, it will be ok. Such as follow:

Screenshot from 2020-06-21 13-53-35

I don't kown why the phenomenon will occure, can you help me?

rviz always crashes

Hello, rviz always crashes when I load rviz_config.rviz in the last step. Why is this?

About "Surfel_fusion" and "Kitti publisher"

Hello, recently read your article, and very interested in your research, but I encountered some difficulties in installing your code, need your help!
Now I have installed orb according to your steps_ Slam2, but according to your tips, I don't know how to install "Surfel_fusion" and "Kitti publisher", can you give me some more detailed tips or can someone else help me? I will thank you very much.

我不想让图片随镜头动

您好,我运行这个程序的时候,弹出来的小窗里会显示出surfel,但是我不想让他跟随我的镜头,我该怎么将他固定在原点呢?就是我想看全貌图

Source Code

Now being the paper been accepted, will it be possible for you to share the source code?

VINS-MONO for DenseSurfelMapping is open?

I have tested the DenseSurfelMapping. I think it is very good. I have read this sentence " For VINS-MONO, we are using it in a teach-and-repeat project and will opensource lately". Do you have opened the source of VINS-MONO for DenseSurfelMapping for open source community?
Thank you very much

vins-supported map save?

Hi,thank you for your work! However,the code of vins-supported seem can't save the map.What do I need to do to save the map?

Thank you!

Personal configuration

hi, Mr.wang. would you please give me some advice about why The map is so sparse when VO provided by VINS-FUSION compare with ORB-SLAM. As shown follow:(white:VINS-fusion for VO&&"DenseSurfelMapping-VINS-supported" for mapping. color:ORB-SLAM for VO&&"DenseSurfelMapping-master" for mapping)looking forward for your reply! Thank u!
Screenshot from 2020-06-05 10-35-00

about depth scale

hi thanks for releasing your wonderful work! the depth map come from PSMnet as mentioned in introduction page. I wonder have you ever post-processed the depth of PSMnet such as re-scale or you just directly take the output of PSMnet as depth.

Question about dataset of DenseSurfelMapping

Your work is great and I would like to learn it. But when downloading the KITTI dataset you gave it shows that the link does not exist. Is this dataset different from the KITTI official website? There are only stereo images on the official website. The KITTI connection you gave should contain depth values, right? Could you please send me a copy, thanks!

Compilation problem with kitti_publisher

Hello, when I catkin_make kitti_publisher, the following error occurred
Could not find a package configuration file provided by "depthnet_msgs"
   With any of the following names:

     depthnet_msgsConfig.cmake
     Depthnet_msgs-config.cmake
What is going on with this?

Only having revisiting makes Vins-supported mapping work

Dear author @WANG-KX,

Thanks for your this open-source code. Great work!
I noticed that in your ORB-supported implementation, map could be built without revisiting.

However, in your Vins-supported implementation, map could be built only after having some revisiting. If no revisiting is done, nothing will be saved in the map.

I am wondering what could be the reason and is there any possibility to save the map in Vins-supported without revisiting (of course revisiting could eliminate the mapping error)? Can you give me some hints on this point? Thanks!

Some issue about sync topics

Hi, when I try this code on my own device (d435i), I met this problem. The depth msg cannot be received by surfel_fusion. I think the sync policy has some bug. Thanks very much.
Screenshot from 2019-09-03 17-20-08

文章下载

你好,我想问一下,Real-time Scalable Dense Surfel Mapping这篇文章在哪儿能下载到?

vins-supported bug

感谢开源这么好的DenseSurfelMapping,在fusion_functions.cpp第208行
if (reference_frame_index - local_surfels[i].last_update >10 && local_surfels[i].update_times < 6)
其中10应为从launch文件中读取的drift_free_poses,不然保存的mesh有问题,谢谢!

Add License.txt

README.md specifies that this project is "open source". Is there a license that can be added to the repository?

Have trouble in rviz the real-time map

Thanks for sharing the mapping tool!
While I ran the Kitti00 dataset, it seemed like that the surfel-mapping thread worked normally, and I could observe colorful surfels in the debug-show window as shown in Fig 1. But when I turned on the Rviz launch file, some troubles was met.
Firstly the rivz file can not be read properly as I ran "rosrun rviz rviz path-to-rviz-file" in Fig 2 and 3, and the pointclouds were all colorful whether active or inactive (which should be gray as I watched other issues or the youtube video uploaded), finally the view point did not follow the camera motion. As I was not familar with the rviz options, would you plz share the right way to launch rviz?

2020-01-14 14-47-51屏幕截图
2020-01-14 14-47-26屏幕截图
2020-01-14 14-46-19屏幕截图

NO superpixel norm

Thank you for your work,and release it. When i use ORB_slam2 model RGBd
to run Kitti dataset, sequence 00, there is no problem. And i can get the ideal result. But i processing our outdoor road data, it don't extract the super pixels, and don't generate the point cloud. I don't know which problem it is. Can you help me to solve it? I am looking forward your reply!!! Thank you!

2020-07-28 18-15-46屏幕截图

2020-07-28 18-15-56屏幕截图

2020-07-28 18-25-42屏幕截图

2020-07-28 18-13-03屏幕截图

the problem about using my own camera for reconstruction

Thank you for your excellent work. When I use DenseSurfelMapping, I use VINS-Fusion, and the camera uses Realsense D435i, but when I use it, DenseSurfelMapping does not work. There is no information when I open spImage in rviz. Do I need to synchronize the posture information with the image and depth map in the DenseSurfelMapping code before fusing it? If so, how should it be synchronized?
Thanks again for your work!

terminate called after throwing an instance of 'std::bad_alloc'

when I running
roslaunch surfel_fusion vins_realsense.launch

and mapping 3d map
after a time while,
the terminal shows 👍

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
[surfel_fusion-1] process has died [pid 24384, exit code -6, cmd /home/dell/denseSurfel_vino_supptorted_src/devel/lib/surfel_fusion/surfel_fusion ~image:=/camera/color/image_raw ~depth:=/cam

Run with RGB-D dataset

The work is excellent! Can you give some guides about run with RDB-D data such as TUM or ICL-NIUM?

Uneven results for Reconstruction

The reconstruction rsult is quiet uneven.As shown after,a small part of the provided dataset is much better than others.
细节
I'm curious why.

vins版本,同时运行vins_mono和DenseSurfelMapping的时候效果很差

当我单独运行vins_mono的时候vins的效果是正常的,但是当我把vins_mono和surfelMapping同时开启的时候效果非常的差。vins几乎失效了,vins很难进行初始化,即使初始化成功后很快也会失效需要重新初始化。两者同时开启后vins计算不出我行走的轨迹,rviz中的摄像头模型基本就在原点附近飘动。

一开始我怀疑是我的电脑配置的问题,我把vins和surfelMapping分开到两台电脑中运行。一台电脑单独运行vins的时候是没问题的,当另一台电脑开启了surfelMapping订阅vins发出的话题时效果和我前面说的一样vins的效果变得了很差,几乎无法使用了。

ERROR: cannot launch node of type [surfel_fusion/surfel_fusion]: Cannot locate node of type [surfel_fusion] in package [surfel_fusion]. Make sure file exists in package path and permission is set to executable (chmod +x)

Hi,

When I try to run

ROS_PACKAGE_PATH="${ROS_PACKAGE_PATH}:$(pwd)/surfel_fusion" \
 roslaunch surfel_fusion kitti_orb.launch

Some of it starts, but not all:

...
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.

started roslaunch server http://localhost:45161/

SUMMARY
========

CLEAR PARAMETERS
 * /surfel_fusion/

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.4
 * /surfel_fusion/cam_cx: 607.1928
 * /surfel_fusion/cam_cy: 185.2157
 * /surfel_fusion/cam_fx: 718.856
 * /surfel_fusion/cam_fy: 718.856
 * /surfel_fusion/cam_height: 376
 * /surfel_fusion/cam_width: 1241
 * /surfel_fusion/drift_free_poses: 10
 * /surfel_fusion/fuse_far_distence: 30.0
 * /surfel_fusion/fuse_near_distence: 0.5

NODES
  /
    surfel_fusion (surfel_fusion/surfel_fusion)

auto-starting new master
process[master]: started with pid [400]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to d5f8dab8-6ec0-11ea-a215-0242c0a80002
process[rosout-1]: started with pid [411]
started core service [/rosout]
ERROR: cannot launch node of type [surfel_fusion/surfel_fusion]: Cannot locate node of type [surfel_fusion] in package [surfel_fusion]. Make sure file exists in package path and permission is set to executable (chmod +x)

any hints on how to make it work?

Thanks a lot,
Aron

problem in Surfel_fusion

After running the code, i encountered two problems in Surfel_fusion。The first one is process has died [pid xxx, exit code -11, cmd ...]. Another is Surfel_fusion sometimes can not receive the pose of ORB_SLAM2. Thanks for the reply!

Can not open ,ply file

When I run this code on my computer, the generated ply file cannot be opened normally, cloudcompare and meshlab are not working, how can I solve this problem?

Error in CloudCompare:
[PLY]'Unexpected end of File'
[PLY]'Error reading 'x' of 'vertex' number '1919032'
An error occurred while loading 'resule_00_mesh': the thirdparty library in charge of saving/loading the file has failed to perform the operation.

Error in MeshLab:
Error : Unespected eof

Map accuracy evaluation tool

Hi,
This really is very amazing work,it's practical in engineering.
en, I want to know the evaluation tool of Map accuracy and Visualization Tools,to test my own data.
image

Get a global consistent point cloud

Thanks for your work!
I try to use the VIN-supported branch but I met some problems.
The following picture is just used to show what my dataset looks like
2989 023949
There is a table and there is some stuff on that table, the camera will move around the table and keep filming the table. I publish the raw point cloud to rviz. The topic is surfel_fusion/raw_pointcloud as shown in your code。
gif_raw
You can see the desk is moving. But the problem is that the desk should not move. The camera is moving but the scene should standstill.
If I don't publish the raw point cloud and publish the point cloud(pointcloud_noceil) instead I'll end up with a point cloud looks like the following in rviz
gif_postprocess
Sorry maybe you cannot see it very clearly but you focus on the moving part of the point cloud you can still see there is a round table that is moving.
What I hope is the table remain still, the scene may extend as the camera moves. Now the table seems to move along with the camera.

The rosbag's topic is

topics:    /depth         1169 msgs    : sensor_msgs/Image        
             /groundtruth   3003 msgs    : geometry_msgs/PoseStamped
             /image0        1169 msgs    : sensor_msgs/Image             
             /imu0          9069 msgs    : sensor_msgs/Imu

The depth is strictly align with the image0.
I modify your surfel_fusion launch file to (ignore the camera intrinsics setting)

...
    <remap from="~image" to="/image0" />
    <remap from="~depth" to="/depth" />
   <remap from="~loop_path" to="/vins_estimator/path" />
   <remap from="~extrinsic_pose" to="/vins_estimator/extrinsic" />

I play the rosbag, VINS-Mono will subscribe to image0, imu0 to generate the camera's motion. Your package will subscribe to image0, depth directly from rosbag and /vins_estimator/path, /vins_estimator/extrinsic generated by VINS. Correct me if my operation is wrong.
The VINS itself can give me pretty good pose estimation. I have compared it with the ground truth.

can not download data

Hello, can you provide the baidu cloud disk link of the dataset sequence 00?
I can not download the data from the link you provided.

能否离线建图?

您好
请问能不能直接根据已有的位姿,以及RGBD图像来建图呢?
如果能,那我需要对哪里进行修改呢?

Having trouble running TUM dataset

I want to run program on an indoor dataset to observe the result of the reconstruction. I modify the camera Intrinsic in the launch file for node surfer_fusion, and rewrite the node that sends the picture like this:
depth = cv::imread(PATH+s1, -1);
left = cv::imread(PATH+s2,-1);
cvtColor( left, left, CV_BGR2GRAY );
depth.convertTo(depth,CV_32F);
sensor_msgs::ImagePtr msg_1 = cv_bridge::CvImage(std_msgs::Header(), "mono8", left).toImageMsg();
sensor_msgs::ImagePtr msg_2 = cv_bridge::CvImage(std_msgs::Header(), "32FC1", depth).toImageMsg();
ORB-SLAM2 runs well as usual,but surfer_fusion cannot create any surfel,is there other part of the program that should be modified?
image

Do we have to transform the pose as KITTI dataset if we use poses from other SLAM system?

Hi, Wang, I found that there is a transform dedicated for kitti. Is it needed for every SLAM system? Can I delete it?

static Eigen::Matrix4d transform_kitti;
{
Eigen::Matrix4d received_pose;
pose_ros2eigen(input_pose, received_pose);
if(poses_database.size() == 0)
{
Eigen::Matrix4d idea_pose;
idea_pose = Eigen::Matrix4d::Zero();
idea_pose(0,0) = 1.0;
idea_pose(1,2) = 1.0;
idea_pose(2,1) = -1.0;
idea_pose(3,3) = 1.0;
transform_kitti = idea_pose * received_pose.inverse();
}
Eigen::Matrix4d transformed_pose;
transformed_pose = transform_kitti * received_pose;
pose_eigen2ros(transformed_pose, input_pose);
}
transform end

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.