环境配置
项目地址:https://github.com/ianchen-tw/LabelFusion.git
该项目我使用的是nvidia-docker
在使用该项目前需要安装librealsense, realsense-ros, rgbd_ros_to_lcm, 以及lcm包
librealsense和realsense-ros的安装要注意版本的匹配,要不然编译过程会报错。我的环境版本librealsense v2.50.0,D455相机固件 5.13.0.50,realsense-ros v3.2.3。
librealsense安装说明:
https://github.com/IntelRealSense/librealsense
https://blog.csdn.net/chrisspf/article/details/122428884
realsense-ros安装说明:
https://github.com/IntelRealSense/realsense-ros
rgbd_ros_to_lcm安装说明:
cd ~/catkin_ws/src
git clone https://github.com/MobileManipulation/rgbd_ros_to_lcm.git
cd rgbd_ros_to_lcm
cd include
lcm-gen -x ../lcmtypes/*.lcm
cd ~/catkin_ws
catkin_make
lcm包的安装:
cd path/to/install
git clone https://github.com/lcm-proj/lcm.git
mkdir build && cd build
cmake ..
make -j4
sudo make install
创建、启动 docker
sudo ./LabelFusion/docker/docker_run.sh /path/to/data-folder
数据集可以选择下载小的那个:
完整数据集(500G):https://data.csail.mit.edu/labelfusion/LabelFusionExampleData/LabelFusion_public_full.tar.gz
部分数据集(5G):http://labelfusion.csail.mit.edu/data/LabelFusion_Sample_Data.tar
使用 Realsense 相机收集 raw data
修改lcm-logger收集数据的图像尺寸,在rgbd_ros_to_lcm文件夹下找到src/rgbd_ros_to_lcm/src/lcm_republisher.cpp。镜像中ElasticFusion的运行只能处理640*480的数据。
该文件夹下修改:
// if (enforce_resize_) {
if (1){
cv::Mat resized_rgb;
cv::Mat resized_depth;
// cv::resize(rgb, resized_rgb, cv::Size(resize_width_, resize_height_));
// cv::resize(depth, resized_depth, cv::Size(resize_width_, resize_height_));
cv::resize(rgb, resized_rgb, cv::Size(640, 480));
cv::resize(depth, resized_depth, cv::Size(640, 480));
publishLCM(timestamp, resized_rgb, resized_depth);
} else {
publishLCM(timestamp, rgb, depth);
}
启动四个终端分别运行一下命令:
roscore
roslaunch realsense2_camera rs_rgbd.launch
roslaunch rgbd_ros_to_lcm lcm_republisher.launch
数据文件夹下创建一个新的日志文件夹
cd /path/to/data-folder
lcm-logger
运行结束后会生成文件lcmlog.2020-*
数据收集好以后,重新编译下ElasticFusion,我的显卡是2070,算力值是75,cuda8并不兼容,所以就增加一个当前版本所能接受的最大算力值。在/root/ElasticFusion/Core/src/CMakeLists.txt文件中修改算力并重新编译:
set(CUDA_ARCH_BIN "30 35 50 52 61" CACHE STRING "Specify 'real' GPU arch to build binaries for, BIN(PTX) format is supported. Example: 1.3 2.1(1.3) or 13 21(13)")
set(CUDA_ARCH_PTX "61" CACHE STRING "Specify 'virtual' PTX arch to build PTX intermediate code for. Example: 1.0 1.2 or 10 12")
后面的操作就跟着项目说明就可以了:
https://github.com/ianchen-tw/LabelFusion