Catkin generates working setup.bash, but broken setup.sh

asked 2021-05-28 18:29:28 -0500

rgov gravatar image

updated 2021-05-28 18:35:45 -0500

The following command creates a new Bash shell with an empty environment, loads the workspace's setup.bash, and then executes roslaunch. It works.

$ env -i /bin/bash -c "cd /home/user/myproject; . ./devel/setup.bash; roslaunch myproject myproject.launch"

But if we use sh instead of Bash, it does not:

$ env -i /bin/sh -c "cd /home/user/myproject; . ./devel/setup.sh; roslaunch myproject myproject.launch"
RLException: [myproject.launch] is neither a launch file in package [myproject] nor is [myproject] a launch file name

If we diff the two environments set up by setup.sh and setup.bash, we have several differences, including this key one:

-ROS_PACKAGE_PATH=/home/user/myproject/build/catkin_tools_prebuild:/opt/ros/melodic/share
+ROS_PACKAGE_PATH=/home/user/myproject/src/myproject:/opt/ros/melodic/share

Yet even after cleaning and rebuilding from scratch, this issue persists. What is causing it?


This is Ubuntu 18.04 with ROS Melodic on arm64, and

$ catkin --version
catkin_tools 0.6.1 (C) 2014-2021 Open Source Robotics Foundation
catkin_tools is released under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
---
Using Python 2.7.17 (default, Feb 27 2021, 15:10:58) [GCC 7.5.0]
edit retag flag offensive close merge delete

Comments

1

Possibly related to this 5 year old (!) bug: https://github.com/catkin/catkin_tool...

rgov gravatar image rgov  ( 2021-05-28 18:48:36 -0500 )edit