Ubuntu 22.04 系统中 ROS2安装
ROS2安装
sudo apt update
sudo apt install tilix
打开软件,点击右上角图标进入设置 -> General -> size120, columns:48 Command -> 勾选第一个 Run command as login shell Color -> Theme Color 选择 Monokai Dark
sudo apt install python3-pip
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
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install curl gnupg2 -y
sudo curl -sSL https://gitee.com/tyx6/rosdistro/raw/master/ros.key -o /etc/apt/trusted.gpg.d/ros.gpg
echo "deb [arch=$( dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/ros.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 --fix-broken install
sudo apt update && sudo apt install ros-dev-tools
sudo apt update && sudo apt upgrade
sudo apt install ros-iron-desktop
echo "" "
source /opt/ros/iron/setup.bash
"" " >> ~/.bashrc
测试
source /opt/ros/iron/setup.bash
ros2 run demo_nodes_cpp talker
source /opt/ros/iron/setup.bash
ros2 run demo_nodes_py listener
卸载
printenv | grep -i ROS
sudo apt remove ~nros-iron-* && sudo apt autoremove
sudo rm /etc/apt/sources.list.d/ros2.list
sudo apt update
sudo apt autoremove
sudo apt upgrade