9
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ROSのLSD-SLAMを動かしてみた。

Last updated at Posted at 2017-06-09

###目的
TUS(ミュンヘン工科大)が公開している、ROSの単眼カメラのSLAM、LSD-SLAMを動かしてみた。

LSD-SLAM: Large-ScaleDirect Monocular SLAM
github / Papar / Presen / TUS-Vision Lab.

###環境
Ubuntu1404 x64
ROS:Indigo
(ROS:Kineticではコンパイルできず)

###ライブラリのインストール

$ sudo apt-get install python-rosinstall
$ sudo apt-get install ros-indigo-libg2o ros-indigo-cv-bridge liblapack-dev libblas-dev freeglut3-dev libqglviewer-dev libsuitesparse-dev libx11-dev

###LSD-SLAMのインストール
catkinには対応していない。rosmakeでコンパイルする。
フォルダをrosbuild_wsからcatkin_lsdslamに変更している。

$ mkdir ~/catkin_lsdslam
$ cd ~/catkin_lsdslam
$ rosws init . /opt/ros/indigo
$ rosws set ~/catkin_lsdslam/package_dir -t .
$ echo "source ~/catkin_lsdslam/setup.bash">> ~/.bashrc
$ git clone https://github.com/tum-vision/lsd_slam.git lsd_slam
$ rosmake lsd_slam

###dynamic_reconfigureの修正

下記のエラーが起きた場合、dynamic_reconfigureのバクを修正する。

CMake Error at /opt/ros/indigo/share/dynamic_reconfigure/cmake/cfgbuild.cmake:78 (string):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
/opt/ros/indigo/share/dynamic_reconfigure/cmake/cfgbuild.cmake:99 (gencfg_cpp)
CMakeLists.txt:29 (include)

parameter_generator.pyの、144行目を削除する

$ sudo vi /opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator.py

check_name(name)
check_description(description)
self.gen.fill_type(newparam)
self.gen.check_type_fill_default(newparam, 'default', self.gen.defval[paramtype])
self.gen.check_type_fill_default(newparam, 'max', self.gen.maxval[paramtype])

参考:
https://github.com/tum-vision/lsd_slam/issues/219
https://github.com/ros/dynamic_reconfigure/pull/76/files

###データセット(rosbag data)のダウンロード

$ wget http://vmcremers8.informatik.tu-muenchen.de/lsd/LSD_room.bag.zip
$ cd ~/catkin_lsdslam
$ unzip LSD_room.bag.zip

###データセット(rosbag data)で実行

$ roscore
$ rosrun lsd_slam_viewer viewer
$ rosbag play ~/catkin_lsdslam/LSD_room.bag
$ rosrun lsd_slam_core live_slam image:=/image_raw camera_info:=/camera_info

Screenshot from 2017-06-10 07:42:59.png

lsd_slam.png

###Kinect V1で実行

$ roslaunch freenect_launch freenect.launch
$ rosrun lsd_slam_viewer viewer
$ rosrun lsd_slam_core live_slam image:=/camera/rgb/image_color camera_info:=/camera/rgb/camera_info

###参考

LSD-SLAMをROSで試す1-インストールとビルドとクイックスタート @ 趣味なし奴のメモ帳
https://noshumi.blogspot.jp/2016/12/lsd-slamros1.html

LSD-SLAM: Large-Scale Direct Monocular SLAM @Daily Tech Blog
http://daily-tech.hatenablog.com/entry/2016/04/29/145737

第2回cv勉強会@九州 LSD-SLAM ECCV'14 読み会 LSD-SLAM: Large-Scale Direct Monocular @ Satoshi Fujimoto,
https://www.slideshare.net/satoshibfujimoto/2cv-lsdslam

第22回画像センシングシンポジウムチュートリアル講演会 Kinect等の色距離センサを用いた点群処理と3D物体認識-ベーシックな手法と最新動向・ソフトウェアの紹介ー
https://staff.aist.go.jp/kanezaki.asako/pdf/SSII2016_AsakoKanezaki.pdf

9
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?