一.ros gtk 2.x\gtk 3.x冲突
出现错误
Gtk-ERROR **: GTK+ 2 symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
这个问题主要是按装opencv3.2.0时候编译,系统默认到编译用的是最高版本的GTK 3,只需要重新安装opencv3.2.0即可。
首先卸载opencv3.2.0
cd build
sudo make uninstall
cd ..
rm -r build
这样就卸载了opencv3.2.0
接下来重新安装,这里有个问题,opencv3.2.0重新编译的时候可能会出现与VTK的兼容性问题,导致编译不成功,我们只需要在cmake的过程中关掉VTK就行,然后编译gtk2具体编译如下:
mkdir build
cd build
cmake -D WITH_VTK=OFF -D WITH_GTK_2_X=ON ..
重新编译成功。接下来可以实时运行ORB-SLAM2。
二.打开实时单目没有画面提示waiting for image
修改ORB_SLAM2/Examples/ROS/ORB_SLAM2/src/ros_momo.cc文件里面的路径
更改为: /usb_cam/image_raw
然后重新编译build_ros.sh。
另一个原因就是没有打开摄像头,运行命令打开摄像头
roslaunch usb_cam usb_cam-test.launch
三.[usb_cam-test.launch] is neither a launch file in package [usb_cam] nor is [usb_cam] a launch file name The traceback for the exception was written to the log file问题
输入命令
source ~/catkin_ws/devel/setup.bash
roslaunch usb_cam usb_cam-test.launch
这样就没错了