Cannot build rosbuild workspace on top of catkin workspace in Hydro [closed]
Hi everyone,
I don't know why, but I cannot get my catkin/rosbuild workspace setup to work in ROS Hydro. I have done everything the same way as I have done in Groovy, but when I source setup.bash
from my Hydro rosbuild_ws
I find that my $ROS_PACKAGE_PATH
contains only the native ROS folders.
I appreciate any attempts to help me debug this issue, as I have gone as far as looking deeply into the auto-generated files that are sourced to find any differences that might lead to this behavior... The workspace files are essentially the same, so I am led to believe that the issue is with the native setup files.
As a reference, I am following these ROS tutorials:
ROS Groovy
georgebrindeiro@r2d2:~$ echo $ROS_PACKAGE_PATH
/home/georgebrindeiro/workspaces/groovy/catkin_ws/src:/opt/ros/groovy/share:/opt/ros/groovy/stacks
ROS Hydro
georgebrindeiro@r2d2:~$ echo $ROS_PACKAGE_PATH
/opt/ros/hydro/share:/opt/ros/hydro/stacks
This is the relevant portion of my ~/.bashrc
:
(I always uncomment the corresponding ROS distro line and the rosbuild line when switching distros)
## ROS config ##
export ROS_MASTER_URI=http://localhost:11311
#export ROS_MASTER_URI=http://aramis:11311
#export ROS_MASTER_URI=http://athos:11311
#export ROS_MASTER_URI=http://porthos:11311
#source /opt/ros/groovy/setup.bash
source /opt/ros/hydro/setup.bash
#source ~/workspaces/groovy/catkin_ws/devel/setup.bash
#source ~/workspaces/groovy/rosbuild_ws/setup.bash
#source ~/workspaces/hydro/catkin_ws/devel/setup.bash
source ~/workspaces/hydro/rosbuild_ws/setup.bash
export ROSCONSOLE_CONFIG_FILE=~/.ros/rosconsole.config
alias roslog='gedit $ROSCONSOLE_CONFIG_FILE'
alias rosversion='echo $ROS_DISTRO'
EDIT: Here are my .rosinstall
files
ROS Groovy
- setup-file: {local-name: /home/georgebrindeiro/workspaces/groovy/catkin_ws/devel/setup.sh}
ROS Hydro
# IT IS UNLIKELY YOU WANT TO EDIT THIS FILE BY HAND,
# UNLESS FOR REMOVING ENTRIES.
# IF YOU WANT TO CHANGE THE ROS ENVIRONMENT VARIABLES
# USE THE rosinstall TOOL INSTEAD.
# IF YOU CHANGE IT, USE rosinstall FOR THE CHANGES TO TAKE EFFECT
- setup-file: {local-name: /home/georgebrindeiro/workspaces/hydro/catkin_ws/devel/setup.sh}
The first `source /opt/ros/hydro/setup.bash` is completely overwritten by the second source line, `source ~/workspaces/hydro/rosbuild_ws/setup.bash `.
A rosbuild workspace generates it's setup files when the workspace is created, where as a catkin workspace generates them when it is built. Can you post the contents of `~/workspaces/hydro/rosbuild_ws/.rosinstall`?
I didn't realize that! That's how I have always done it, though. Shouldn't the second line be including catkin_ws in $ROS_PACKAGE_PATH as well, though? As I said, I do the exact same thing with ROS Groovy and get a different result.
I was able to get my previous behavior by sourcing both the catkin_ws and the rosbuild_ws setup files. Does that mean that the following line in the tutorials is deprecated? "You can source the generated rosbuild_ws/setup.sh files to work with both the rosbuild and the catkin workspace."
@georgebrindeiro, That line is still valid. The rosbuild workspace just refers to another setup file. The catkin workspace reconstructs the environment it was built in (regardless of the environment before sourcing it). Can you try `rosws regerenate`? That should recreate the `setup.*sh` in the rosbuild workspace.
In this case, the first source in your bashrc sets up your environment to use the `/opt/ros/hydro` workspace, but the second line (indirectly sources `~/workspaces/hydro/catkin_ws/devel/setup.sh`) unsets this and sets up the state of the environment when that workspace, `~/workspaces/hydro/catkin_ws/devel/`, was built, which just happens to be the `/opt/ros/hydro` workspace. So it only appears to be "updating" or adding to the previous source line.
I ran rosws regenerate and it didn't work immediately. I tried commenting all lines except the one refering to the rosbuild_ws and it worked. So I guess the issue is that sourcing the rosbuild_ws line does not completely overwrite the native distro line (at least to the extent of some env variables)
Thanks for the help, William!