@@ -3,24 +3,20 @@ set -eo pipefail
33
44SCRIPT_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-
136if [ " $( lsb_release -cs) " != " noble" ]; then
147 echo " ERROR: Ubuntu noble is required. You have $( lsb_release -cs) "
158 exit 1
169fi
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
2013sudo 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
2420sudo 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)
3228grep -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 " ========================================"
0 commit comments