• 【声呐仿真】学习记录1.5-使用docker配置dave(先看这个!)、解决一些问题


    docker配置dave

    1

    之前文章中手动配置的环境,在运行dave_demo的时候有报错,很长时间没能解决

    所以又试了试官方提供的docker版本,可以正常运行demo

    所以建议直接用docker配,除了最开始拉取docker镜像部分有差别,其它基本一样

    步骤参考Docker环境|DAVE项目 — Docker Environment | Project DAVE

    2

    在执行./run.bash -c dockwater:noetic时,如果报错:在运行docker run …时,docker 未找到

    关闭ssh,重新连接

    然后使用以下命令创建容器(不要复制我的,可能会有信息不一样,复制你报错里的命令。然后可以参照我的,添加一下你需要的,命令介绍在之前的文章里有,dave官方的我也看不懂):

    注意:可能需要删除官方命令中的–rm,我有这个参数的话就会失败(报错docker未找到)

    docker run -it -p 50004:22 -v /home/ouc/ros_dave:/home/ouc --name dockwater_noetic_runtime --gpus all -v /dev:/dev -e DISPLAY -e TERM -e XAUTHORITY=/tmp/.dockerpznw0d90.xauth -v /tmp/.dockerpznw0d90.xauth:/tmp/.dockerpznw0d90.xauth -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all 869c5ad477cb /bin/bash

    3

    创建完容器后,就按照我之前的文章,配置可视化、配置cuda、下载代码编译运行,选配ssh远程

    运行demo结果如下:

    roslaunch dave_demo_launch dave_demo.launch
    
    • 1

    在这里插入图片描述


    以下为未完全解决问题的随手记录,待日后解决再补充

    1.pcap、png解决,libusb未解决(不要修改libusb相关的)

    在这里插入图片描述
    WARNING ** io features related to openni2 pcap png will be disabled_io features related to openni will be disabled-

    经查,png和usb系统都有:

    locate libpng | grep cmake
    locate libusb
    
    • 1
    • 2

    在这里插入图片描述
    只需安装pcap、配置:

    sudo apt-get install libpcap-dev
    
    • 1
    sudo gedit `locate PCLConfig.cmake`
    
    • 1

    搜索openni(),在下面添加:

      elseif("${_lib}" STREQUAL "png")
        find_package(PNG)
      elseif("${_lib}" STREQUAL "pcap")
        find_package(PCAP)  
      elseif("${_lib}" STREQUAL "libusb-1.0")
        find_package(LIBUSB_1)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    在这里插入图片描述
    在这里插入图片描述

    cp `locate libusb | grep cmake` /usr/share/cmake-3.16/Modules/FindLIBUSB_1.cmake
    
    • 1
     sudo gedit /usr/share/cmake-3.16/Modules/FindPCAP.cmake
    
    • 1
    # - Try to find libpcap include dirs and libraries
    #
    # Usage of this module as follows:
    #
    #     find_package(PCAP)
    #
    # Variables used by this module, they can change the default behaviour and need
    # to be set before calling find_package:
    #
    #  PCAP_ROOT_DIR             Set this variable to the root installation of
    #                            libpcap if the module has problems finding the
    #                            proper installation path.
    #
    # Variables defined by this module:
    #
    #  PCAP_FOUND                System has libpcap, include and library dirs found
    #  PCAP_INCLUDE_DIR          The libpcap include directories.
    #  PCAP_LIBRARY              The libpcap library (possibly includes a thread
    #                            library e.g. required by pf_ring's libpcap)
    #  HAVE_PF_RING              If a found version of libpcap supports PF_RING
    #  HAVE_PCAP_IMMEDIATE_MODE  If the version of libpcap found supports immediate mode
     
    find_path(PCAP_ROOT_DIR
        NAMES include/pcap.h
    )
     
    find_path(PCAP_INCLUDE_DIR
        NAMES pcap.h
        HINTS ${PCAP_ROOT_DIR}/include
    )
     
    set (HINT_DIR ${PCAP_ROOT_DIR}/lib)
     
    # On x64 windows, we should look also for the .lib at /lib/x64/
    # as this is the default path for the WinPcap developer's pack
    if (${CMAKE_SIZEOF_VOID_P} EQUAL 8 AND WIN32)
        set (HINT_DIR ${PCAP_ROOT_DIR}/lib/x64/ ${HINT_DIR})
    endif ()
     
    find_library(PCAP_LIBRARY
        NAMES pcap wpcap
        HINTS ${HINT_DIR}
    )
     
    include(FindPackageHandleStandardArgs)
    find_package_handle_standard_args(PCAP DEFAULT_MSG
        PCAP_LIBRARY
        PCAP_INCLUDE_DIR
    )
     
    include(CheckCXXSourceCompiles)
    set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY})
    check_cxx_source_compiles("int main() { return 0; }" PCAP_LINKS_SOLO)
    set(CMAKE_REQUIRED_LIBRARIES)
     
    # check if linking against libpcap also needs to link against a thread library
    if (NOT PCAP_LINKS_SOLO)
        find_package(Threads)
        if (THREADS_FOUND)
            set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
            check_cxx_source_compiles("int main() { return 0; }" PCAP_NEEDS_THREADS)
            set(CMAKE_REQUIRED_LIBRARIES)
        endif (THREADS_FOUND)
        if (THREADS_FOUND AND PCAP_NEEDS_THREADS)
            set(_tmp ${PCAP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
            list(REMOVE_DUPLICATES _tmp)
            set(PCAP_LIBRARY ${_tmp}
                CACHE STRING "Libraries needed to link against libpcap" FORCE)
        else (THREADS_FOUND AND PCAP_NEEDS_THREADS)
            message(FATAL_ERROR "Couldn't determine how to link against libpcap")
        endif (THREADS_FOUND AND PCAP_NEEDS_THREADS)
    endif (NOT PCAP_LINKS_SOLO)
     
    include(CheckFunctionExists)
    set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY})
    check_function_exists(pcap_get_pfring_id HAVE_PF_RING)
    check_function_exists(pcap_set_immediate_mode HAVE_PCAP_IMMEDIATE_MODE)
    check_function_exists(pcap_set_tstamp_precision HAVE_PCAP_TIMESTAMP_PRECISION)
    set(CMAKE_REQUIRED_LIBRARIES)
     
    mark_as_advanced(
        PCAP_ROOT_DIR
        PCAP_INCLUDE_DIR
        PCAP_LIBRARY
    )
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85

    2.ISO C++

    在这里插入图片描述
    不知道做了什么,突然成功了:
    在这里插入图片描述

    3.换源

    ROS换源(除了清华之外的ROS源)-

    Ubuntu22.04 解决 E: 无法定位软件包 yum_e: 无法定位软件包 libqt6opengl6-dev-
    以上没解决

    sudo cp -ra /etc/apt/sources.list /etc/apt/sources.list.bak
    sudo vi /etc/apt/sources.list
    
    deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    
    保存退出
    sudo apt-get update
    sudo apt-get upgrade
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    遇到问题:
    解决GPG 错误由于没有公钥,无法验证下列签名-

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys  xxx
    
    • 1

    解决后好了

    在这里插入图片描述

    4.自动安装相关依赖

    rosdep install --from-paths src --ignore-src -r -y
    
    • 1
  • 相关阅读:
    CAD如何自定义快捷键
    自定义springboot的生命周期函数在项目启动完成后去取配置文件中的值
    SQL每日一练(牛客新题库)——第5天:高级查询
    回溯算法高效需要注意这两点
    或许你也想做一个这样的动态魔方吗?
    数据结构 | Python实现列表队列 | 源码和示例
    TCP通信实现:多发多收消息、实现可以同时接收多个客户端
    鸿蒙(API 12 Beta3版)【获取支持的编解码能力】 音视频编码
    压缩和归档操作
    文章解读与仿真程序复现思路——电力自动化设备EI\CSCD\北大核心《氢耦合区域综合能源系统集群双层博弈随机优化调度策略》
  • 原文地址:https://blog.csdn.net/tfnmdmx/article/details/138013614