Docker: added new "latest" version of jfr2018 image (including VINS and latest rtabmap version). Updated jfr2018 scripts to easily switch to host installed rtabmap instead of docker

This commit is contained in:
matlabbe
2019-03-20 19:36:56 -04:00
parent 24a4d91ee8
commit 3cafdf911b
7 changed files with 338 additions and 42 deletions

View File

@@ -123,7 +123,7 @@ public:
} }
else else
{ {
cam0cam1 = model.stereoTransform(); cam0cam1 = model.stereoTransform().inverse();
} }
UASSERT(!cam0cam1.isNull()); UASSERT(!cam0cam1.isNull());
Transform imuCam1 = imuCam0 * cam0cam1; Transform imuCam1 = imuCam0 * cam0cam1;

View File

@@ -31,6 +31,8 @@ run_euroc_datasets.sh
run_tum_datasets.sh run_tum_datasets.sh
``` ```
For TUM dataset, use this script [associate.py](https://gist.github.com/matlabbe/484134a2d9da8ad425362c6669824798) to synchronize RGB and epth images before processing. Usage in a TUM dataset: `python associate.py rgb.txt depth.txt`, this will create `rgb_sync` and `depth_sync` folders.
Process all datasets, results will be written to subfolders `results/euroc`, `results/kitti` and `results/tum`: Process all datasets, results will be written to subfolders `results/euroc`, `results/kitti` and `results/tum`:
```bash ```bash
./run_all.sh ./run_all.sh

View File

@@ -0,0 +1,233 @@
# Image: introlab3it/rtabmap:jfr2018
FROM ubuntu:16.04
WORKDIR /root/
# Install build dependencies
RUN apt-get update && apt-get install -y \
libsqlite3-dev \
libpcl-dev \
git \
cmake \
libproj-dev \
libqt5svg5-dev \
libfreenect-dev \
libopenni2-dev \
libyaml-cpp-dev \
software-properties-common \
libgtk2.0-dev \
pkg-config
# OpenCV (use version <= 3.1.0 for rtabmap 0.16.3 for a solvePnpRansac issue where we have worst ransac performance on newer opencv versions)
RUN git clone https://github.com/opencv/opencv_contrib.git
RUN git clone https://github.com/opencv/opencv.git
RUN cd opencv_contrib && \
git checkout tags/3.1.0 && \
cd && \
cd opencv && \
git checkout tags/3.1.0 && \
mkdir build && \
cd build && \
cmake -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF .. && \
make -j4 && \
make install && \
cd && \
rm -rf opencv opencv_contrib
# Install ROS to build other odometry approaches (depending on ROS)
# install packages
RUN apt-get update && apt-get install -q -y \
dirmngr \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116
# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list
# install bootstrap tools
RUN apt-get update && apt-get install --no-install-recommends -y \
python-rosdep \
python-rosinstall \
python-vcstools \
&& rm -rf /var/lib/apt/lists/*
# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# bootstrap rosdep
RUN rosdep init \
&& rosdep update
# install ros packages
ENV ROS_DISTRO kinetic
RUN apt-get update && apt-get install -y \
ros-${ROS_DISTRO}-ros-core=1.3.2-0* \
&& rm -rf /var/lib/apt/lists/*
# install ROS dependencies
RUN apt-get update && apt-get install -y ros-${ROS_DISTRO}-tf ros-${ROS_DISTRO}-pcl-ros ros-${ROS_DISTRO}-eigen-conversions ros-${ROS_DISTRO}-tf-conversions ros-${ROS_DISTRO}-random-numbers ros-${ROS_DISTRO}-image-transport libblas-dev liblapack-dev libsuitesparse-dev libvtk6.2 libyaml-cpp-dev wget libgoogle-glog-dev libatlas-base-dev ros-${ROS_DISTRO}-sophus ros-${ROS_DISTRO}-octomap libglew-dev
# g2o should be built to link on csparse installed system-wide
RUN git clone https://github.com/RainerKuemmerle/g2o.git
RUN cd g2o && \
git checkout 20170730_git && \
mkdir build && \
cd build && \
cmake -DBUILD_LGPL_SHARED_LIBS=ON -DG2O_BUILD_APPS=OFF -DBUILD_WITH_MARCH_NATIVE=OFF -DG2O_BUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r g2o
# GTSAM
RUN git clone https://bitbucket.org/gtborg/gtsam.git
RUN cd gtsam && \
git checkout 4.0.0-alpha2 && \
mkdir build && \
cd build && \
cmake -DMETIS_SHARED=ON -DGTSAM_BUILD_STATIC_LIBRARY=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r gtsam
# libpointmatcher
RUN git clone https://github.com/ethz-asl/libnabo.git
#commit Apr 25 2018
RUN cd libnabo && \
git checkout 7e378f6765393462357b8b74d8dc8c5554542ae6 && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r libnabo
RUN git clone https://github.com/ethz-asl/libpointmatcher.git
#commit Jan 19 2018
RUN cd libpointmatcher && \
git checkout 00004bd41e44a1cf8de24ad87e4914760717cbcc && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r libpointmatcher
# Clone dependencies
RUN mkdir -p catkin_ws/src
WORKDIR /root/catkin_ws/src
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; catkin_init_workspace'
# OPENCV ROS
RUN git clone https://github.com/ros-perception/vision_opencv.git && cd vision_opencv && git checkout kinetic
# DVO
RUN git clone https://github.com/tum-vision/dvo_slam.git && cd dvo_slam && git checkout ${ROS_DISTRO}-devel && rm dvo_slam/package.xml && rm dvo_benchmark/package.xml && rm dvo_ros/package.xml
# VISO2
RUN git clone https://github.com/srv/viso2.git && cd viso2 && git checkout ${ROS_DISTRO}
# MSCKF-VIO
RUN git clone https://github.com/KumarRobotics/msckf_vio.git && cd msckf_vio && git checkout a9386c5 && wget https://gist.githubusercontent.com/matlabbe/f2518d7427e7f6740af2110e540b1f2b/raw/900a76b0a6741e172e76722e07c0aae50d3b94f3/msckf_vio_a9386c5_ros_commented.patch && git apply --ignore-space-change --ignore-whitespace msckf_vio_a9386c5_ros_commented.patch
# FOVIS
RUN git clone https://github.com/srv/libfovis.git && cd libfovis && git checkout 896acc8425e9fd7c5609153b8bad349ae1abbb50
# LOAM
RUN git clone https://github.com/laboshinl/loam_velodyne.git && cd loam_velodyne && git checkout a4c364a677647f2a35831439032dc5a58378b3fd
# VINS-Fusion
RUN git clone https://github.com/HKUST-Aerial-Robotics/VINS-Fusion.git && cd VINS-Fusion && git checkout e72b5f7ae7437e8cf481cc0bcbfb5fe91bd3d640 && wget https://gist.githubusercontent.com/matlabbe/795ab37067367dca58bbadd8201d986c/raw/0657cc30fca6b1b61faeef42be9f3428861d2598/vins-fusion_e72b5f7.patch && git apply --ignore-space-change --ignore-whitespace vins-fusion_e72b5f7.patch
WORKDIR /root
# OKVIS
RUN git clone https://github.com/ethz-asl/okvis.git && cd okvis && git checkout 1dce9129f22dd4d21d944788cd9da3a4341586aa && wget https://gist.githubusercontent.com/matlabbe/383be55b5cb682fea217d45ef9a37ef8/raw/bd4f6886eeba3800f0e5171e77abc5dd6dc8bfd9/okvis_1dce912_marchnative_disabled.patch && git apply --ignore-space-change --ignore-whitespace okvis_1dce912_marchnative_disabled.patch
# ORB_SLAM2
RUN git clone https://github.com/stevenlovegrove/Pangolin.git
RUN git clone https://github.com/raulmur/ORB_SLAM2.git && cd ORB_SLAM2 && wget https://gist.githubusercontent.com/matlabbe/c10403c5d44af85cc3585c0e1c601a60/raw/48adf04098960d86ddf225f1a8c68af87bfcf56e/orbslam2_f2e6f51_marchnative_disabled.patch && git apply --ignore-space-change --ignore-whitespace orbslam2_f2e6f51_marchnative_disabled.patch
RUN git clone https://github.com/introlab/rtabmap.git
# for dvo, TBB is required (docker related issue)
# Download and install TBB
ENV TBB_RELEASE 2018_U2
ENV TBB_VERSION 2018_20171205
ENV TBB_DOWNLOAD_URL https://github.com/01org/tbb/releases/download/${TBB_RELEASE}/tbb${TBB_VERSION}oss_lin.tgz
ENV TBB_INSTALL_DIR /opt
RUN wget ${TBB_DOWNLOAD_URL} && \
tar -C ${TBB_INSTALL_DIR} -xf tbb${TBB_VERSION}oss_lin.tgz && \
rm tbb${TBB_VERSION}oss_lin.tgz && \
sed -i "s%SUBSTITUTE_INSTALL_DIR_HERE%${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss%" ${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss/bin/tbbvars.* && \
echo "source ${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss/bin/tbbvars.sh intel64" >> ~/.bashrc
RUN cd okvis && \
mkdir build && \
cd build && \
cmake .. && \
make -j3 && \
make install && \
mkdir -p /usr/local/lib/cmake && \
mv /usr/local/lib/CMake/* /usr/local/lib/cmake/.
# Pangolin needed for ORB_SLAM2
RUN cd Pangolin && \
mkdir build && \
cd build && \
cmake .. && \
make -j3 && \
make install && \
cd && \
rm -rf Pangolin
RUN cd ORB_SLAM2 && \
cd Thirdparty/DBoW2 && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j3 && \
rm -rf * && \
cd ../../g2o && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j3 && \
rm -rf * && \
cd ../../../ && \
cd Vocabulary && \
tar -xf ORBvoc.txt.tar.gz && \
cd .. && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j3 && \
rm -rf *
RUN mv okvis/config/config_fpga_p2_euroc.yaml .
RUN mv ORB_SLAM2/Vocabulary/ORBvoc.txt .
RUN cp catkin_ws/src/VINS-Fusion/config/euroc/* .
RUN cp catkin_ws/src/VINS-Fusion/config/kitti_odom/* .
# Catkin_make
WORKDIR /root/catkin_ws
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash;. ${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss/bin/tbbvars.sh intel64; catkin_make -j3 -DCMAKE_BUILD_TYPE=Release; rm -rf build;'
RUN echo "source /root/catkin_ws/devel/setup.bash" >> ~/.bashrc
ENV LD_LIBRARY_PATH /opt/tbb2018_20171205oss/lib/intel64/gcc4.7:/root/ORB_SLAM2/lib:/root/ORB_SLAM2/Thirdparty/g2o/lib:/root/ORB_SLAM2/Thirdparty/DBoW2/lib:/root/catkin_ws/devel/lib:/opt/ros/${ROS_DISTRO}/lib:$LD_LIBRARY_PATH
ENV PATH /root/catkin_ws/devel/bin:/opt/ros/${ROS_DISTRO}/bin:$PATH
ENV ORB_SLAM2_ROOT_DIR /root/ORB_SLAM2
WORKDIR /root
# Build RTAB-Map (using standard g2o, then a version for orbslam2, which uses its own g2o version)
RUN cp -r rtabmap rtabmap_os2 && cp -r rtabmap rtabmap_msckf && cp -r rtabmap rtabmap_loam
RUN /bin/bash -c '. /root/catkin_ws/devel/setup.bash; cd rtabmap ; cd build ; cmake -DWITH_G2O=ON .. ; make -j3 ; make install ; rm -rf * ; ldconfig'
# Version with orb_slam2 (system g2o disabled)
RUN /bin/bash -c '. /root/catkin_ws/devel/setup.bash; cd rtabmap_os2 ; cd build ; cmake -DWITH_G2O=OFF .. ; make -j3 ; rm -rf *'
# rtabmap is crashing if LOAM and MSCKF dependencies are used at the same time, so split them
RUN /bin/bash -c '. /root/catkin_ws/devel/setup.bash; cd rtabmap_loam ;cd build ;cmake -DWITH_MSCKF_VIO=OFF -DWITH_LOAM=ON -DWITH_G2O=ON -DWITH_FOVIS=OFF -DWITH_DVO=OFF -DWITH_OKVIS=OFF -DWITH_VINS=OFF -DWITH_VISO2=OFF .. ;make -j3 ;rm -rf *'
RUN /bin/bash -c '. /root/catkin_ws/devel/setup.bash; cd rtabmap_msckf ;cd build ;cmake -DWITH_MSCKF_VIO=ON -DWITH_LOAM=OFF -DWITH_G2O=ON -DWITH_FOVIS=OFF -DWITH_DVO=OFF -DWITH_OKVIS=OFF -DWITH_VINS=OFF -DWITH_VISO2=OFF .. ;make -j3 ;rm -rf *'
WORKDIR /root

View File

@@ -1,8 +1,16 @@
#!/bin/bash #!/bin/bash
PWD=$(pwd) PWD=$(pwd)
DATASET_ROOT_PATH='/root/datasets/euroc' DOCKER=1 # set to 0 to use host rtabmap tool and relative datasets to this script
EUROC_RESULTS_PATH='/root/results/euroc'
DATASET_ROOT_PATH='./datasets/euroc'
EUROC_RESULTS_PATH='./results/euroc'
mkdir -p $EUROC_RESULTS_PATH
if [ $DOCKER -eq 1 ]
then
DATASET_ROOT_PATH='/root/datasets/euroc'
EUROC_RESULTS_PATH='/root/results/euroc'
fi
LIST=( 'V1_01_easy' 'V1_02_medium' 'V1_03_difficult' 'V2_01_easy' 'V2_02_medium' 'V2_03_difficult' 'MH_01_easy' 'MH_02_easy' 'MH_03_medium' 'MH_04_difficult' 'MH_05_difficult') LIST=( 'V1_01_easy' 'V1_02_medium' 'V1_03_difficult' 'V2_01_easy' 'V2_02_medium' 'V2_03_difficult' 'MH_01_easy' 'MH_02_easy' 'MH_03_medium' 'MH_04_difficult' 'MH_05_difficult')
@@ -47,7 +55,7 @@ fi
if [ $STRATEGY -eq 66 ] # okvis raw images if [ $STRATEGY -eq 66 ] # okvis raw images
then then
STRATEGY=6 STRATEGY=6
F2F_params="--raw $F2F_params" F2F_params="--raw --Odom/GuessMotion false --OdomOKVIS/ConfigPath ./config_fpga_p2_euroc.yaml $F2F_params"
fi fi
if [ $STRATEGY -eq 6 ] # okvis if [ $STRATEGY -eq 6 ] # okvis
then then
@@ -57,27 +65,51 @@ fi
if [ $STRATEGY -eq 88 ] # msckf_vio raw images if [ $STRATEGY -eq 88 ] # msckf_vio raw images
then then
STRATEGY=8 STRATEGY=8
F2F_params="--raw $F2F_params" F2F_params="--raw --Odom/GuessMotion false $F2F_params"
fi fi
if [ $STRATEGY -eq 8 ] # msckf_vio if [ $STRATEGY -eq 8 ] # msckf_vio
then then
F2F_params="--Odom/GuessMotion false $F2F_params" F2F_params="--Odom/GuessMotion false $F2F_params"
fi fi
# Select rtabmap built with os2 support or not if [ $STRATEGY -eq 99 ] # vins raw images
TOOL_PREFIX="/usr/local/bin"
if [ $STRATEGY -eq 5 ]
then then
TOOL_PREFIX="/root/rtabmap_os2/bin" STRATEGY=9
elif [ $STRATEGY -eq 8 ] F2F_params="--raw --Odom/GuessMotion false --OdomVINS/ConfigPath ./euroc_stereo_imu_config.yaml $F2F_params"
then
TOOL_PREFIX="/root/rtabmap_msckf/bin"
fi fi
RTABMAP_RGBD_TOOL="docker run -v $PWD/datasets/euroc:$DATASET_ROOT_PATH -v $PWD/results/euroc:$EUROC_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-euroc_dataset" if [ $STRATEGY -eq 9 ] # vins
if [ $STRATEGY -eq 6 ]
then then
xhost + F2F_params="--Odom/GuessMotion false --OdomVINS/ConfigPath ./euroc_stereo_imu_config.yaml $F2F_params"
RTABMAP_RGBD_TOOL="docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD/datasets/euroc:$DATASET_ROOT_PATH -v $PWD/results/euroc:$EUROC_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-euroc_dataset" fi
if [ $STRATEGY -eq 100 ] # vins (stereo-only) raw images
then
STRATEGY=9
F2F_params="--raw --Odom/GuessMotion false --OdomVINS/ConfigPath ./euroc_stereo_config.yaml $F2F_params"
fi
if [ $STRATEGY -eq 10 ] # vins (stereo-only)
then
F2F_params="--Odom/GuessMotion false --OdomVINS/ConfigPath ./euroc_stereo_config.yaml $F2F_params"
fi
RTABMAP_RGBD_TOOL="rtabmap-euroc_dataset"
if [ $DOCKER -eq 1 ]
then
# Select rtabmap built with os2 support or not
TOOL_PREFIX="/usr/local/bin"
if [ $STRATEGY -eq 5 ]
then
TOOL_PREFIX="/root/rtabmap_os2/bin"
elif [ $STRATEGY -eq 8 ]
then
TOOL_PREFIX="/root/rtabmap_msckf/bin"
fi
RTABMAP_RGBD_TOOL="docker run -v $PWD/datasets/euroc:$DATASET_ROOT_PATH -v $PWD/results/euroc:$EUROC_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-euroc_dataset"
if [ $STRATEGY -eq 6 ]
then
xhost +
RTABMAP_RGBD_TOOL="docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD/datasets/euroc:$DATASET_ROOT_PATH -v $PWD/results/euroc:$EUROC_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-euroc_dataset"
fi
fi fi
echo $RTABMAP_RGBD_TOOL echo $RTABMAP_RGBD_TOOL
@@ -111,7 +143,6 @@ do
--OdomORBSLAM2/MaxFeatures 1200\ --OdomORBSLAM2/MaxFeatures 1200\
--output "$EUROC_RESULTS_PATH/$d"\ --output "$EUROC_RESULTS_PATH/$d"\
--output_name $OUTPUT\ --output_name $OUTPUT\
--quiet\
$DATASET_ROOT_PATH/$d $DATASET_ROOT_PATH/$d
done done
# For V2_03_difficult: --Vis/MinInliers 10 --disp StereoBM/NumDisparities 32 --StereoBM/UniquenessRatio 5 --Vis/PnPReprojError 3 # For V2_03_difficult: --Vis/MinInliers 10 --disp StereoBM/NumDisparities 32 --StereoBM/UniquenessRatio 5 --Vis/PnPReprojError 3

View File

@@ -1,8 +1,16 @@
#!/bin/bash #!/bin/bash
PWD=$(pwd) PWD=$(pwd)
KITTI_ROOT_PATH='/root/datasets/kitti' DOCKER=1 # set to 0 to use host rtabmap tool and relative datasets to this script
KITTI_RESULTS_PATH='/root/results/kitti'
KITTI_ROOT_PATH='./datasets/kitti'
KITTI_RESULTS_PATH='./results/kitti'
mkdir -p $KITTI_RESULTS_PATH
if [ $DOCKER -eq 1 ]
then
KITTI_ROOT_PATH='/root/datasets/kitti'
KITTI_RESULTS_PATH='/root/results/kitti'
fi
LIST=('00' '01' '02' '03' '04' '05' '06' '07' '08' '09' '10') LIST=('00' '01' '02' '03' '04' '05' '06' '07' '08' '09' '10')
#LIST=('11' '12' '13' '14' '15' '16' '17' '18' '19' '20' '21') #LIST=('11' '12' '13' '14' '15' '16' '17' '18' '19' '20' '21')
@@ -22,7 +30,7 @@ then
STRATEGY=$2 STRATEGY=$2
REG=$3 REG=$3
else else
echo "Usage: run_tum_datasets.sh \"output name\" \"odom strategy: 0=f2m 1=f2f 11=f2f_optflow 2=fovis 3=viso2 4=dvo 5=orbslam2 7=LOAM\" \"reg strategy: 0=vis 1=icp-point2point 11=icp-point2plane\" [sequence]" echo "Usage: run_tum_datasets.sh \"output name\" \"odom strategy: 0=f2m 1=f2f 11=f2f_optflow 2=fovis 3=viso2 4=dvo 5=orbslam2 7=LOAM 9=VINS\" \"reg strategy: 0=vis 1=icp-point2point 11=icp-point2plane\" [sequence]"
exit exit
fi fi
@@ -43,6 +51,11 @@ then
F2F_params=" $F2F_params" F2F_params=" $F2F_params"
fi fi
if [ $STRATEGY -eq 3 ]
then
F2F_params="--OdomVINS/ConfigPath ./kitti_config04-12.yaml $F2F_params"
fi
SCAN="" SCAN=""
if [[ $REG -eq 1 || $REG -eq 11 ]] if [[ $REG -eq 1 || $REG -eq 11 ]]
then then
@@ -68,16 +81,20 @@ then
SCAN="--scan --Reg/Strategy $REG --OdomF2M/ScanMaxSize 10000 --OdomF2M/ScanSubtractRadius 0.5 --Odom/LOAMSensor 2 --Icp/MaxTranslation 2 --Icp/Epsilon 0.0001 --Icp/MaxCorrespondenceDistance 1.5 --Icp/CorrespondenceRatio 0.01 --Icp/PM true --Icp/PMOutlierRatio 0.7 --Icp/PMMatcherKnn 3 --Icp/PMMatcherEpsilon 1 $SCAN" SCAN="--scan --Reg/Strategy $REG --OdomF2M/ScanMaxSize 10000 --OdomF2M/ScanSubtractRadius 0.5 --Odom/LOAMSensor 2 --Icp/MaxTranslation 2 --Icp/Epsilon 0.0001 --Icp/MaxCorrespondenceDistance 1.5 --Icp/CorrespondenceRatio 0.01 --Icp/PM true --Icp/PMOutlierRatio 0.7 --Icp/PMMatcherKnn 3 --Icp/PMMatcherEpsilon 1 $SCAN"
fi fi
# Select rtabmap built with os2 support or not RTABMAP_RGBD_TOOL="rtabmap-kitti_dataset"
TOOL_PREFIX="/usr/local/bin" if [ $DOCKER -eq 1 ]
if [ $STRATEGY -eq 5 ]
then then
TOOL_PREFIX="/root/rtabmap_os2/bin" # Select rtabmap built with os2 support or not
elif [ $STRATEGY -eq 7 ] TOOL_PREFIX="/usr/local/bin"
then if [ $STRATEGY -eq 5 ]
TOOL_PREFIX="/root/rtabmap_loam/bin" then
fi TOOL_PREFIX="/root/rtabmap_os2/bin"
RTABMAP_KITTI_TOOL="docker run -v $PWD/datasets/kitti:$KITTI_ROOT_PATH -v $PWD/results/kitti:$KITTI_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-kitti_dataset" elif [ $STRATEGY -eq 7 ]
then
TOOL_PREFIX="/root/rtabmap_loam/bin"
fi
RTABMAP_KITTI_TOOL="docker run -v $PWD/datasets/kitti:$KITTI_ROOT_PATH -v $PWD/results/kitti:$KITTI_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-kitti_dataset"
if
echo $RTABMAP_KITTI_TOOL echo $RTABMAP_KITTI_TOOL
for d in "${LIST[@]}" for d in "${LIST[@]}"

View File

@@ -1,8 +1,16 @@
#!/bin/bash #!/bin/bash
PWD=$(pwd) PWD=$(pwd)
RGBD_ROOT_PATH='/root/datasets/tum' DOCKER=1 # set to 0 to use host rtabmap tool and relative datasets to this script
RGBD_ROOT_PATH='./datasets/tum'
RGBD_RESULTS_PATH='./results/tum'
mkdir -p $EUROC_RESULTS_PATH
if [ $DOCKER -eq 1 ]
then
RGBD_ROOT_PATH='/root/datasets/tum'
RGBD_RESULTS_PATH='/root/results/tum' RGBD_RESULTS_PATH='/root/results/tum'
fi
LIST=( 'rgbd_dataset_freiburg1_desk' 'rgbd_dataset_freiburg1_desk2' 'rgbd_dataset_freiburg1_room' 'rgbd_dataset_freiburg2_desk' 'rgbd_dataset_freiburg2_xyz' 'rgbd_dataset_freiburg3_long_office_household' 'rgbd_dataset_freiburg3_nostructure_texture_near_withloop_validation') LIST=( 'rgbd_dataset_freiburg1_desk' 'rgbd_dataset_freiburg1_desk2' 'rgbd_dataset_freiburg1_room' 'rgbd_dataset_freiburg2_desk' 'rgbd_dataset_freiburg2_xyz' 'rgbd_dataset_freiburg3_long_office_household' 'rgbd_dataset_freiburg3_nostructure_texture_near_withloop_validation')
# more: 'rgbd_dataset_freiburg1_360' 'rgbd_dataset_freiburg1_plant' 'rgbd_dataset_freiburg1_rpy' 'rgbd_dataset_freiburg1_teddy' 'rgbd_dataset_freiburg2_360_hemisphere' 'rgbd_dataset_freiburg2_large_no_loop' 'rgbd_dataset_freiburg2_large_with_loop' 'rgbd_dataset_freiburg1_floor' # more: 'rgbd_dataset_freiburg1_360' 'rgbd_dataset_freiburg1_plant' 'rgbd_dataset_freiburg1_rpy' 'rgbd_dataset_freiburg1_teddy' 'rgbd_dataset_freiburg2_360_hemisphere' 'rgbd_dataset_freiburg2_large_no_loop' 'rgbd_dataset_freiburg2_large_with_loop' 'rgbd_dataset_freiburg1_floor'
@@ -41,13 +49,17 @@ then
F2F_params="--RGBD/OptimizeMaxError 0 $F2F_params" F2F_params="--RGBD/OptimizeMaxError 0 $F2F_params"
fi fi
# Select rtabmap built with os2 support or not RTABMAP_RGBD_TOOL="rtabmap-rgbd_dataset"
TOOL_PREFIX="/usr/local/bin" if [ $DOCKER -eq 1 ]
if [ $STRATEGY -eq 5 ]
then then
TOOL_PREFIX="/root/rtabmap_os2/bin" # Select rtabmap built with os2 support or not
TOOL_PREFIX="/usr/local/bin"
if [ $STRATEGY -eq 5 ]
then
TOOL_PREFIX="/root/rtabmap_os2/bin"
fi
RTABMAP_RGBD_TOOL="docker run -v $PWD/datasets/tum:$RGBD_ROOT_PATH -v $PWD/results/tum:$RGBD_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-rgbd_dataset"
fi fi
RTABMAP_RGBD_TOOL="docker run -v $PWD/datasets/tum:$RGBD_ROOT_PATH -v $PWD/results/tum:$RGBD_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-rgbd_dataset"
echo $RTABMAP_RGBD_TOOL echo $RTABMAP_RGBD_TOOL
# no --disp with 01? # no --disp with 01?

View File

@@ -61,7 +61,7 @@ void showUsage()
" --quiet Don't show log messages and iteration updates.\n" " --quiet Don't show log messages and iteration updates.\n"
" --exposure_comp Do exposure compensation between left and right images.\n" " --exposure_comp Do exposure compensation between left and right images.\n"
" --disp Generate full disparity.\n" " --disp Generate full disparity.\n"
" --raw Use raw images (not rectified, this only works with okvis and msckf odometry).\n" " --raw Use raw images (not rectified, this only works with okvis, msckf or vins odometry).\n"
"%s\n" "%s\n"
"Example:\n\n" "Example:\n\n"
" $ rtabmap-euroc_dataset \\\n" " $ rtabmap-euroc_dataset \\\n"
@@ -253,6 +253,9 @@ int main(int argc, char * argv[])
UASSERT(models.back().isValidForRectification()); UASSERT(models.back().isValidForRectification());
} }
int odomStrategy = Parameters::defaultOdomStrategy();
Parameters::parse(parameters, Parameters::kOdomStrategy(), odomStrategy);
StereoCameraModel model(outputName+"_calib", models[0], models[1], models[1].localTransform().inverse() * models[0].localTransform()); StereoCameraModel model(outputName+"_calib", models[0], models[1], models[1].localTransform().inverse() * models[0].localTransform());
if(!model.save(output, false)) if(!model.save(output, false))
{ {
@@ -297,8 +300,6 @@ int main(int argc, char * argv[])
float detectionRate = Parameters::defaultRtabmapDetectionRate(); float detectionRate = Parameters::defaultRtabmapDetectionRate();
bool intermediateNodes = Parameters::defaultRtabmapCreateIntermediateNodes(); bool intermediateNodes = Parameters::defaultRtabmapCreateIntermediateNodes();
int odomStrategy = Parameters::defaultOdomStrategy();
Parameters::parse(parameters, Parameters::kOdomStrategy(), odomStrategy);
Parameters::parse(parameters, Parameters::kRtabmapDetectionRate(), detectionRate); Parameters::parse(parameters, Parameters::kRtabmapDetectionRate(), detectionRate);
Parameters::parse(parameters, Parameters::kRtabmapCreateIntermediateNodes(), intermediateNodes); Parameters::parse(parameters, Parameters::kRtabmapCreateIntermediateNodes(), intermediateNodes);
@@ -309,7 +310,7 @@ int main(int argc, char * argv[])
} }
std::ifstream imu_file; std::ifstream imu_file;
if(odomStrategy == Odometry::kTypeOkvis || odomStrategy == Odometry::kTypeMSCKF) if(odomStrategy == Odometry::kTypeOkvis || odomStrategy == Odometry::kTypeMSCKF || odomStrategy == Odometry::kTypeVINS)
{ {
// open the IMU file // open the IMU file
std::string line; std::string line;
@@ -393,7 +394,7 @@ int main(int argc, char * argv[])
while(data.isValid() && g_forever) while(data.isValid() && g_forever)
{ {
UDEBUG(""); UDEBUG("");
if(odomStrategy == Odometry::kTypeOkvis || odomStrategy == Odometry::kTypeMSCKF) if(odomStrategy == Odometry::kTypeOkvis || odomStrategy == Odometry::kTypeMSCKF || odomStrategy == Odometry::kTypeVINS)
{ {
// get all IMU measurements till then // get all IMU measurements till then
double t_imu = start; double t_imu = start;
@@ -442,7 +443,7 @@ int main(int argc, char * argv[])
UDEBUG(""); UDEBUG("");
Transform pose = odom->process(data, &odomInfo); Transform pose = odom->process(data, &odomInfo);
UDEBUG(""); UDEBUG("");
if((odomStrategy == Odometry::kTypeOkvis || odomStrategy == Odometry::kTypeMSCKF) && if((odomStrategy == Odometry::kTypeOkvis || odomStrategy == Odometry::kTypeMSCKF || odomStrategy == Odometry::kTypeVINS) &&
pose.isNull()) pose.isNull())
{ {
cameraInfo = CameraInfo(); cameraInfo = CameraInfo();
@@ -664,7 +665,7 @@ int main(int argc, char * argv[])
rotational_max); rotational_max);
printf(" translational_rmse= %f m (vo = %f m)\n", translational_rmse, translational_rmse_vo); printf(" translational_rmse= %f m (vo = %f m)\n", translational_rmse, translational_rmse_vo);
printf(" rotational_rmse= %f deg (vo = %f def)\n", rotational_rmse, rotational_rmse_vo); printf(" rotational_rmse= %f deg (vo = %f deg)\n", rotational_rmse, rotational_rmse_vo);
FILE * pFile = 0; FILE * pFile = 0;
std::string pathErrors = output+"/"+outputName+"_rmse.txt"; std::string pathErrors = output+"/"+outputName+"_rmse.txt";