Skip to content

Commit 3aa2bdb

Browse files
committed
all tools/ros scripts are officially in working state
1 parent 82c49ed commit 3aa2bdb

File tree

5 files changed

+32
-38
lines changed

5 files changed

+32
-38
lines changed

.todo.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- commit decent starter vscode configuration
2+
- commit decent starter .idea configuration
3+
- dev containers
4+
5+
https://www.allisonthackston.com/articles/vscode-docker-ros2.html

tools/ros/clean.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,13 @@ WS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." &> /dev/null && pwd )" #
88
# This workaround forces the urdf to freshly generated each build
99
rm -f "${WS_DIR}"/src/uirover_description/urdf/*.urdf
1010

11+
if apt -qq list python3-colcon-common-extensions 2> /dev/null | grep -q installed; then
12+
echo "colcon-common-extensions is already installed"
13+
else
14+
echo "Installing colcon-common-extensions"
15+
sudo apt update
16+
sudo apt install -y python3-colcon-common-extensions
17+
fi
18+
1119
(cd "$WS_DIR" && colcon clean workspace -y)
1220
(cd "$WS_DIR/src" && colcon clean workspace -y) # sometimes its easy to accidentally build in the src directory. This will clean that up too

tools/ros/install_dependencies.sh

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,8 @@ set -eo pipefail
33

44
WS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." &> /dev/null && pwd )" # workspace directory
55

6-
7-
if [ ! -d /etc/ros/rosdep/sources.list.d ]; then
8-
sudo apt install -y python3-rosdep
9-
sudo rosdep init
10-
fi
11-
12-
rosdep update --rosdistro jazzy
13-
rosdep install --from-paths "${WS_DIR}/src" --ignore-src -y
14-
15-
166
# other dependencies
17-
sudo apt install -y python3-colcon-common-extensions python3-colcon-clean libopencv-dev python3-pip python3-catkin-pkg python3-venv mapproxy
7+
sudo apt install -y libopencv-dev python3-pip python3-catkin-pkg python3-venv mapproxy
188

199
# gstreamer
2010
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
@@ -28,13 +18,6 @@ if ! command -v platformio > /dev/null; then
2818
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
2919
fi
3020

31-
# Foxglove Studio
32-
if [ ! -f /usr/bin/foxglove-studio ]; then
33-
wget https://get.foxglove.dev/desktop/latest/foxglove-studio-latest-linux-amd64.deb
34-
sudo apt install -y ./foxglove-studio-latest-linux-amd64.deb
35-
rm -f ./foxglove-studio-latest-linux-amd64.deb
36-
fi
37-
3821
echo
3922
echo
4023
echo "Success"

tools/ros/install_ros.sh

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,20 @@ set -eo pipefail
33

44
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
55

6-
# ensure ubuntu noble (24.04) is installed
7-
if ! command -v lsb_release &> /dev/null; then
8-
echo "ERROR: lsb_release is not installed. This likely means you are not running Ubuntu and ROS2 Jazzy is not supported on your system."
9-
echo "It is also possible (but unlikely) you are simply missing that package. In this case, you can install it with 'sudo apt install lsb-release'"
10-
exit 1
11-
fi
12-
136
if [ "$(lsb_release -cs)" != "noble" ]; then
147
echo "ERROR: Ubuntu noble is required. You have $(lsb_release -cs)"
158
exit 1
169
fi
1710

18-
# install ROS
19-
sudo apt install software-properties-common curl -y
11+
# install ROS https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html
12+
sudo apt install software-properties-common
2013
sudo add-apt-repository universe -y
21-
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
22-
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
23-
sudo apt update -y && sudo apt upgrade -y
14+
sudo apt update && sudo apt install curl -y
15+
export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}')
16+
curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo ${UBUNTU_CODENAME:-${VERSION_CODENAME}})_all.deb"
17+
sudo dpkg -i /tmp/ros2-apt-source.deb
18+
sudo apt update
19+
sudo apt upgrade
2420
sudo apt install ros-dev-tools ros-jazzy-desktop python3-colcon-argcomplete -y
2521

2622
# source ROS2 on opening terminal. Done by default since its assumed anyone with a level of expertise where they would not want this would also know how to remove it.
@@ -31,9 +27,10 @@ grep -qxF "source /opt/ros/jazzy/setup.bash" ~/.bashrc || echo "source /opt/ros/
3127
# Any ROS2 communication across machines should be done explicitly (i.e. with zenoh_bridge)
3228
grep -qxF "export ROS_AUTOMATIC_DISCOVERY_RANGE=LOCALHOST" ~/.bashrc || echo "export ROS_AUTOMATIC_DISCOVERY_RANGE=LOCALHOST" >> ~/.bashrc
3329

34-
# shellcheck source=/dev/null
35-
. /opt/ros/jazzy/setup.bash
36-
37-
# install project dependencies
38-
# shellcheck source=/dev/null
39-
. "$SCRIPT_DIR/install_dependencies.sh"
30+
echo
31+
echo
32+
echo
33+
echo "========================================"
34+
echo "ROS2 Jazzy installation complete!"
35+
echo "Restart your terminal or run 'source ~/.bashrc'"
36+
echo "========================================"

tools/ros/rosdep.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
WS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." &> /dev/null && pwd )" # workspace directory
44

5+
# install rosdep if not already
56
if ! apt -qq list python3-rosdep 2>/dev/null | grep -q installed; then
67
echo "Installing rosdep"
78
sudo apt update
89
sudo apt install -y python3-rosdep
910
fi
1011

11-
#!/bin/bash
12+
# initialize rosdep if not already
1213
if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then
1314
sudo rosdep init
1415
fi
15-
rosdep update
1616

17+
rosdep update
1718
# --ignore-src: ignore deps that can be found in src
1819
# -r: continue despite errors
1920
# -y: assume yes to all prompts

0 commit comments

Comments
 (0)