Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix script error when there is no default ros installation and the ro… #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions scripts/build_ros2_workspace.bash
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ if [ -z $ros_distro ]; then
else
# source the ROS2 environment (from arg)
source $ros_path
ros_path_sourced=1
fi
fi
;;
Expand All @@ -89,6 +90,7 @@ if [ -z $ros_distro ]; then
else
# source the ROS2 environment (from arg)
source $ros_path
ros_path_sourced=1
fi
fi
;;
Expand All @@ -97,8 +99,11 @@ if [ -z $ros_distro ]; then
exit 1
;;
esac
# source the ROS2 environment
source /opt/ros/$ROS_DISTRO/setup.bash
# source only if not already sourced from ros_path
if [ -z $ros_path_sourced ]; then
# source the ROS2 environment
source /opt/ros/$ROS_DISTRO/setup.bash
fi
else
if [ -z $ros_path ]; then
echo "- Warning: You set a ROS 2 manually to be used."
Expand Down