ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

rosbuild error bad current directory

asked 2013-03-03 15:00:48 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello,

I'm just started to learn ROS. I'm set the package as in beginner tutorial (but my package name is firstpackage). The erros when I type make is the following

mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
[rosbuild] Building package firstpackage
CMake Error at /opt/ros/electric/ros/core/rosbuild/private.cmake:110 (message):
[rosbuild] rospack found package "firstpackage" at "", but the current directory is "/home/unais/workspace_ros/firstpackage".  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/electric/ros/core/rosbuild/public.cmake:180 (_rosbuild_check_package_location)
CMakeLists.txt:12 (rosbuild_init)


-- Configuring incomplete, errors occurred!
make: *** [all] Error 1

Qn : What would be the error? I don't know how to set my path currectly

This is my .bashrc file

The last some lines are this

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi
source /opt/ros/fuerte/setup.bash

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export ROS_PACKAGE_PATH=~/workspace_ros:$ROS_PACKAGE_PATH
export ROS_PACKAGE_PATH=~/gspeech-master:$ROS_PACKAGE_PATH

export ROS_PACKAGE_PATH=~/fuerte_workspace/sandbox/beginner_tutorials:$ROS_PACKAGE_PATH
export ROS_PACKAGE_PATH=~/beginner_tutorials:$ROS_PACKAGE_PATH
source /opt/ros/electric/setup.bash
source /opt/ros/electric/setup.bash
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-03-03 21:14:57 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

clean up your .bashrc first:

There should only be one line like

source /opt/ros/electric/setup.bash

You currently have 3. If you need to use both fuerte and electric, then don't put anything like that into your bashrc, but run this line in the shell every time you start a new shell.

Then don't use multiple workspace, use one workspace for electric and one workspace for fuerte. Do not mention both in your bashrc.

Ideally use rosws to create a workspace, and source it's setup.sh either manually in in the bashrc. If you use fuerte and electric, create separate workspaces, and don't source anything in your bashrc, nor modify the ROS_PACKAGE_PATH in your bashrc, just source the workspaces setup.bash when you start a new shell.

Also rely on the rosmake tool rather than invoking "mkdir bin ...". The rosmake tool is much easier to use for beginners than trying to manually do the right thing.

Your .bashrc ending should look e.g. like this:

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi


source ~/workspace_ros/setup.bash
edit flag offensive delete link more

Comments

Thank you . I need this "workspace_ros" work space only -- Could you please help me what all are the changes I need to edit in my .bashrc file

unais gravatar image unais  ( 2013-03-03 23:05:56 -0500 )edit

Hello is it this two lines is needed .### Added by the Heroku Toolbelt export PATH="/usr/local/heroku/bin:$PATH"

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

unais gravatar image unais  ( 2013-03-04 16:28:36 -0500 )edit

Not for ROS. I just gave them for you to know where to make changes.

KruseT gravatar image KruseT  ( 2013-03-05 02:26:48 -0500 )edit

thank you very much .

unais gravatar image unais  ( 2013-03-05 13:05:08 -0500 )edit

Question Tools

Stats

Asked: 2013-03-03 15:00:48 -0500

Seen: 1,766 times

Last updated: Mar 04 '13