当前位置:   article > 正文

1.ubuntu安装ROS2_sudo curl -ssl

sudo curl -ssl

Ubuntu 20.04安装ROS2


参考ROS2官方安装文档,安装ROS2。安装过程中会遇到如下问题

报错 1

运行

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
  • 1

时报错:

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
  • 1
  • 解决方案:

    1. 使用工具,找到raw.githubusercontent.com对应的ip地址185.199.110.133

    2. sudo vim /etc/hosts,在最后添加 185.199.110.133 raw.githubusercontent.com

      127.0.0.1       localhost
      127.0.1.1       dc-virtual-machine
      
      # The following lines are desirable for IPv6 capable hosts
      ::1     ip6-localhost ip6-loopback
      fe00::0 ip6-localnet
      ff00::0 ip6-mcastprefix
      ff02::1 ip6-allnodes
      ff02::2 ip6-allrouters
      185.199.110.133 raw.githubusercontent.com
      
      • 1
      • 2
      • 3
      • 4
      • 5
      • 6
      • 7
      • 8
      • 9
      • 10
    3. 重新执行

      sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
      
      • 1
    4. 如果还是不行,打开手机热点,pc连接手机热点之后重新执行。

报错 2

运行

rosdep update
  • 1

时报错:

reading in sources list data from /etc/ros/rosdep/sources.list.d
ERROR: error loading sources list:
	The read operation timed out
  • 1
  • 2
  • 3
  • 解决方案

    1. sudo vim /etc/ros/rosdep/sources.list.d/20-default.list修改文件,添加https://ghproxy.com/前缀

      # os-specific listings first
      yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
      
      # generic
      yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
      yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
      yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
      gbpdistro https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte
      
      # newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
      
      • 1
      • 2
      • 3
      • 4
      • 5
      • 6
      • 7
      • 8
      • 9
      • 10
    2. 重新执行

      rosdep update
      
      • 1
    3. 如果还是不行,打开手机热点,pc连接手机热点之后重新执行。

    4. 也可以运行以下脚本,直到rosdep update运行成功。

       #!/bin/bash
      
      for (( ;; ))
      do
         rosdep update
         if(($? == 0))
         then
            exit
         fi
      done
      
      • 1
      • 2
      • 3
      • 4
      • 5
      • 6
      • 7
      • 8
      • 9
      • 10

报错 3

运行

. ~/ros2_galactic/ros2-linux/setup.bash
  • 1

时报错:

[connext_cmake_module] Warning: The location at which Connext was found when the workspace was built [[/opt/rti.com/rti_connext_dds-5.3.1]] does not point to a valid directory, and the NDDSHOME environment variable has not been set. Support for Connext will not be available.
  • 1
  • 解决方案:

    1. 安装RTI Connext

      sudo apt install -q -y rti-connext-dds-5.3.1
      
      • 1
    2. 导入设置文件设置 NDDSHOME 环境变量

      cd /opt/rti.com/rti_connext_dds-5.3.1/resource/scripts && source ./rtisetenv_x64Linux3gcc5.4.0.bash; cd -
      
      • 1
    3. 重新执行

      . ~/ros2_galactic/ros2-linux/setup.bash
      
      • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/719154
推荐阅读
相关标签
  

闽ICP备14008679号