Skip to content

install/setup.bash in overlay workspace does not source /opt/ros/<distro> from Debian packages #653

Closed

Description

@Karsten1987

Bug report

When working with the binary installation and a custom overlay workspace on top of it, sourcing the setup.bash of the overlay workspace does not recursively source the binary installation.

Required Info:

  • Operating System:
    • Ubuntu 18.04
  • Installation type:
    • binaries with custom overlay workspace
  • Version or commit hash:
    • latest binaries (crystal)

Steps to reproduce issue

Steps are inspired from this Dockerfile

sudo apt-get install ros-crystal-desktop  #install binaries
mkdir -p ~/ros2_overlay/src
cd $_
git clone <repo name>
cd -
source /opt/ros/crystal/setup.bash
colcon build

in a fresh terminal now:

cd ~/ros2_overlay
source install/setup.bash
ros2

Expected behavior

ros2 entry point found

usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...

ros2 is an extensible command-line tool for ROS 2.

optional arguments:
  -h, --help            show this help message and exit

Commands:
  daemon  Various daemon related sub-commands

  Call `ros2 <command> -h` for more detailed usage.

Actual behavior

ros2 is not found, meaning the binaries workspace was not recursively sourced when sourcing the workspace install setup.bash

bash: ros2: command not found

Additional information

When sourcing the binary workspace /opt/ros/crystal/setup.bash beforehand (manually) followed by sourcing the workspace it works fine.

Also when compiling everything from source, the chaining of workspaces works as expected. I believe something during the packaging process might prevent this functionality.

Activity

  1. added
    bug
    on Jan 29, 2019
  2. changed the title [-]install.sh in overlay workspace does not source binaries[/-] [+]install/setup.bash in overlay workspace does not source binaries[/+] on Jan 29, 2019
  3. dirk-thomas commented on Jan 29, 2019

    @dirk-thomas
    Member

    The prefix level setup files generated by colcon in the overlay workspace only consider workspaces listed in the COLCON_PREFIX_PATH environment variable. Since the Debian packages under /opt/ros/... are not being built by colcon they don't set that environment variable - only AMENT_PREFIX_PATH.

    That is also the reason why it works when the underlay workspace was built locally with colcon and only fails with the Debian packages.

    I am not sure what the best long term solution for this is atm but as a short term fix I would suggest to add an environment hook to the ros_workspace package which sets COLCON_PREFIX_PATH to the same value as AMENT_PREFIX_PATH.

  4. added
    in review
    on Jan 31, 2019
  5. codebot commented on Feb 4, 2019

    @codebot
    Member

    Thanks for looking into this. I'm in the same situation as @Karsten1987 👍

  6. changed the title [-]install/setup.bash in overlay workspace does not source binaries[/-] [+]install/setup.bash in overlay workspace does not source /opt/ros/<distro> from Debian packages[/+] on Feb 7, 2019
  7. dirk-thomas commented on Feb 7, 2019

    @dirk-thomas
    Member

    Addressed by ros2/ros_workspace#11.

  8. removed
    in review
    on Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions