ROS_VER=dashing WS_PATH=~/ros2_install echo -e "\e[103m\e[30m [ ROS2 $ROS_VER Install Helper ] \e[0m" echo -e "\e[93mMaking sure if system is up to date.\e[0m" sudo apt update sudo apt upgrade -y # sudo apt autoremove -y sudo apt clean echo -e "\e[93mPreparing locale.\e[0m" 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 echo -e "\e[93mAdd ROS2 repo and update package list.\e[0m" sudo apt install -y curl gnupg2 lsb-release curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list' sudo apt update echo -e "\e[93mInstall ROS2 $ROS_VER Desktop package with requisites.\e[0m" sudo apt install -y python3-pip ros-$ROS_VER-desktop echo -e "\e[93mSet ROS2 environment; Initialize ROS workspace at $WS_PATH\e[0m" pip3 install -U argcomplete echo "source /opt/ros/$ROS_VER/setup.bash" >> ~/.bashrc echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc echo "export _colcon_cd_root=$WS_PATH" >> ~/.bashrc source ~/.bashrc echo -e "\e[93mCheck ROS2 environment variables\e[0m" printenv | grep -i ROS echo -e "\e[93mInstalling additional tools\e[0m" echo -e "\e[92m[1] terminator\e[0m" sudo apt install -y terminator echo -e "\e[92m[2] rosserial\e[0m" sudo apt install -y ros-$ROS_VER-rosserial* echo -e "\e[92m[3] vscode (snap)\e[0m" sudo apt install -y snapd sudo snap install code echo -e "\e[92mROS2 $ROS_VER installation finished!"