当前位置:   article > 正文

ubuntu22源码安装ros-noetic_ros noetic ubunut 22

ros noetic ubunut 22

参考链接:

https://blog.csdn.net/zyh821351004/article/details/135523056

https://gist.github.com/Meltwin/fe2c15a5d7e6a8795911907f627255e0

瞎折腾才到这一步的,网络环境自己搞定

1、准备工作

  1. 这一步是为了下面顺利安装依赖包,修改/etc/apt/sources.list.d/ros-latest.list文件内容为(默认为jammy):
    deb http://packages.ros.org/ros/ubuntu focal main
  2.  安装依赖
    sudo apt-get install python3-rosdep python3-rosinstall-generator python3-vcstools python3-vcstool build-essential

  3.  更改rosdep存储库地址,修改/etc/ros/rosdep/sources.list.d/20-default.list如下:
    1. # os-specific listings first
    2. yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
    3. # generic
    4. #yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
    5. yaml https://gist.githubusercontent.com/Meltwin/0317ae7481c94da7fd66c3eea8d40740/raw/04f6404249b0430523671410891815e63eadb2fe/base.yaml
    6. yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
    7. yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
    8. gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte
    9. # newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead

  4.  执行rosdep update 即可

 2、安装

  1. 创建catkin Workspace,安装依赖
    1. mkdir ./noetic_ws
    2. cd ./noetic_ws
    3. rosinstall_generator desktop --rosdistro noetic --deps --tar > noetic-desktop.rosinstall
    4. mkdir ./src
    5. vcs import --input noetic-desktop.rosinstall ./src
    6. rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro noetic -y
  2.  构建源码
    ./src/catkin/bin/catkin_make_isolated -DCMAKE_BUILD_TYPE=Release

 3、将会遇到的问题

1、可能会遇到的错误与 rosconsole 和 log4cxx 相关:

打开src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp并将其内容替换为https://raw.githubusercontent.com/ros/rosconsole/9f930c007dd40aa7ede771b8859b529e024d7bfb/src/rosconsole/impl/rosconsole_log4cxx.cpp

 2、可能遇到的错误是 C++ 编译版本。当包想要使用 C++11 编译并使用 C++17 中的对象时,就会出现问题,从下方链接下载脚本后执行 python3 change_cpp.py即可(在noetic_ws目录下)

https://gist.githubusercontent.com/Meltwin/1ee35296d2bb86fee19d639580e3c91f/raw/13b8d626733981cdf58244708e5cba1ee5d87e1c/change_cpp.py

 3、期间编译中断基本都是缺少库的问题,按需下载即可,可以提前下载一些,分享一下我遇到的:

  1. #参考链接里面的安装
  2. sudo apt install libopencv-dev
  3. sudo apt install libassimp-dev python3-pyassimp
  4. sudo apt install libogre-1.12-dev
  5. sudo apt install libogre1.12.10
  6. sudo apt install libqt5widgets5 qtcreator qtbase5-dev qt5-qmake cmake
  7. sudo apt install sip-dev python3-sip-dev python3-pyqt5.sip
  8. sudo apt install python3-pyqt5.sip python3-pyqt5 pyqt5-dev
  9. #我遇到的
  10. sudo apt-get install libtinyxml-dev
  11. sudo apt-get install liborocos-kdl-dev
  12. sudo apt-get install liburdfdom-headers-dev
  13. sudo apt-get install liburdfdom-dev
  14. sudo apt-get install libyaml-cpp-dev
  15. sudo apt-get install libturbojpeg-dev
  16. sudo apt-get install libogg-dev
  17. sudo apt-get install libtheora-dev
  18. sudo apt-get install libpoco-dev
  19. sudo apt-get install libtinyxml2-dev
  20. sudo apt-get install liblog4cxx-dev
  21. sudo apt-get install libbz2-dev
  22. sudo apt-get install libgpgme-dev

编译完成提示:<== Finished processing package [188 of 188]: 'xacro',我这里显示188是因为加入了一些额外需要编译的ros包,至此,source一下,即可使用了,有什么问题可以留言

补充:rqt_bag 命令不可用,可参考下面链接修改src/rqt_bag/src/rqt_bag/timeline_frame.py,重新编译即可使用https://github.com/ros-visualization/rqt_bag/pull/109/commits/6ba817ed1c09c01ea25f4ce6131f5b88c8b9ace3

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/木道寻08/article/detail/962585
推荐阅读
相关标签
  

闽ICP备14008679号