您的当前位置:首页>新品 > 正文

怎么安装ROS2-Foxy?ROS2-Foxy二进制安装方法步骤

来源:CSDN 时间:2023-01-10 10:01:10

一、环境

ubuntu 20.04 LTS(Foxy)

二、安装步骤


(资料图)

0x01. 换清华ROS2镜像源

1. 新建源list

sudo vi /etc/apt/sources.list.d/ros2-latest.list

2.编辑内容

deb https://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/ focal main

3.更新索引

# 1.确保安装curl、gnugp2工具sudo apt install curl gnupg2# 2.获取秘钥并用apt-key工具更新curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -# 3.更新源列表sudo apt update

注:若是访问githubusercontent.com失败的话,或提示gpg: no valid OpenPGP data found,可以用以下方法:

# 1.手动创建秘钥文件vi ros.asc# 2.填写以下秘钥内容到ros.asc文件:-----BEGIN PGP PUBLIC KEY BLOCK-----mQINBFzvJpYBEADY8l1YvO7iYW5gUESyzsTGnMvVUmlV3XarBaJz9bGRmgPXh7jcVFrQhE0L/HV7LOfoLI9H2GWYyHBqN5ERBlcA8XxG3ZvX7t9nAZPQT2Xxe3GT3trou5oCR+SyHN9xPnUwDuqUSvJ2eqMYb9B/Hph3OmtjG30jSNq9kOF5bBTk1hOTGPH4K/AY0jzT6OpHfXU6ytlFsI47ZKsnTUhipGsKucQ1CXlyirndZ3V3k70YaooZ55rGaIoAWlx2H0J7sAHmqS29N9jV9mo135d+d+TdLBXI0PXtiHzE9IPaX+ctdSUrPnp+TwR99lxglpIG6hLuvOMAaxiqFBB/Jf3XJ8OBakfS6nHrWH2WqQxRbiITl0irkQozpwNEF2Bv0+Jvs1UFEdVGz5a8xexQHst/RmKrtHLct3iOCvBNqoAQRbvWvBhPjO/pV5cYeUljZ5wpHyFkaEViClaVWqa6PIsyLqmyjsruPCWlURLsQoQxABcL8bwxX7UThM6CtH6tGlYZ85RIzRifIm2oudzV5l+8oRgFr9yVcwyOFT6JCioqkwldW52P1pk//SnuexC6LYqqDuHUs5NnokzzpfS6QaWfTY5P5tz4KHJfsjDIktly3mKVfY0fSPVVokdGpcUzvz2hq1fqjxB6MlB/1vtk0bImfcsoxBmF7H+4E9ZN1sX/tSb0KQARAQABtCZPcGVuIFJvYm90aWNzIDxpbmZvQG9zcmZvdW5kYXRpb24ub3JnPokCVAQTAQoAPhYhBMHPbjHmut6IaLFytPQu1vurF8ZUBQJc7yaWAhsDBQkDwmcABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEPQu1vurF8ZUkhIP/RbZY1ErvCEUy8iLJm9aSpLQnDZl5xILOxyZlzpg+Ml5bb0EkQDr92foCgcvLeANKARNCaGLyNIWkuyDovPV0xZJrEy0kgBrDNb3++NmdI/+GA92pkedMXXioQvqdsxUagXAIB/sNGByJEhs37F05AnFvZbjUhceq3xTlvAMcrBWrgB4NwBivZY6IgLvl/CRQpVYwANShIQdbvHvZSxRonWhNXr6v/Wcf8rsp7g2VqJ2N2AcWT84aa9BLQ3Oe/SgrNx4QEhA1y7rc3oaqPVu5ZXOK+4O14JrpbEZ3Xs9YEjrcOuEDEpYktA8qqUDTdFyZrxb9S6BquUKrA6jZgT913kjJ4e7YAZobC4rH0w4u0PrqDgYOkXA9Mo7L601/7ZaDJob80UcK+Z12ZSw73IgBix6DiJVfXuWkk5PM2zsFn6UOQXUNlZlDAOj5NC01V0fJ8P0v6GO9YOSSQx0j5UtkUbRfp/4W7uCPFvwAatWEHJhlM3sQNiMNStJFegr56xQu1a/cbJH7GdbseMhG/f0BaKQqXCI3ffB5y5AOLc9Hw7PYiTFQsuY1ePRhE+J9mejgWRZxkjAH/FlAubqXkDgterCh+sLkzGf+my2IbsMCuc+3aeNMJ5Ej/vlXefCH/MpPWAHCqpQhe2DET/jRSaM53USAHNx8kw4MPUkxExgI7Sd=4Ofr-----END PGP PUBLIC KEY BLOCK-----# 3.在ros.asc同一目录执行命令sudo apt-key add ros.asc# 4.更新ros2源sudo apt-get update

0x02. 安装ROS2包

安装ros2桌面版(ros、rviz、demos、tutorials)

sudo apt install ros-foxy-desktop -y

0x03. 加载ROS2环境

运行命令,每次以当前用户打开bashshell自动加载:

echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc

0x04. 安装ROS2命令行自动补全工具

sudo apt install -y python3-pippip3 install -U argcomplete

0x05. 运行测试例子

1、新开终端,运行自带教程的广播者

ros2 run demo_nodes_cpp talker

2、新开终端,运行自带教程的监听者

ros2 run demo_nodes_py listener

标签:

最新新闻:

新闻放送
Top