Ask Your Question
0

Getting error while using cmake command?

asked 2013-08-14 18:16:10 -0500

lifelonglearner gravatar image

I created rosbuild workspace (mywork) and a package (test) within it.

I was trying to build the package using cmake command

[rosbuild] Building package test
[rosbuild] Error from directory check: /opt/ros/groovy/share/ros/core/rosbuild/bin/check_same_directories.py  /home/admin-pc/mywork/test
1
Traceback (most recent call last):
  File "/opt/ros/groovy/share/ros/core/rosbuild/bin/check_same_directories.py", line 46, in <module>
    raise Exception
Exception
CMake Error at /opt/ros/groovy/share/ros/core/rosbuild/private.cmake:102 (message):
  [rosbuild] rospack found package "test" at "", but the current directory is
  "/home/admin-pc/mywork/test".  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/groovy/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location)
  CMakeLists.txt:12 (rosbuild_init)


-- Configuring incomplete, errors occurred!
edit retag flag offensive close merge delete

Comments

With multiple hit and trial I found the solution that is to use command
source ~/mywork/setup.bash
but I need to use this in every new terminal. Please tell the solution.

lifelonglearner gravatar image lifelonglearner  ( 2013-08-14 20:32:47 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-08-14 21:53:42 -0500

The Martin gravatar image

I think the only solution is to either add that line ("source ~/mywork/setup.bash") in your ~/.bashrc file, so that it gets executed for each new shell, or to manually source it in all terminals where you want to use your workspace.

edit flag offensive delete link more
5

answered 2013-08-14 21:57:09 -0500

Miguel S. gravatar image

The solution depends on how you generated your rosbuild workspace. This page contains all the info you need. But I'll summarise below.

If you created your rosbuild workspace with rosws then add to your ~/.bashrc the following line:

source $HOME/mywork/setup.bash

When going down this route make sure you called rosws after having sourced the setup.bash from your catkin devel directory (assuming you're mixing catkin and rosbuild). See the link above for more information.

Alternatively, if you want to set your workspace the "traditional" (pre-groovy) way, then append the following to ~/.bashrc:

export ROS_PACKAGE_PATH=$HOME/mywork:$ROS_PACKAGE_PATH

This simply adds your rosbuild workspace to ROS's package path (which incidentally is what the error above was trying to tell you to do :P ).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-08-14 18:16:10 -0500

Seen: 3,191 times

Last updated: Aug 14 '13