Use your own camera ueye run in ROS in ORB_SLAM2

step1.

ROS create a workspace

mkdir -p ~/catkin_ws2/src

Open catkin_ws2:

cd ~/catkin_ws2/

This time with ls will find only a file catkin_ws2 src directory.

catkin_make

This step in the implementation of End catalog catkin_ws2 will build two more files and devel, while there will be a CMakeLists.txt in src.

step2.

To the main directory Ctrl + H to open the hidden files, find .bashrc, and add open  

source ~/catkin_ws/devel/setup.bash
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/home/lcm/catkin_ws2/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2 

Add the spatial path corresponding to the working environment in the variable ROS_PACKAGE_PATH.

In the terminal run

source ~/.bashrc
source ~/catkin_ws2/devel/setup.bash
echo $ROS_PACKAGE_PATH

If the terminal display:

/home/lcm/catkin_ws2/src:/opt/ros/kinetic/share

Description work environment configuration.

step3.

Into the src folder

cd src

Download ueye_cam to the src

git clone https://github.com/anqixu/ueye_cam

Ueye_cam into the folder, compiled ueye_cam

cd ueye_cam
mkdir build
cd build
cmake ..
make

Download usb_cam to the src directory

git clone https://github.com/bosch-ros-pkg/usb_cam.git
Also, access to the next usb_cam folder, compiled usb_cam
cd usb_cam
mkdir build
cd build
cmake ..
make

step4.

After installing ORB_SLAM2 dependent

Download ORB_SLAM2 to the src

cd src
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2

Compile ORB_SLAM2 libraries and sample programs

cd ORB_SLAM2
chmod +x build.sh
./build.sh

Generated libORB_SLAM2.so located lib directory, executable mono_tum, mono_kitti, rgbd_tum, stereo_kitti, mono_euroc and stereo_euroc directory located in the Examples.

step5.   

Modify ros_mono.cc

Enter ~ / catkin_ws2 / src / ORB_SLAM2 / Examples / ROS / ORB_SLAM2 / src, open ros_mono.cc viewer inside topic

The ROS in mono acquire monocular image corresponding to the node name is changed to ueye image news topic that was published after the start monocular camera.

ORB_SLAM2 single topic name monocular image is located

/camera/image_raw

Monocular camera in ROS released under the name of the amount topic

/camera/image_rar

The same topic name, directly translated.

chmod +x build_ros.sh
./build_ros.sh

Here an error occurs, but does not affect the monocular, so ignore

Then run it again catkin_make, otherwise it will complain later.

catkin_make

step6.

In the terminal run camera

sudo /etc/init.d/ueyeusbdrc start

Open a new terminal

roscore

Reopening monocular camera in the first terminal

roslaunch  ueye_cam rgb8.launch

If the first roslaunch the first terminal, there will be an error when re-open a new terminal run roscore:

roscore cannot run as another roscore/master is already running.
Please kill other roscore/master processes before relaunching.

And then open a new terminal

source ~/catkin_ws2/devel/setup.bash
rosrun ORB_SLAM2 Mono /home/lcm/catkin_ws2/src/ORB_SLAM2/Vocabulary/ORBvoc.txt /home/lcm/catkin_ws2/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/Asus.yaml 

Run successfully.

Guess you like

Origin blog.csdn.net/lcmsir/article/details/80025459