系统要求:Ubuntu20.04
ROS安装版本: Noetic
清华源配置
sudo gedit /etc/apt/sources.list#清华源deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse 1. ROS1安装添加 sources.list(设置你的电脑可以从 packages.ros.org 接收软件.)
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'添加 keys
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654安装ROS1桌面完整版
sudo apt updatesudo apt install ros-noetic-desktop-full环境测试
source /opt/ros/noetic/setup.bash补全rosdep
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essentialsudo apt install python3-rosdepsudo rosdep initrosdep update 2. ROS2安装确保系统要支持 UTF-8:
sudo locale-gen en_US en_US.UTF-8sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 export LANG=en_US.UTF-8设置软件源
sudo apt updatesudo apt install curl gnupg2 lsb-release# 下面这条语句,我的输出错误: gpg: no valid OpenPGP data found# curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -# 解决上面的问题,可以换成下面这条语句:$ curl http://repo.ros2.org/repos.key | sudo apt-key add - # 之后再添加源:sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'安装ROS2桌面完整版
sudo apt updatesudo apt install ros-foxy-desktopsudo apt install python3-colcon-common-extensions环境测试
source /opt/ros/foxy/setup.bash自动补全工具
sudo apt updatesudo apt install python3-argcompletesudo apt updatesudo apt install ros-foxy-rmw-connext-cpp安装ros1转换bridge
sudo apt updatesudo apt install ros-foxy-ros1-bridge ROS1和ROS2混合配置 …详情请参照古月居