The purpose of this ROS package is to work as a framework for visual odometry algorithms. The algorithms we have used are ORB SLAM and SVO. vo_framework is a ROS package and should be put in your catkin workspace.
##vo_framework content
- camera driver nodes: A ROS node that publishes a camera stream to the ROS topic camera/image_raw
- camera calibration: Guides for camera calibration and calibration files for certain cameras (see README in CamCalib)
- pose regulation node: A node which takes a tf pose from ORB_SLAM/SVO as input and regulates drone through MAVROS
In this README replace usrname, USRNAME, nawan and hvaadal with your Linux username
Create a ROS workspace named catkin_ws by following this tutorial http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment
clone this repo from github at location catkin_ws/src/. This repo will now be a new package in the catkin_ws
clone ORB_SLAM2 github repo at your home directory, follow guide, run and check if you have all dependencies https://github.com/raulmur/ORB_SLAM2
Clone the Pangolin github repo in your Computer/usr/local folder(remember to use sudo). Repo can be found at https://github.com/stevenlovegrove/Pangolin and get required Pangolin dependencies (like Glew, see Pangolin README)
#####Running pangolin: cd Computer/usr/local/Pangolin evt drep build som bor i pangolin sudo mkdir build cd build sudo cmake .. sudo cmake --build .
https://github.com/raulmur/ORB_SLAM2#kitti-dataset
Run KITTI Dataset example with ORB_SLAM2 to check if things are working
./Examples/Monocular/mono_kitti Vocabulary/ORBvoc.txt Examples/Monocular/KITTI00-02.yaml /home/nawan/Downloads/dataset/sequences/00
If you followed step 1-6 and everything ran smoothly you can continune and make ORB_SLAM2 work with ROS. If you have issues with step 1-6 you can check the troubleshoot guide at the end of this README.
Remember to see troubleshoot guide WHEN errors occur
cd ~/catkin_ws source devel/setup.bash catkin_make roscore
https://github.com/raulmur/ORB_SLAM2#7-ros-examples
chmod +x build_ros.sh ./build_ros.sh
https://github.com/raulmur/ORB_SLAM2#7-ros-examples
rosrun ORB_SLAM2 Mono /home/nawan/ORB_SLAM2/Vocabulary/ORBvoc.txt /home/nawan/catkin_ws/src/ROS_cam_driver/CamCalib/Microsoft_R.yaml
rosrun ROS_cam_driver ROS_cam_driver
rosbag play rosbag name (can be ran instead of camera driver if you have rosbags)
Building any openCV program: g++ main.cpp -o app pkg-config --cflags --libs opencv
- (hvis kjørt med ROS bør openCV legges til som depend i package.xml og Cmakelist.noe) *
Checking OpenCV version: pkg-config --modversion opencv
- (we used version 3.3.1) *
##TF
rosrun tf tf_echo camera_link camera_pose
This command prints out the rotation and translation of the drone. This rotation and translation is found from ORB_SLAM2
cd Pangolin drep build som bor i pangolin mkdir build cd build cmake .. cmake --build .
#Single Computer ROS export ROS_HOSTNAME=localhost export ROS_MASTER_URI=http://localhost:11311
#Sourcing ROS source /home/nawan/visnav_ws/devel/setup.bash source /opt/ros/kinetic/setup.bash source ~/catkin_ws/devel/setup.bash
# Virtual Environment Wrapper source /usr/local/bin/virtualenvwrapper.sh
# Virtual Environment Wrapper
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/nawan/ORB_SLAM2/Examples/ROS
[rosbuild] rospack found package "ORB_SLAM2" at "", but the current directory is "/home/nawan/ORB_SLAM2/Examples/ROS/ORB_SLAM2". You should double-check your ROS_PACKAGE_PATH to ensure that packages are found in the correct precedence order.
#####OR c++: fatal error: input file ‘../lib/libORB_SLAM2.so’ is the same as output file compilation terminated.
#####OR #ROS path [0]=... #ROS path [1]=... #ROS path [2]=...
Error can likely be fixed by typing: export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/nawan/ORB_SLAM2/Examples/ROS into terminal
Undefined reference to symbol '_ZN5boost6system15system_categoryEv'-- raulmur/ORB_SLAM2#494
Post from forum Ok, I got confused. Remove all the flags in that CMakeList. You should do the changes in the ROS CMakeList. I think that is here: /home/USRNAME/ORB_SLAM2/Examples/ROS/ORB_SLAM2/CMakeList.txt
It should have this:
set(LIBS
We only did what the above post said, see link above for discussion around this error message.
##Debug see command-line arguments for a launch file roslaunch --ros-args ROS_cam_driver driver.launch