ROS2一步到胃

Version Humble, Iron Base is based on ubuntu 22.04 or Debian 11
Version Jazzy is based on ubuntu 24.04 or Debian 12

– Install ROS2

  • Set Locale
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
  • Enable required repositories

First ensure that the Ubuntu Universe repository is enabled

sudo apt install software-properties-common
sudo add-apt-repository universe

Now add the ROS 2 GPG key with apt

sudo vi /etc/hosts
[ Append ]
185.199.108.133 raw.githubusercontent.com

sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

Then add the repository to your sources list

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
  • Install development tools (optional)

If you are going to build ROS packages or otherwise do development, you can also install the development tools:

sudo apt update && sudo apt install ros-dev-tools
  • Install ROS 2
sudo apt upgrade
sudo apt update

Desktop Install (Recommended): ROS, RViz, demos, tutorials

sudo apt install ros-humble-desktop    # ROS2 LTS
or
sudo apt install ros-iron-desktop     # ROS2 Latest
or
sudo apt install ros-jazzy-desktop    # ROS2 v10

ROS-Base Install (Bare Bones): Communication libraries, message packages, command line tools. No GUI tools

sudo apt install ros-humble-ros-base
or
sudo apt install ros-iron-ros-base
or
sudo apt install ros-jazzy-ros-base
  • import env
source /opt/ros/humble/setup.bash
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
or
source /opt/ros/iron/setup.bash
echo "source /opt/ros/iron/setup.bash" >> ~/.bashrc
or
source /opt/ros/jazzy/setup.bash
echo "source /opt/ros/jazzy/setup.bash" >
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值