在Windows10的WSL2中的Ubuntu22.04子系统中安装ros2 humble版本。
官方文档http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html
准备工作:

  1. 修改默认镜像源,使用国内清华tuna镜像源加速,参考https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
  2. 添加ros2软件仓库,参考https://mirrors.tuna.tsinghua.edu.cn/help/ros2/

接下来按照官方文档进行安装,需要注意的是:

  1. 如果python版本较新的话,兼容性方面可能会出一些问题。
  2. WSL子系统中编译失败很可能是因为子系统虚拟机内存不足,可修改WSL配置多分配些内存,参考https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configure-global-options-with-wslconfig
  3. setuptools版本问题,新版本中一些工具被弃用,需要降级到旧版本pip install setuptools==58.2.0,参考https://answers.ros.org/question/396439/setuptoolsdeprecationwarning-setuppy-install-is-deprecated-use-build-and-pip-and-other-standards-based-tools/
  4. rosdep初始化报错:原因在于raw.githubusercontent.com无法访问,可以通过修改hosts文件解决,或者使用rosdepc替代.参考
    https://blog.csdn.net/weixin_53660567/article/details/120607176?spm=1001.2014.3001.5501
点击查看错误信息
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
posted on 2022-09-06 15:45  lmore  阅读(94)  评论(0编辑  收藏  举报