系列文章目录
文章目录
- 系列文章目录
- 前言
- 一、系统设置
- 1.1 设置语言环境
- 1.2 启用所需的存储库
- 二、安装ROS2 及 GAZEBO
- 2.1. 安装 ROS2
- 2.2. 安装GAZEBO
前言
前提:已经安装好了 WSL 2 并且能够正常运行
一、系统设置
1.1 设置语言环境
locale # check for UTF-8
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
locale # verify settings
1.2 启用所需的存储库
sudo apt install software-properties-common
sudo add-apt-repository universe
添加 ROS2 GPG:
sudo apt update && sudo apt install curl -y
sudo apt install curl gnupg2
sudo curl -sSL https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
添加清华源镜像;:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] https://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
二、安装ROS2 及 GAZEBO
2.1. 安装 ROS2
sudo apt install ros-iron-desktop-full
添加 source 命令
# Replace ".bash" with your shell if you're not using bash
# Possible values are: setup.bash, setup.sh, setup.zsh
source /opt/ros/iron/setup.bash
2.2. 安装GAZEBO
sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt-get update
sudo apt-get install gz-harmonic