日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ROS1 noetic + depthai_ros教程

發布時間:2024/8/1 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ROS1 noetic + depthai_ros教程 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

編輯:OAK中國
首發:oakchina.cn
喜歡的話,請多多👍???

▌前言

Hello,大家好,這里是OAK中國,我是助手君。

之前有小伙伴表示OAK相機在C++上用起來有問題,我們的技術小哥們也立馬安排起來了!C++的開發環境終于打包好啦!

本文來自OAK中國的使用文檔,教程可能會不定期更新,最新內容請查看官網。

ROS上使用預編譯的depthai C++ 庫

▌測試結果

depthai-ros(Gen2)安裝包下載鏈接:點擊這里

測試設備詳情
測試一平臺:X86 PC端;系統:ubuntu18.04;ROS版本:melodic;depthai版本:2.15.0;設備:OAK-D
測試二平臺:X86 PC端;系統:ubuntu20.04;ROS版本:noetic;depthai版本:2.15.0;設備:OAK-D
測試三平臺:arch64 Jetson nano;系統:ubuntu18.04;ROS版本:melodic;depthai版本:2.15.0;設備:OAK-D
  • 目前X86和arch64平臺測試安裝包沒有問題;樹莓派上安裝ROS需要自己編譯安裝,時間比較長,需要測試的可以到官網查看,替換下面安裝ROS步驟就可以了。
  • ROS的noetic版本目前推薦在ubuntu20.04安裝,ubuntu18.04推薦安裝melodic版本。
  • ▌開始

    (以下步驟是ubuntu18.04 melodic版本)

    安裝依賴項

    更新 usb 規則

    sudo wget -qO- https://mirror.ghproxy.com/https://raw.githubusercontent.com/luxonis/depthai-docs-website/master/source/_static/install_dependencies.sh | bash sudo dpkg -i ./depthai_2.14.1_x86_64.deb

    depthai core安裝包 下載地址

    sudo apt install ./depthai_2.15.0_x86_64_Shared.deb

    如果您沒有安裝 opencv,請嘗試

    sudo apt install libopencv-dev

    Jetson平臺不需要安裝opencv,系統自帶。

    如果您未安裝rosdep且未初始化,請執行以下步驟:(這里安裝的是melotic版本,如果想要安裝ROS的其他版本,前往官網下載,建議安裝ros基礎版,缺什么包再裝)

    sudo apt update sudo apt upgrade# 設置sources.list sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' # 如果下載速度較慢,使用以下命令替換上面的命令 sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list' # 如果依然遇到連接失敗問題,請嘗試換源https://developer.aliyun.com/mirror/ubuntu# 設置密鑰 sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 # 若無法連接到密鑰服務器,可以嘗試替換上面命令中的 hkp://keyserver.ubuntu.com:80 為 hkp://pgp.mit.edu:80 。sudo apt update sudo apt install ros-melodic-ros-base sudo apt install python-rosdep sudo rosdep init rosdep update# 設置環境 echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc source ~/.bashrc

    需要安裝的ros其他包

    sudo apt install ros-melodic-rviz

    設置程序

    mkdir -p <directory_for_workspaces>/src cd <directory_for_workspaces> git clone https://gitee.com/oakchina/depthai-ros.git cd ../.. rosdep install --from-paths src --ignore-src -r -y source /opt/ros/melodic/setup.bash catkin_make source devel/setup.bash

    執行示例

    cd <directory_for_workspaces> source devel/setup.bash roslaunch depthai_examples stereo_node.launch

    運行示例

    Mobilenet Publisher

    OAK-D

    roslaunch depthai_examples mobile_publisher.launch camera_model:=OAK-D

    OAK-D-LITE

    roslaunch depthai_examples mobile_publisher.launch camera_model:=OAK-D-LITE

    帶可視化器

    roslaunch depthai_examples mobile_publisher.launch | rqt_image_view -t /mobilenet_publisher/color/image

    測試結果

    ● ImageConverter - 使用 roslaunch depthai_examples stereo_inertial_node.launch && roslaunch depthai_examples rgb_publisher.launch 測試
    ● ImgDetectionCnverter - 測試使用 roslaunch depthai_examples mobile_publisher.launch
    ● SpatialImgDetectionConverter - 測試使用 roslaunch depthai_examples stereo_inertial_node.launch

    ▌常見問題解決

    1.執行catkin_make出現的錯誤1

    上述問題解決辦法

    2.執行catkin_make出現的錯誤2

    /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to `TIFFSetErrorHandler@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to `TIFFSetDirectory@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to `TIFFReadScanline@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to `TIFFNumberOfTiles@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0: undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0' collect2: error: ld returned 1 exit status make[2]: *** [luxonis/depthai-ros-examples/depthai_examples/CMakeFiles/rgb_node.dir/build.make:181/home/xiaotang/depthai_build/devel/lib/depthai_examples/rgb_node] 錯誤 1 make[1]: *** [CMakeFiles/Makefile2:2382:luxonis/depthai-ros-examples/depthai_examples/CMakeFiles/rgb_node.dir/all] 錯誤 2

    遇到上面問題,檢查是否把conda環境取消

    3.執行catkin_make出現的錯誤3

    ModuleNotFoundError: No module named 'pkg_resources'

    解決方法:

    sudo apt install --reinstall python3-pkg-resources python3-setuptools

    OAK中國 | 追蹤AI技術和產品新動態
    公眾號 | OAK視覺人工智能開發
    點「這里」添加微信好友(備注來意)
    戳「+關注」獲取最新資訊↗↗

    ▌參考資料

    https://docs.oakchina.cn/en/latest/
    https://www.oakchina.cn/selection-guide/


    OAK中國
    | OpenCV AI Kit在中國區的官方代理商和技術服務商
    | 追蹤AI技術和產品新動態

    戳「+關注」獲取最新資訊↗↗

    總結

    以上是生活随笔為你收集整理的ROS1 noetic + depthai_ros教程的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。