Orb_slam2: ROS build error for ORB_SLAM2

Created on 2 Jul 2018  Â·  10Comments  Â·  Source: raulmur/ORB_SLAM2

I want to build ROS node. I have set the environment variable as follows and also added it to .bashrc. Still I get the errrors as shown bellow. Anyone has idea?

export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:home/ujjval/ORB_SLAM2/Examples/ROS/ORB_SLAM2

`ujjval@ujjval-VPCEH18FG:~/ORB_SLAM2$ ./build_ros.sh
Building ROS nodes
mkdir: cannot create directory ‘build’: File exists
[rosbuild] Building package ORB_SLAM2
[rosbuild] Error from directory check: /opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py /home/ujjval/ORB_SLAM2/Examples/ROS/ORB_SLAM2
1
Traceback (most recent call last):
File "/opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py", line 46, in
raise Exception
Exception
CMake Error at /opt/ros/kinetic/share/ros/core/rosbuild/private.cmake:102 (message):
[rosbuild] rospack found package "ORB_SLAM2" at "", but the current
directory is "/home/ujjval/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.
Call Stack (most recent call first):
/opt/ros/kinetic/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location)
CMakeLists.txt:4 (rosbuild_init)

-- Configuring incomplete, errors occurred!
See also "/home/ujjval/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log".
make: * No targets specified and no makefile found. Stop.
`

Most helpful comment

I found the way man ,maybe we are the same situation, don't let the "source /opt/ros/kinetic/setup.bash" as the last line in ~/.bashrc, it will change the $ROS_PACKAGE_PATH, make sure export ${ROS_PACKAGE_PATH}:home/ujjval/ORB_SLAM2/Examples/ROS/ORB_SLAM2 as the last line

All 10 comments

Hey Rathod,
As the line
[rosbuild] rospack found package "ORB_SLAM2" at "", but the current directory is "/home/ujjval/ORB_SLAM2/Examples/ROS/ORB_SLAM2"
indicates your ros environment variable is not setup correctly. After exporting the ROS_PACKAGE_PATH cross verify if it is setup correctly by echo $ROS_PACKAGE_PATH
also make sure that you are exporting and running the build_ros.sh in the same terminal.

Hello, As far as I know ROS_PACKAGE_PATH should be where the packages are
I have set them like follows, still the error persists.
ujjval@ujjval-VPCEH18FG:~/ORB_SLAM2$ echo $ROS_PACKAGE_PATH /opt/ros/kinetic:/opt/ros/kinetic/share:home/ujjval/ORB_SLAM2/Examples/ROS/ORB_SLAM2

Did you try rospack find ORB_SLAM2 after setting the ROS_PACKAGE_PATH variable?

I checked it but it could not find the ORB_SLAM2 package. So I cloned the SLAM2 library using git in my /opt/ros/kinetic/share folder. then it was able to find the package but the error was not resoved

I saw a similar issue inhttps://github.com/raulmur/ORB_SLAM/issues/39

Following the steps shown on the web-page worked for me. closing
https://gitlab.tu-berlin.de/breakdowncookie/ORB_SLAM2/tree/a0493c223e41c37032e5c9103f8b4724f1217663

Hi~ I'm facing the same error as same as yours~ But when I clicking the website, I see 404... Would you please give me some help~I will appreciate that!!

did you have source .bashrc

I found the way man ,maybe we are the same situation, don't let the "source /opt/ros/kinetic/setup.bash" as the last line in ~/.bashrc, it will change the $ROS_PACKAGE_PATH, make sure export ${ROS_PACKAGE_PATH}:home/ujjval/ORB_SLAM2/Examples/ROS/ORB_SLAM2 as the last line

I am facing the same error but the link given is not opening.
Can someone please help in this?

I also encountered this error, how can I do?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

angussmitchell picture angussmitchell  Â·  5Comments

imrasp picture imrasp  Â·  6Comments

kilimeters picture kilimeters  Â·  3Comments

Andreluizfc picture Andreluizfc  Â·  4Comments

balzar29 picture balzar29  Â·  4Comments