日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Installing ROS 2 on Ubuntu20.04 Linux

發布時間:2025/3/13 linux 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Installing ROS 2 on Ubuntu20.04 Linux 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Installing ROS 2 on Ubuntu20.04 Linux

1. Binary packages

We provide ROS 2 binary packages for the following platforms:

  • Ubuntu Linux - Focal Fossa (20.04)

    • Debian packages

    • “fat” archive

  • macOS

  • Windows

2. Building from source

We support building ROS 2 from source on the following platforms:

  • Ubuntu Linux

  • macOS

  • Windows

3. System requirements

The current Debian-based target platforms for Foxy Fitzroy are:

  • Tier 1: Ubuntu Linux - Focal Fossa (20.04) 64-bit

  • Tier 3: Debian Linux - Buster (10) 64-bit

Other Linux platforms with varying support levels include:

  • Arch Linux, see alternate instructions

  • Fedora Linux, see alternate instructions

  • OpenEmbedded / webOS OSE, see alternate instructions

4. System setup

4.1 Set locale

Make sure you have a locale which supports UTF-8. If you are in a minimal environment (such as a docker container), the locale may be something minimal like POSIX. We test with the following settings. However, it should be fine if you’re using a different UTF-8 supported locale.

locale # check for UTF-8sudo 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-8locale # verify settings

一次不成功,建議重復多次

4.2 Add the ROS 2 apt repository

You will need to add the ROS 2 apt repositories to your system. To do so, first authorize our GPG key with apt like this:

sudo apt update && sudo apt install curl gnupg2 lsb-release# 下面這條語句,我的輸出錯誤: gpg: no valid OpenPGP data found,可能你們還會有其他問題 # sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg# 解決上面的問題,可以換成下面這條語句: curl http://repo.ros2.org/repos.key | sudo apt-key add -

And 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 $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null# 官方源 sudo sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'

4.3 Install ROS 2 packages

(1)更新源

# 執行更新后,出現問題了 sudo apt updateN: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://packages.ros.org/ros2/ubuntu focal InRelease' doesn't support architecture 'i386'

參照 ROS 2 安裝后BUG,解決方法是:

$ cd /etc/apt/sources.list.d $ sudo gedit ros2-latest.list# 打開文本后出現: deb http://packages.ros.org/ros2/ubuntu bionic main# 在deb后插入[arch=amd64]變成: deb [arch=amd64] http://packages.ros.org/ros2/ubuntu bionic main# 保存并關閉# 再次更新即可 sudo apt update

如果更新出現問題,多試幾次

(2)安裝ROS2

推薦安裝ROS2桌面版本(包括ROS、RViz、demos、tutorials)

sudo apt install ros-foxy-desktop

如果出現問題,重復試幾次

4.4 Environment setup

(1)使用腳本來設置

如果你的 SHELL 是用 bash,就是:

source /opt/ros/foxy/setup.bash

如果你的 SHELL 是用 zsh 的,就是:

source /opt/ros/foxy/setup.zsh

以后每次打開終端都需要輸入一次上面的語句,比較麻煩。以 zsh 為例,解決方法:

echo "source /opt/ros/foxy/setup.zsh" >> ~/.zshrc source ~/.zshrc

這樣,以后每次新打開終端,就不需要輸入這條語句了 source /opt/ros/foxy/setup.zsh,終端會自動幫你加載這條語句,設置好 ROS2 的環境變量。

總結

以上是生活随笔為你收集整理的Installing ROS 2 on Ubuntu20.04 Linux的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。