- ROS :
noetic
is recommended. (If you have built OpenCV (3.3.1 or later) manually, you can usemelodic
or later.) - :ref:`stella_vslam <chapter-installation>`
- image_transport : Required by this ROS package examples.
- cv_bridge : Please build it with the same version of OpenCV used in stella_vslam.
Tested for Ubuntu 18.04.
Please install the following dependencies.
- ROS : Please follow Installation of ROS.
- stella_vslam : Please follow :ref:`Installation of stella_vslam <chapter-installation>`.
Note
Please build stella_vslam with PangolinViewer or SocketViewer if you plan on using it for the examples.
Install the dependencies via apt
.
apt update -y
apt install ros-${ROS_DISTRO}-image-transport
Download the source of cv_bridge
.
mkdir -p ~/catkin_ws/src
git clone --branch ${ROS_DISTRO} --depth 1 https://github.com/ros-perception/vision_opencv.git
cp -r vision_opencv/cv_bridge ~/catkin_ws/src
rm -rf vision_opencv
When building with support for PangolinViewer, please specify the following cmake options: -DUSE_PANGOLIN_VIEWER=ON
and -DUSE_SOCKET_PUBLISHER=OFF
as described in :ref:`build of stella_vslam <section-build-unix>`.
stella_vslam and stella_vslam_ros need to be built with the same options.
cd ~/catkin_ws/src
git clone --recursive --branch ros --depth 1 https://github.com/stella-cv/stella_vslam_ros.git
cd ~/catkin_ws
catkin_make -DUSE_PANGOLIN_VIEWER=ON -DUSE_SOCKET_PUBLISHER=OFF
Run the core program required for ROS-based system in advance.
roscore
Note
Please leave the roscore run.
rosrun image_publisher image_publisher ./aist_living_lab_1/video.mp4 /image_raw:=/camera/image_raw
For using a standard USB camera for visual SLAM or localization.
apt install ros-${ROS_DISTRO}-usb-cam
rosparam set usb_cam/pixel_format yuyv
rosrun usb_cam usb_cam_node
Republish the ROS topic to /camera/image_raw
.
rosrun image_transport republish \
raw in:=/usb_cam/image_raw raw out:=/camera/image_raw
Subscribers continually receive images. Please execute one of the following command snippets in the new terminal.
Note
Option arguments are the same as :ref:`the examples of stella_vslam <chapter-example>`.
We provide an example snippet for visual SLAM.
The source code is placed at stella_vslam_ros/src/run_slam.cc
.
source ~/catkin_ws/devel/setup.bash
rosrun stella_vslam_ros run_slam \
-v /path/to/orb_vocab.fbow \
-c /path/to/config.yaml \
--map-db-out /path/to/map.msg
We provide an example snippet for localization based on a prebuilt map.
The source code is placed at stella_vslam_ros/src/run_slam.cc
.
source ~/catkin_ws/devel/setup.bash
rosrun stella_vslam_ros run_slam \
--disable-mapping \
-v /path/to/orb_vocab.fbow \
-c /path/to/config.yaml \
--map-db-in /path/to/map.msg