-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Source global ROS2 environment | ||
source /opt/ros/$ROS_DISTRO/setup.bash | ||
# Optionally perform apt update if it has not been executed yet | ||
if [ -z "$( ls -A '/var/lib/apt/lists' )" ]; then | ||
echo "apt-get update has not been executed yet. Running sudo apt-get update..." | ||
sudo apt-get update | ||
fi | ||
# Optionally perform rosdep update if it has not been executed yet | ||
if [ ! -d $HOME/.ros/rosdep/sources.cache ]; then | ||
echo "rosdep update has not been executed yet. Running rosdep update..." | ||
rosdep update | ||
fi | ||
# Optionally build the workspace if it has not been built yet | ||
if [ ! -f $ROS2_WS/install/setup.bash ]; then | ||
echo "Workspace has not been built yet. Building workspace..." | ||
cd $ROS2_WS | ||
# Ref: https://docs.ros.org/en/humble/Tutorials/Intermediate/Rosdep.html | ||
rosdep install --from-paths src --ignore-src -y -r | ||
# TODO: If command `arch` outputs `aarch64`, consider adding `--packages-ignore <package>` to ignore x86 packages | ||
# Ref: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html | ||
if [ $(arch) == "aarch64" ]; then | ||
colcon build --symlink-install | ||
else | ||
colcon build --symlink-install | ||
fi | ||
echo "Workspace built." | ||
fi | ||
# TODO: Source other workspace environments as underlay | ||
source ~/test_ws/install/local_setup.bash | ||
# Source workspace environment | ||
source $ROS2_WS/install/setup.bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
* | ||
!.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters