[Share Experiences] Deepin V20 安装ROS机器人操作系统
Tofloor
poster avatar
keyinme
deepin
2021-02-02 07:47
Author

前言

从ubuntu转过来的,deepin是最好看的linux应该没人反驳吧。转过来之后,发现安装的ROS的教程很少啊,虽然应该跟ubuntu差别也不大,都是基于debian的,但还是没那么简单,得下载源码自己编译安装。经过两三天的踩坑,终于安装上了,与大家分享。(至于ROS是干什么的,详见ROS官网以及ROS wiki

 

安装

参考教程见deepin 15.11 安装ROS Melodic

一步一步跟着走下去,几乎一步一个坎,下面把走过的坑做个记录,分享给有需要的人。

1. sudo rosdep init

    报错:

        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.

    解决:连不上raw.githubusercontent.com,DNS问题

        sudo /etc/hosts 添加

        #当前可用ip 2021-01-29

        151.101.84.133  raw.githubusercontent.com

        140.82.113.4        github.com

        185.199.111.153     assets-cdn.github.com

        199.232.69.194      github.global.ssl.fastly.net

2. rosdep update

    报错:连不上

        reading in sources list data from /etc/ros/rosdep/sources.list.d

        ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]:

    

    解决:挂VPN

 

    报错2:

        ERROR: Rosdep experienced an error: Could not detect OS, tried ['zorin', 'windows', 'nixos', 'clearl

 

    解决2:修改/etc/lsb-realse中DISTRIB_ID 为debian

 

3. rosdep install --from-paths src  --ignore-src --rosdistro melodic -y --os=debian:stretch

    最后报错:应该问题不大,暂时忽略

        E: 软件包 python-imaging 没有可安装候选

        ERROR: the following rosdeps failed to install

        apt: command [sudo -H apt-get install -y python-imaging] failed

4. ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

    1)==> cmake /home/king/ros_catkin_ws/src/catkin -DCATKIN_DEVEL_PREFIX=/home/king/ros_catkin_ws/devel_isolated/catkin -DCMAKE_INSTALL_PREFIX=/home/king/ros_catkin_ws/install_isolated -DCMAKE_BUILD_TYPE=Release -G Unix Makefiles in '/home/king/ros_catkin_ws/build_isolated/catkin'

        Unhandled exception of type 'OSError':

        Traceback (most recent call last):

          File "./src/catkin/bin/../python/catkin/builder.py", line 1068, in build_workspace_isolated

            number=index + 1, of=len(ordered_packages)

          File "./src/catkin/bin/../python/catkin/builder.py", line 755, in build_package

            destdir=destdir, use_ninja=use_ninja, use_nmake=use_nmake, use_gmake=use_gmake

          File "./src/catkin/bin/../python/catkin/builder.py", line 400, in build_catkin_package

            run_command_colorized(cmake_cmd, build_dir, quiet, add_env=add_env)

          File "./src/catkin/bin/../python/catkin/builder.py", line 189, in run_command_colorized

            run_command(cmd, cwd, quiet=quiet, colorize=True, add_env=add_env)

          File "./src/catkin/bin/../python/catkin/builder.py", line 207, in run_command

            raise OSError("Failed command '%s': %s" % (cmd, e))

 

        .... No such file

 

        解决:没安装cmake

            安装最新cmake https://blog.csdn.net/hometing218/article/details/79516686

                (安装cmake过程如果报openssl错误,则sudo apt-get install libssl-dev)

 

    2)CMake Error at cmake/empy.cmake:30 (message):

        Unable to find either executable 'empy' or Python module 'em'...  try

        installing the package 'python-empy'

 

        解决:sudo apt-get install python-empy

 

 

    3)Could not find a package configuration file provided by "console_bridge"

        with any of the following names:

    

            console_bridgeConfig.cmake

            console_bridge-config.cmake

 

        解决:sudo apt-get install libconsole-bridge-dev

 

    4)CMake Error at /home/king/ros_catkin_ws/install_isolated/share/cmake_modules/cmake/Modules/FindPoco.cmake:189 (MESSAGE):

        Poco was not found.  Set the Poco_INCLUDE_DIR cmake cache entry to the

        top-level directory containing the poco include directories.  E.g

 

        解决:安装poco https://blog.csdn.net/xie1xiao1jun/article/details/78841575

 

    5)

        CMake Error at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):

 

        Could NOT find TinyXML (missing: TinyXML_LIBRARY TinyXML_INCLUDE_DIR)

 

        解决:sudo apt-get install libtinyxml-dev

 

    6)

        from PyQt5 import QtCore

    

        ImportError: No module named PyQt5

    

            解决:sudo apt-get install python-pyqt5

    

    7)

        raise FileNotFoundError('The sip directory for PyQt5 could not be located. Please ensure' +

        

        NameError: global name 'FileNotFoundError' is not defined

        

        sudo apt-get install sip-dev pyqt5-dev python-sip-dev pyqt5-dev-tools

    

    

    

    8)

        

        Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)

        sudo apt-get install libcurl4-openssl-dev

    

    9)

        

        gtest gmock

        

        https://blog.csdn.net/u012654838/article/details/46578377?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.control

        

        sudo apt-get install libgtest-dev

        sudo apt-get install libgmock-dev

    

    10)

    

        GPGME_LIBRARY

        

        sudo apt-get install libgpgme-dev

    

    11)

    

        gtk2.0,3.0安装完还是找不到gtk.h

    

        sudo cp -pr /usr/include/gtk-2.0/gdk /usr/include/

        sudo cp -pr /usr/include/gtk-2.0/gtk /usr/include/

    

    12)

    

        gazebo报错

    

        gazebo --version查看版本,我的为9

        安装对应版本libgazebo9-dev

    

    13)

    

        卡死在 [100%] Built target pcl_ros_filters

    

        解决:按原教程换编译指令

            ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release -j1 -l1

    

        卡在下载table_scene_lms400.pcd

        手动下载到你的目录下即可 http://download.ros.org/data/pcl/table_scene_lms400.pcd

        放到/home/XXXXXX/ros_catkin_ws/devel_isolated/pcl_ros/share/pcl_ros/samples/data/文件夹

    

    

    14)

    

        安装到229/237报错,明明assimp安装好了,但是没有assimp.hpp

        

        [ 10%] Building CXX object src/rviz/CMakeFiles/rviz.dir/ogre_helpers/billboard_line.cpp.o

        /home/king/ros_catkin_ws/src/rviz/src/rviz/mesh_loader.cpp:61:10: fatal error: assimp/assimp.hpp: 没有那个文件或目录

         #include

                  ^~~~~~~~~~~~~~~~~~~

        compilation terminated.

        make[2]: *** [src/rviz/CMakeFiles/rviz.dir/build.make:329:src/rviz/CMakeFiles/rviz.dir/mesh_loader.cpp.o] 错误 1

        make[2]: *** 正在等待未完成的任务....

        [ 10%] Linking CXX executable /home/king/ros_catkin_ws/devel_isolated/rviz/lib/rviz/interactive_marker_test

        [ 10%] Built target interactive_marker_test

        make[1]: *** [CMakeFiles/Makefile2:3157:src/rviz/CMakeFiles/rviz.dir/all] 错误 2

        make: *** [Makefile:160:all] 错误 2

        <== Failed to process package 'rviz': 

          Command '['/home/king/ros_catkin_ws/install_isolated/env.sh', 'make', '-j8', '-l8']' returned non-zero exit status 2

        

        Reproduce this error by running:

        ==> cd /home/king/ros_catkin_ws/build_isolated/rviz && /home/king/ros_catkin_ws/install_isolated/env.sh make -j8 -l8

        

        Command failed, exiting.

    

    

    ...................... 第二天重新编译,好了,可能需要重启吧 ..........................

    

    15)

    

        roscore

    

        报错ImportError: No module named defusedxml.xmlrpc

        

        解决:

        sudo apt-get install python-defusedxml

        缺啥就安装啥

-------------------------------------- 大功告成 ------------------------------------------

和还有很多缺少依赖或找不到的,一个个安装吧,手动变异安装就是这么的麻烦,请大佬指点!!

 

总结

1)网络问题,要么换网络,要么挂vpn,要么手动下载下来之类的;

2)各种依赖库没装上,手动安装,缺的还不少;

3)没事重启电脑、重开终端,可能有用。

Reply Favorite View the author
All Replies
wetshoes
deepin
2021-02-02 19:11
#1

沙发支持

Reply View the author