-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.6")
[rosbuild] Building package ORB_SLAM-master
**[rosbuild] Error from directory check: /opt/ros/indigo/share/ros/core/rosbuild/bin/check_same_directories.py /home/jy/work_sp/src/ORB_SLAM-master /home/jy/catkin_ws/src/ORB_SLAM-master**
1
Traceback (most recent call last):
File "/opt/ros/indigo/share/ros/core/rosbuild/bin/check_same_directories.py", line 48, in
raise Exception
Exception
CMake Error at /opt/ros/indigo/share/ros/core/rosbuild/private.cmake:102 (message):
[rosbuild] rospack found package "ORB_SLAM-master" at
"/home/jy/work_sp/src/ORB_SLAM-master", but the current directory is
"/home/jy/catkin_ws/src/ORB_SLAM-master". You should double-check your
ROS_PACKAGE_PATH to ensure that packages are found in the correct
precedence order.
Call Stack (most recent call first):
/opt/ros/indigo/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location)
CMakeLists.txt:4 (rosbuild_init)
-- Configuring incomplete, errors occurred!
See also "/home/jy/catkin_ws/src/ORB_SLAM-master/build/CMakeFiles/CMakeOutput.log"
在.zshrc 末尾添加:export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/jy/catkin_ws/src/ORB_SLAM-master
(这个是我的路径 我用的是zsh 大家根据实际情况更改就行)
ORB路径添加到ROS
cmake ..
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.6")
[rosbuild] Building package ORB_SLAM-master
Failed to invoke /opt/ros/indigo/bin/rospack deps-manifests ORB_SLAM-master
**[rospack] Error: package 'ORB_SLAM-master' depends on non-existent package 'opencv2' and rosdep claims that it is not a system dependency. Check the ROS_PACKAGE_PATH or try calling 'rosdep update'**
CMake Error at /opt/ros/indigo/share/ros/core/rosbuild/public.cmake:129 (message):
Failed to invoke rospack to get compile flags for package
'ORB_SLAM-master'. Look above for errors from rospack itself. Aborting.
Please fix the broken dependency!
Call Stack (most recent call first):
/opt/ros/indigo/share/ros/core/rosbuild/public.cmake:207 (rosbuild_invoke_rospack)
CMakeLists.txt:4 (rosbuild_init)
-- Configuring incomplete, errors occurred!
See also "/home/jy/catkin_ws/src/ORB_SLAM-master/build/CMakeFiles/CMakeOutput.log"
直接将文件manifest.xml中 < depend package=“opencv2”/ > 删除就好了。
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc: In member function ‘void ORB_SLAM::ORBextractor::ComputeKeyPoints(std::vector >&)’:
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc:607:63: error: ‘FAST’ was not declared in this scope
FAST(cellImage,cellKeyPoints[i][j],fastTh,true);
^
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc:616:34: error: ‘ORB’ has not been declared
if( scoreType == ORB::HARRIS_SCORE )
^
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc:683:17: error: ‘KeyPointsFilter’ has not been declared
KeyPointsFilter::retainBest(keysCell,nToRetain[i][j]);
^
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc:699:13: error: ‘KeyPointsFilter’ has not been declared
KeyPointsFilter::retainBest(keypoints,nDesiredFeatures);
^
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc: In member function ‘void ORB_SLAM::ORBextractor::operator()(cv::InputArray, cv::InputArray, std::vector&, cv::OutputArray)’:
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc:760:82: error: ‘GaussianBlur’ was not declared in this scope
GaussianBlur(workingMat, workingMat, Size(7, 7), 2, 2, BORDER_REFLECT_101);
^
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc: In member function ‘void ORB_SLAM::ORBextractor::ComputePyramid(cv::Mat, cv::Mat)’:
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc:800:78: error: ‘INTER_LINEAR’ was not declared in this scope
resize(mvImagePyramid[level-1], mvImagePyramid[level], sz, 0, 0, INTER_LINEAR);
^
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc:800:90: error: ‘resize’ was not declared in this scope
resize(mvImagePyramid[level-1], mvImagePyramid[level], sz, 0, 0, INTER_LINEAR);
^
/home/jy/catkin_ws/src/ORB_SLAM-master/src/ORBextractor.cc:803:80: error: ‘INTER_NEAREST’ was not declared in this scope
resize(mvMaskPyramid[level-1], mvMaskPyramid[level], sz, 0, 0, INTER_NEAREST);
^
make[2]: *** [CMakeFiles/ORB_SLAM-master.dir/src/ORBextractor.cc.o] 错误 1
make[1]: *** [CMakeFiles/ORB_SLAM-master.dir/all] 错误 2
make: *** [all] 错误 2
相应文件的头文件缺少(我的是ORBextractor.cc)。搜了好久的解决办法,一点用都没,后来去官网上找文件。一对比才发现我的头文件少了好几个把缺失的复制上就行了。
实在不行就重装系统吧 我重装系统后一遍跑通orb_slam
在使用我自己的电脑摄像头来跑ORB_SLAM的时候,摄像头发布的节点名字是usb_cam/******,而ORB_SLAM订阅的节点名字是camera/********
我的usb_cam-test.launch文件是
这样的节点ORB_SLAM 是没办法订阅的,在rviz界面显示不出摄像头的画面。
修改usb_cam-test.launch文件
然后再运行ExampleGroovyOrNewer.launch 文件即可。
或者可以把两个文件结合在一个launch文件里。
这样只需要启动这一个文件就行了。