From 1b024da250ba253daff775f0ebf1948b684b6595 Mon Sep 17 00:00:00 2001 From: Anadon Date: Sun, 1 Dec 2024 21:13:56 -0500 Subject: [PATCH 1/9] Prototyping one-off build script --- build-everything.sh | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 build-everything.sh diff --git a/build-everything.sh b/build-everything.sh new file mode 100644 index 0000000..a631d39 --- /dev/null +++ b/build-everything.sh @@ -0,0 +1,65 @@ +#! /usr/bin/env bash + +git clone https://github.com/lajoiepy/cslam.git +git clone https://github.com/lajoiepy/cslam_interfaces.git +git clone https://github.com/lajoiepy/cslam_experiments.git + +pip install -r requirements.txt + +sudo apt-get install libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions + +git clone git@github.com:borglab/gtsam.git + +pushd gtsam || exit 1 + +echo "WARNING!!! This deviates from the Swarm-Slam instructions by using gtsam v4.2 and not 4.1.1." +mkdir build +cd build || exit 1 +cmake .. + # make check (optional, runs unit tests) +sudo make install + +popd || exit 1 + +################## +# ROS 2 OS SETUP # +################## + +echo "WARNING!!! This deviates from Swarm-Slam instructions by using ROS 2 Jazzy instead of Foxy" + +locale # check for UTF-8 + +sudo apt update && sudo apt install locales +sudo locale-gen en_US en_US.UTF-8 +sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 +export LANG=en_US.UTF-8 + +locale # verify settings + +sudo apt install software-properties-common +sudo add-apt-repository universe + +sudo apt update && sudo apt install curl -y +sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg + +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo "$UBUNTU_CODENAME") main" | sudo tee "/etc/apt/sources.list.d/ros2.list" > /dev/null + +sudo apt update && sudo apt install ros-dev-tools + +sudo apt update + +sudo apt install ros-jazzy-desktop + +echo "WARNING!!! This is setting up a one-time configuration change because it is destructive to your environment. This installer is REQUIRING that you take manual action to make this change permenent." + +# Replace ".bash" with your shell if you're not using bash +# Possible values are: setup.bash, setup.sh, setup.zsh + +source "/opt/ros/jazzy/setup.bash" + +sudo rosdep init + +rosdep update +rosdep install --from-paths src -y --ignore-src --rosdistro jazzy + +colcon test From 3eb7b6cd8350b3be1b784c04d8b4961cf15a4490 Mon Sep 17 00:00:00 2001 From: Anadon Date: Sun, 1 Dec 2024 22:32:13 -0500 Subject: [PATCH 2/9] After one round of testing and debugging. --- build-everything.sh | 69 +++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/build-everything.sh b/build-everything.sh index a631d39..ebd9640 100644 --- a/build-everything.sh +++ b/build-everything.sh @@ -1,14 +1,51 @@ #! /usr/bin/env bash + + +if (( $EUID == 0 )); then + add-apt-repository universe + apt update +else + sudo add-apt-repository universe + sudo apt update +fi + + +DEPS_0="curl git sudo" +DEPS_1="libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions sudo git software-properties-common locales python3-dev python3-full python3-pip" +DEPS_2="ros-dev-tools ros-jazzy-desktop" + +if (( $EUID == 0 )); then + apt install -y $DEPS_0 +else + sudo apt install -y $DEPS_0 +fi + git clone https://github.com/lajoiepy/cslam.git git clone https://github.com/lajoiepy/cslam_interfaces.git git clone https://github.com/lajoiepy/cslam_experiments.git +git clone https://github.com/borglab/gtsam.git -pip install -r requirements.txt +if (( $EUID == 0 )); then + apt install -y $DEPS_1 +else + sudo apt install -y $DEPS_1 +fi + +sudo locale-gen en_US en_US.UTF-8 +sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 +export LANG=en_US.UTF-8 + +sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg + +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo "$UBUNTU_CODENAME") main" | sudo tee "/etc/apt/sources.list.d/ros2.list" > /dev/null -sudo apt-get install libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions -git clone git@github.com:borglab/gtsam.git +sudo apt update +sudo apt install $DEPS_2 + +pip install -r requirements.txt + pushd gtsam || exit 1 @@ -26,30 +63,6 @@ popd || exit 1 ################## echo "WARNING!!! This deviates from Swarm-Slam instructions by using ROS 2 Jazzy instead of Foxy" - -locale # check for UTF-8 - -sudo apt update && sudo apt install locales -sudo locale-gen en_US en_US.UTF-8 -sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 -export LANG=en_US.UTF-8 - -locale # verify settings - -sudo apt install software-properties-common -sudo add-apt-repository universe - -sudo apt update && sudo apt install curl -y -sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg - -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo "$UBUNTU_CODENAME") main" | sudo tee "/etc/apt/sources.list.d/ros2.list" > /dev/null - -sudo apt update && sudo apt install ros-dev-tools - -sudo apt update - -sudo apt install ros-jazzy-desktop - echo "WARNING!!! This is setting up a one-time configuration change because it is destructive to your environment. This installer is REQUIRING that you take manual action to make this change permenent." # Replace ".bash" with your shell if you're not using bash @@ -62,4 +75,4 @@ sudo rosdep init rosdep update rosdep install --from-paths src -y --ignore-src --rosdistro jazzy -colcon test +colcon test From ac0516dd94f6f3532de5fe5c16a6f5c187b7ba97 Mon Sep 17 00:00:00 2001 From: Anadon Date: Sun, 1 Dec 2024 22:34:32 -0500 Subject: [PATCH 3/9] Forgot a flag. --- build-everything.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-everything.sh b/build-everything.sh index ebd9640..97aa01a 100644 --- a/build-everything.sh +++ b/build-everything.sh @@ -42,7 +42,7 @@ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-a sudo apt update -sudo apt install $DEPS_2 +sudo apt install -y $DEPS_2 pip install -r requirements.txt From f0c0ad19214d3744cfd5a9f6675c27a478f0e9ef Mon Sep 17 00:00:00 2001 From: Anadon Date: Sun, 1 Dec 2024 23:25:55 -0500 Subject: [PATCH 4/9] Second round of testing and debugging. --- build-everything.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-everything.sh b/build-everything.sh index 97aa01a..797bff7 100644 --- a/build-everything.sh +++ b/build-everything.sh @@ -13,7 +13,7 @@ fi DEPS_0="curl git sudo" DEPS_1="libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions sudo git software-properties-common locales python3-dev python3-full python3-pip" -DEPS_2="ros-dev-tools ros-jazzy-desktop" +DEPS_2="ros-dev-tools ros-jazzy-desktop ros-jazzy-rtabmap ros-jazzy-rtabmap-msgs" if (( $EUID == 0 )); then apt install -y $DEPS_0 @@ -68,11 +68,12 @@ echo "WARNING!!! This is setting up a one-time configuration change because it i # Replace ".bash" with your shell if you're not using bash # Possible values are: setup.bash, setup.sh, setup.zsh -source "/opt/ros/jazzy/setup.bash" +echo 'source "/opt/ros/jazzy/setup.bash"' >> ~/.bashrc sudo rosdep init rosdep update rosdep install --from-paths src -y --ignore-src --rosdistro jazzy +colcon build colcon test From 1e9b1cd92cafdce6c2057d0ef81bd6d866f76108 Mon Sep 17 00:00:00 2001 From: Anadon Date: Mon, 2 Dec 2024 01:40:51 -0500 Subject: [PATCH 5/9] Third round of testing and debugging. --- build-everything.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-everything.sh b/build-everything.sh index 797bff7..1560454 100644 --- a/build-everything.sh +++ b/build-everything.sh @@ -11,9 +11,9 @@ else fi -DEPS_0="curl git sudo" +DEPS_0="curl git sudo apt-utils" DEPS_1="libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions sudo git software-properties-common locales python3-dev python3-full python3-pip" -DEPS_2="ros-dev-tools ros-jazzy-desktop ros-jazzy-rtabmap ros-jazzy-rtabmap-msgs" +DEPS_2="ros-dev-tools ros-jazzy-desktop ros-jazzy-rtabmap ros-jazzy-rtabmap-msgs ros-jazzy-navigation2 ros-jazzy-nav2-bringup ros-jazzy-nav2-minimal-tb* ros-jazzy-perception-pcl ros-jazzy-rtabmap-conversions ros-rolling-cv-bridge " if (( $EUID == 0 )); then apt install -y $DEPS_0 @@ -21,7 +21,7 @@ else sudo apt install -y $DEPS_0 fi -git clone https://github.com/lajoiepy/cslam.git +git clone https://github.com/anadon/cslam.git git clone https://github.com/lajoiepy/cslam_interfaces.git git clone https://github.com/lajoiepy/cslam_experiments.git git clone https://github.com/borglab/gtsam.git From f9307fbd6688fe4e9aad74fd78b36526612c2f9b Mon Sep 17 00:00:00 2001 From: Anadon Date: Mon, 2 Dec 2024 02:30:18 -0500 Subject: [PATCH 6/9] Round four of testing and debugging. --- build-everything.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/build-everything.sh b/build-everything.sh index 1560454..3d70e62 100644 --- a/build-everything.sh +++ b/build-everything.sh @@ -11,8 +11,8 @@ else fi -DEPS_0="curl git sudo apt-utils" -DEPS_1="libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions sudo git software-properties-common locales python3-dev python3-full python3-pip" +DEPS_0="curl git sudo apt-utils ncurses locales" +DEPS_1="libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions sudo git software-properties-common python3-dev python3-full python3-pip" DEPS_2="ros-dev-tools ros-jazzy-desktop ros-jazzy-rtabmap ros-jazzy-rtabmap-msgs ros-jazzy-navigation2 ros-jazzy-nav2-bringup ros-jazzy-nav2-minimal-tb* ros-jazzy-perception-pcl ros-jazzy-rtabmap-conversions ros-rolling-cv-bridge " if (( $EUID == 0 )); then @@ -21,6 +21,11 @@ else sudo apt install -y $DEPS_0 fi +sudo locale-gen en_US en_US.UTF-8 +sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 +export LANG=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 + git clone https://github.com/anadon/cslam.git git clone https://github.com/lajoiepy/cslam_interfaces.git git clone https://github.com/lajoiepy/cslam_experiments.git @@ -32,9 +37,6 @@ else sudo apt install -y $DEPS_1 fi -sudo locale-gen en_US en_US.UTF-8 -sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 -export LANG=en_US.UTF-8 sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg @@ -69,11 +71,19 @@ echo "WARNING!!! This is setting up a one-time configuration change because it i # Possible values are: setup.bash, setup.sh, setup.zsh echo 'source "/opt/ros/jazzy/setup.bash"' >> ~/.bashrc +source "/opt/ros/jazzy/setup.bash" sudo rosdep init rosdep update rosdep install --from-paths src -y --ignore-src --rosdistro jazzy -colcon build -colcon test +pushd cslam_interfaces || exit 1 +colcon build + echo 'source "/Swarm-Slam/cslam_interfaces/install/setup.bash"' >> "$HOME/.bashrc" + source "/Swarm-Slam/cslam_interfaces/install/setup.bash" +popd || exit 1 + +colcon build +colcon test + From c5105210551b53d5263843dcff46b106a6978745 Mon Sep 17 00:00:00 2001 From: Anadon Date: Mon, 2 Dec 2024 02:40:20 -0500 Subject: [PATCH 7/9] Round five of testing and debugging. --- build-everything.sh | 47 ++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/build-everything.sh b/build-everything.sh index 3d70e62..2284e79 100644 --- a/build-everything.sh +++ b/build-everything.sh @@ -1,28 +1,25 @@ #! /usr/bin/env bash - - -if (( $EUID == 0 )); then - add-apt-repository universe - apt update +if (( EUID == 0 )); then + SUDO="" else - sudo add-apt-repository universe - sudo apt update + SUDO="sudo" fi -DEPS_0="curl git sudo apt-utils ncurses locales" +$SUDO add-apt-repository universe +$SUDO apt update + + +DEPS_0="curl git sudo apt-utils ncurses-term locales" DEPS_1="libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions sudo git software-properties-common python3-dev python3-full python3-pip" -DEPS_2="ros-dev-tools ros-jazzy-desktop ros-jazzy-rtabmap ros-jazzy-rtabmap-msgs ros-jazzy-navigation2 ros-jazzy-nav2-bringup ros-jazzy-nav2-minimal-tb* ros-jazzy-perception-pcl ros-jazzy-rtabmap-conversions ros-rolling-cv-bridge " +DEPS_2="ros-dev-tools ros-jazzy-desktop ros-jazzy-rtabmap ros-jazzy-rtabmap-msgs ros-jazzy-navigation2 ros-jazzy-nav2-bringup ros-jazzy-nav2-minimal-tb* ros-jazzy-perception-pcl ros-jazzy-rtabmap-conversions ros-rolling-cv-bridge " -if (( $EUID == 0 )); then - apt install -y $DEPS_0 -else - sudo apt install -y $DEPS_0 -fi +$SUDO apt install -y "$DEPS_0" -sudo locale-gen en_US en_US.UTF-8 -sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 + +$SUDO locale-gen en_US en_US.UTF-8 +$SUDO update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 @@ -31,20 +28,15 @@ git clone https://github.com/lajoiepy/cslam_interfaces.git git clone https://github.com/lajoiepy/cslam_experiments.git git clone https://github.com/borglab/gtsam.git -if (( $EUID == 0 )); then - apt install -y $DEPS_1 -else - sudo apt install -y $DEPS_1 -fi +$SUDO apt install -y "$DEPS_1" - -sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg +$SUDO curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo "$UBUNTU_CODENAME") main" | sudo tee "/etc/apt/sources.list.d/ros2.list" > /dev/null -sudo apt update -sudo apt install -y $DEPS_2 +$SUDO apt update +$SUDO apt install -y "$DEPS_2" pip install -r requirements.txt @@ -56,7 +48,7 @@ mkdir build cd build || exit 1 cmake .. # make check (optional, runs unit tests) -sudo make install +$SUDO make install popd || exit 1 @@ -73,7 +65,7 @@ echo "WARNING!!! This is setting up a one-time configuration change because it i echo 'source "/opt/ros/jazzy/setup.bash"' >> ~/.bashrc source "/opt/ros/jazzy/setup.bash" -sudo rosdep init +$SUDO rosdep init rosdep update rosdep install --from-paths src -y --ignore-src --rosdistro jazzy @@ -86,4 +78,3 @@ popd || exit 1 colcon build colcon test - From 957e1de0041a27d7e3720d771d069ffdc0090398 Mon Sep 17 00:00:00 2001 From: Anadon Date: Mon, 2 Dec 2024 02:42:37 -0500 Subject: [PATCH 8/9] Shelcheck was over-zealous. --- build-everything.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-everything.sh b/build-everything.sh index 2284e79..48d8066 100644 --- a/build-everything.sh +++ b/build-everything.sh @@ -15,7 +15,7 @@ DEPS_0="curl git sudo apt-utils ncurses-term locales" DEPS_1="libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions sudo git software-properties-common python3-dev python3-full python3-pip" DEPS_2="ros-dev-tools ros-jazzy-desktop ros-jazzy-rtabmap ros-jazzy-rtabmap-msgs ros-jazzy-navigation2 ros-jazzy-nav2-bringup ros-jazzy-nav2-minimal-tb* ros-jazzy-perception-pcl ros-jazzy-rtabmap-conversions ros-rolling-cv-bridge " -$SUDO apt install -y "$DEPS_0" +$SUDO apt install -y $DEPS_0 $SUDO locale-gen en_US en_US.UTF-8 @@ -28,7 +28,7 @@ git clone https://github.com/lajoiepy/cslam_interfaces.git git clone https://github.com/lajoiepy/cslam_experiments.git git clone https://github.com/borglab/gtsam.git -$SUDO apt install -y "$DEPS_1" +$SUDO apt install -y $DEPS_1 $SUDO curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg @@ -36,7 +36,7 @@ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-a $SUDO apt update -$SUDO apt install -y "$DEPS_2" +$SUDO apt install -y $DEPS_2 pip install -r requirements.txt From d67b080cc1ac0e25a565238f1deca221987aefe2 Mon Sep 17 00:00:00 2001 From: Anadon Date: Mon, 2 Dec 2024 03:28:43 -0500 Subject: [PATCH 9/9] Final tweaks. --- build-everything.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build-everything.sh b/build-everything.sh index 48d8066..7bb5593 100644 --- a/build-everything.sh +++ b/build-everything.sh @@ -10,8 +10,9 @@ fi $SUDO add-apt-repository universe $SUDO apt update +export DEBIAN_FRONTEND=noninteractive -DEPS_0="curl git sudo apt-utils ncurses-term locales" +DEPS_0="curl git sudo apt-utils dialog locales" DEPS_1="libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions sudo git software-properties-common python3-dev python3-full python3-pip" DEPS_2="ros-dev-tools ros-jazzy-desktop ros-jazzy-rtabmap ros-jazzy-rtabmap-msgs ros-jazzy-navigation2 ros-jazzy-nav2-bringup ros-jazzy-nav2-minimal-tb* ros-jazzy-perception-pcl ros-jazzy-rtabmap-conversions ros-rolling-cv-bridge " @@ -72,9 +73,13 @@ rosdep install --from-paths src -y --ignore-src --rosdistro jazzy pushd cslam_interfaces || exit 1 colcon build - echo 'source "/Swarm-Slam/cslam_interfaces/install/setup.bash"' >> "$HOME/.bashrc" - source "/Swarm-Slam/cslam_interfaces/install/setup.bash" + echo 'source "/Swarm-SLAM/cslam_interfaces/install/setup.bash"' >> "$HOME/.bashrc" + source "/Swarm-SLAM/cslam_interfaces/install/setup.bash" popd || exit 1 colcon build -colcon test +colcon test + +echo 'source "/Swarm-SLAM/install/setup.bash"' >> "$HOME/.bashrc" +source "/Swarm-SLAM/install/setup.bash" +