欧美vvv,亚洲第一成人在线,亚洲成人欧美日韩在线观看,日本猛少妇猛色XXXXX猛叫

新聞資訊

    像下載、域名解析、時間同步請點擊

    阿里巴巴開源鏡像站-OPSX鏡像站-阿里云開發者社區


    AutoWare.auto 安裝實踐

    1. 相關程序版本說明

    ubuntu版本:20.04 ADE:4.4.0

    Autoware.auto版本(基于ROS2):autoware.auto foxy, ros foxy

    2. Docker安裝

    以下操作,請確定自己已經換源了,不然下載很慢的,參考Ubuntu20.04軟件源更換 - 知乎

    Ubuntu系統中,軟件源文件地址為:/etc/apt/sources.list

    1.備份原來的源,將以前的源備份一下,以防以后可以用的。

    $ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

    2.打開/etc/apt/sources.list文件,在前面添加如下條目,并保存。

    $ sudo vim /etc/apt/sources.list(可將vim更換為自己熟悉的編輯器)

    添加阿里源

    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
    

    3.更新

    更新源

    $ sudo apt-get update

    如出現依賴問題,解決方式如下:

    $ sudo apt-get -f install

    更新軟件:

    $ sudo apt-get upgrade

    官方安裝教程:Install Docker Engine on Ubuntu | Docker Documentation

    // 卸載舊版本docker

    #Uninstall old versions
    $ sudo apt-get remove docker docker-engine docker.io containerd runc
    
    #Uninstall Docker Engine
    $ sudo apt-get purge docker-ce docker-ce-cli containerd.io
    $ sudo rm -rf /var/lib/docker
    $ sudo rm -rf /var/lib/containerd
    

    // 使用docker repository安裝docker engine

    #step1:在新主機上首次安裝Docker Engine之前,需要設置Docker存儲庫。之后,您可以從存儲庫安裝和更新Docker
    #更新apt軟件包索引并安裝軟件包,以允許apt通過HTTPS使用存儲庫
    $ sudo apt-get install \
        ca-certificates \
        curl \
        gnupg \
        lsb-release
    
    #Step2:Add Docker’s official GPG key:
    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    
    #Step3:Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. Learn about nightly and test channels.
    $ echo \
      "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
      $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
      
    #Step4:Install Docker Engine
    $ sudo apt-get update
    $ sudo apt-get install docker-ce docker-ce-cli containerd.io //如果沒有指定版本,默認安裝最高版本
    
    #Step5:Verify that Docker Engine is installed correctly by running the hello-world image.
    $ sudo docker run hello-world
    
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    

    Manage Docker as a non-root user

    # 創建docker用戶組
    $ sudo groupadd docker
    #將當前用戶加入docker用戶組
    $ sudo usermod -aG docker $USER
    #Log out and log back in so that your group membership is re-evaluated.
    $ newgrp docker 
    #Verify that you can run docker commands without sudo.
    $ docker run hello-world
    
    $ sudo chmod 666 /var/run/docker.sock
    #重啟電腦或者重啟docker服務
    $ sudo systemctl daemon-reload
    $ sudo systemctl restart docker
    $ sudo docker login registry.gitlab.com # Use token from Gitlab
    

    3. Autoware.auto容器安裝

    3.1 程序說明

    基于Docker封裝的開發容器,包含以下內容:

    3.2 ADE安裝

    ADE 是模塊化的 Docker-based 工具,它確保所有的開發者構建項目時有一個共同的、一致的開發環境

    官網安裝文檔:Installation — ADE 4.4.0dev documentation

    #install it in “/usr/local/bin” PATH
    $ cd  /usr/local/bin 
    $ sudo wget https://gitlab.com/ApexAI/ade-cli/-/jobs/1859684348/artifacts/raw/dist/ade+x86_64
    $ sudo mv ade+x86_64 ade
    $ sudo chmod +x ade
    $ which ade
    /path/to/ade
    # 查看ade版本號
    $ ade --version
    <version>
    # Update ade
    $ sudo ./ade update-cli     #這個地方需要一段時間
    Newer version available:
      4.4.0
      4.3.0
      4.2.0
    Do you want to update to version 4.4.0 [y/N]: y
    
    <!-- '注意:升級ade版本可能會報錯 “PermissionError: [Errno 13] Permission denied: '/usr/local/bin/ade'”,切換root用戶再次執行,問題解決'->
    

    3.3 Autoware容器安裝

    官網安裝文檔:Installation with ADE

    1. 使用ADE安裝Autoware.auto環境,ROS2和Autoware.auto已經預編譯,安裝了二進制版本,默認安裝在/opt目錄下
    $ mkdir -p ~/adehome
    $ cd ~/adehome
    $ touch .adehome
    $ git clone https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git
    '注意:不要使用官網視頻課程里面的遞歸循環安裝,編譯會報錯' 
    'git clone --recurse-submodules https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git'
    
    $ cd AutowareAuto
    
    #拉取一些其他分支到master
    $ vcs import < autoware.auto.$ROS_DISTRO.repos
    
    #切換到發布分支,如果不切換,默認使用master 分支代碼,可能包含一些正在開發的功能,建議切換穩定發布版本
    $ git checkout tags/1.0.0 -b release-1.0.0
    
    #共享環境變量
    $ cd ~
    $ mv ~/.bashrc ~/adehome/.bashrc
    $ ln -s ~/adehome/.bashrc
    
    $ cd ~/adehome/AutowareAuto
    #其實,有很多預先配置好的ADE環境供我們選擇,官網提供了三個ADE配置文件:AMD64/ARM64/AMD64+LGSVL
    $ ls -l .aderc*
    
    lrwxrwxrwx 1 wtcl wtcl  17 12月 23 12:14 .aderc -> .aderc-amd64-foxy
    -rw-rw-r-- 1 wtcl wtcl 407 12月 23 12:25 .aderc-amd64-dashing
    -rw-rw-r-- 1 wtcl wtcl 499 12月 23 12:25 .aderc-amd64-dashing-lgsvl
    -rw-rw-r-- 1 wtcl wtcl 401 12月 23 12:25 .aderc-amd64-foxy
    -rw-rw-r-- 1 wtcl wtcl 490 12月 23 12:25 .aderc-amd64-foxy-lgsvl
    lrwxrwxrwx 1 wtcl wtcl  17 12月 23 12:14 .aderc-arm64 -> .aderc-arm64-foxy
    -rw-rw-r-- 1 wtcl wtcl 407 12月 23 12:25 .aderc-arm64-dashing
    -rw-rw-r-- 1 wtcl wtcl 401 12月 23 12:25 .aderc-arm64-foxy
    lrwxrwxrwx 1 wtcl wtcl  23 12月 23 12:14 .aderc-lgsvl -> .aderc-amd64-foxy-lgsvl
    
    #可以看到有好幾種可選的環境,其中.aderc-lgsvl對應的環境中包含LGSVL模擬器。然后,可以通過如下命令,切換并進入相應的ADE環境:
    #二選一安裝,這個地方安裝有點慢,需要等待一會,ade --rc 命令可以加載并啟動相關的鏡像容器
    $ ade --rc .aderc-amd64-foxy  start --update --enter
    
    <!-- '注意:啟動ade報錯 
    “Starting ade with the following images:
    ade-foxy    | ec7293d289ad | master | registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/ade-foxy:master   
    binary-foxy | 9ffc6c658b7a | master | registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/binary-foxy:master
    ade_registry.gitlab.com_autowarefoundation_autoware.auto_autowareauto_amd64_binary-foxy_master
    xhost:  unable to open display "localhost:10.0"
    WARNING: Could not find xhost, you won't be able to launch X applications"
    解決辦法:設置本地顯示命令-- $ export DISPLAY=localhost:10.0 $ xhost +>
    
    #What is where inside ADE?
    ade$ls /opt
    AutowareAuto # image: binary-foxy:master
    lgsvl        # image: ade-lgsvl/foxy:2020.06
    ros          # image: ade-foxy:master
    

    ade安裝過程中可能需要訪問gitlab的令牌,需要登錄gitlab申請

    In one terminal, source the setup file and then run a C++ talker:
    
    ade$ ade enter
    ade$ source ~/AutowareAuto/install/setup.bash
    ade$ ros2 run demo_nodes_cpp talker
    In another terminal source the setup file and then run a Python listener:
    
    ade$ cd ~/AutowareAuto
    ade$ source ~/AutowareAuto/install/setup.bash
    ade$ ros2 run demo_nodes_py listener
    You should see the talker saying that it’s Publishing messages and the listener saying I heard those messages. This verifies both the C++ and Python APIs are working properly. Hooray!
    
    #docker容器 清理無用鏡像,卷
    $ cd ~/adehome/AutowareAuto
    $ ade start
    
    #To assess the disk usage situation, run the following command:
    $ docker system df
    
    #Use docker system prune to remove any Docker items not used for currently running containers:
    $ docker system prune -a --volumes
    
    #Restart your system after installing the new NVIDIA driver.
    ade$ exit
    $ ade stop
    $ ade start --update --enter
    

    安裝完成后運行

    ade $ros2 run demo_nodes_cpp talker 不工作,沒辦法,繼續使用源碼進行編譯安裝

    issue回復:colcon build failed on trajectory.hpp file not found (#67) · Issues · ApexAI / AutowareClass2020 · GitLab

    1. 使用源碼編譯安裝Autoware.auto 和 ROS2

    Autoware.auto官網安裝文檔:Installation w/o ADE

    ROS2官網安裝文檔:Building ROS 2 on Ubuntu Linux — ROS 2 Documentation: Foxy documentation

    #如果安裝了舊版本,先卸載
    $ sudo apt-get purge ros-foxy*
    $ sudo rm -rf /etc/ros
    $ sudo gedit ~/.bashrc
    刪除那個東西bash
    $ source ~/.bashrc
    ?
    #安裝編譯工具包
    #Apt packages
    $ sudo apt install -y git cmake python3-pip
    ?
    #Python modules
    $ pip3 install -U colcon-common-extensions vcstool
    ?
    #First, the ROS 2 core components and tools must be installed
    ?
    #安裝ROS2核心包
    ?
    #設置語言環境,確保語言環境支持UTF-8
    $ locale  # check for UTF-8
    ?
    #只檢查是否有可用更新,給出匯總報告和提示信息
    $ sudo apt update
    ?
    #查看可升級的軟件的全部版本信息
    $ sudo apt list --upgradable -a
    $ sudo apt install locales
    $ sudo locale-gen en_US en_US.UTF-8
    $ sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
    $ export LANG=en_US.UTF-8
    $ locale  # verify settings
    ?
    #確保ros2倉庫可用
    $ apt-cache policy | grep universe
    ?
    #如果不可用,執行下面命令
    $ sudo apt install software-properties-common
    $ sudo add-apt-repository universe
    ?
    #需要在系統中添加ROS 2 apt存儲庫。為此,請首先使用如下所示的apt授權GPG密鑰:
    #Now add the ROS 2 apt repository to your system. First authorize our GPG key with apt.
    $ sudo apt update
    $ sudo apt install curl gnupg lsb-release
    $ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key  -o /usr/share/keyrings/ros-archive-keyring.gpg
    ?
    #然后將存儲庫添加到源列表中 
    #Then add the repository to your sources list.
    $  echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
    ?
    #Install development tools and ROS tools
    sudo apt update && sudo apt install -y \
      build-essential \
      cmake \
      git \
      python3-colcon-common-extensions \
      python3-flake8 \
      python3-pip \
      python3-pytest-cov \
      python3-rosdep \
      python3-setuptools \
      python3-vcstool \
      wget
    # install some pip packages needed for testing
    python3 -m pip install -U \
      flake8-blind-except \
      flake8-builtins \
      flake8-class-newline \
      flake8-comprehensions \
      flake8-deprecated \
      flake8-docstrings \
      flake8-import-order \
      flake8-quotes \
      pytest-repeat \
      pytest-rerunfailures \
      pytest
      
    # install Fast-RTPS dependencies
    sudo apt install --no-install-recommends -y \
      libasio-dev \
      libtinyxml2-dev
    # install Cyclone DDS dependencies
    sudo apt install --no-install-recommends -y \
      libcunit1-dev
    ?
    # Get ROS 2 code 
    # ROS2源碼下載,Install ROS 2 packages 
    $ mkdir -p ~/ros2_foxy/src
    $ cd ~/ros2_foxy
    $ wget https://raw.githubusercontent.com/ros2/ros2/foxy/ros2.repos
    $ vcs import src < ros2.repos
    ?
    #Install dependencies using rosdep
    $ sudo apt update
    $ sudo rm -rf /etc/ros/rosdep/sources.list.d/20-default.list
    $ sudo rosdep init
    $ rosdep update
    $ rosdep install --from-paths src --reinstall --ignore-src -y --rosdistro=foxy --skip-keys "fastcdr rti-connext-dds-5.3.1 urdfdom_headers"
    $ rosdep check --from-paths src --ignore-src -y --skip-keys "fastcdr  rti-connext-dds-5.3.1 urdfdom_headers"
    ?
    'Note: If you’re using a distribution that is based on Ubuntu (like Linux Mint) but does not identify itself as such, you’ll get an error message like Unsupported OS [mint]. In this case append --os=ubuntu:focal to the above command.'
    #rti-dds可以單獨安裝
    #https://docs.ros.org/en/foxy/Installation/DDS-Implementations.html
    ?
    #工作空間編譯源碼安裝
    #檢查ROS環境變量,確保沒有使用“source /opt/ros/${ROS_DISTRO}/setup.bash”設置過環境變量
    $ printenv | grep -i ROS  #如果顯示空,后面編譯會有問題
    PWD=/pathto/ros2_foxy
    $ cd ~/ros2_foxy/
    $ colcon build --symlink-install
    $ colcon test
    $ colcon test-result --verbose
    ?
    ?
    #Demo test,In one terminal, source the setup file and then run a C++ talker:
    $ source ~/ros2_foxy/install/setup.bash
    $ ros2 run demo_nodes_cpp talker
    ?
    #In another terminal source the setup file and then run a Python listener:
    $ source ~/ros2_foxy/install/setup.bash
    $ ros2 run demo_nodes_py listener
    ?
    =================================================以上是ROS2 源碼安裝,下面是安裝Autoware.auto源碼安裝  =============================
    ?
    $ export ROS_DISTRO = foxy
    $ echo $ROS_DISTRO
    ?
    #ROS2安裝完成后, 設置環境變量
    $ source ~/ros2_foxy/install/setup.bash
    ?
    #將ROS環境變量添加到bashrc文件里面
    $ echo "source ~/ros2_foxy/install/setup.bash" >> ~/.bashrc
    $ source ~/.bashrc
    ?
    # Autoware.Auto project requires some ROS 2 packages in addition to the core components. The tool rosdep allows an automatic search and installation of such dependencies.
    $ sudo apt update
    $ sudo apt install -y python3-rosdep
    $ sudo rosdep init
    $ rosdep update
    ?
    #安裝Autoware.Auto依賴的ROS2的其它包,rosdep會自動搜索安裝
    $ mkdir -p ~/adehome
    $ cd ~/adehome
    $ touch .adehome
    $ git clone https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git
    $ cd AutowareAuto
    $ vcs import < autoware.auto.$ROS_DISTRO.repos
    $ export ROS_VERSION=2
    ?
    #rosdep 一次安裝src下所有依賴
    $ rosdep install --reinstall -y -i --from-paths src
    ?
    // 這一步可有可不有。
    //目的是切換想要安裝的autoware版本,如果不切換master將使用最新分支
    #Checkout the latest release by checking out the corresponding tag or release branch.
    $ git checkout tags/1.0.0 -b release-1.0.0
    ?
    # If running tests or demos, also pull binary files with
    $ git lfs pull --exclude="" --include="*"
    ?
    #共享環境變量
    $ cd ~
    $ mv ~/.bashrc ~/adehome/.bashrc
    $ ln -s ~/adehome/.bashrc
    ?
    #打開一個干凈的ade容器進行編譯
    $ ade stop
    $ sudo ade update-cli
    $ ade --rc .aderc-amd64-foxy-lgsvl start --update --enter
    ade$ cd AutowareAuto
    ade$ rm -rf build/ install/ log/
    ?
    #To build all packages in Autoware.Auto, navigate into the AutowareAuto directory and run
    ade$ colcon build
    ade$ colcon test
    ade$ colcon test-result --verbose
    上述步驟中,第二步命令可以拉取一些其他分支到master,補充一些文件。我開始沒有執行這個命令,
    
    導致在執行colcon build,出現無法找到文件
    
    autoware_auto_msgs/msg/trajectory.hpp的錯誤。
    
    如果colcon 不起作用,配置colcon 環境變量
    
    Take the defaults file that comes with the Autoware.Auto source checkout and add it to your shell startup;
    
    echo COLCON_DEFAULTS_FILE
    
    $ echo "export COLCON_DEFAULTS_FILE=/path/to/AutowareAuto/tools/ade_image/colcon-defaults.yaml" >> .bashrc
    
    或者手工導入
    
    $ export COLCON_DEFAULTS_FILE=/path/to/AutowareAuto/tools/ade_image/colcon-defaults.yaml
    
    編譯完一定要source:
    
    $ source /opt/AutowareAuto/setup.bash
    或
    
    $ source ~/AutowareAuto/install/setup.bash
    

    ------使用一個干凈的ADE環境------

    我們可能遇到的很多問題都是由于代碼版本、舊的編譯文件存在等導致,所以需要更新ade和docker容器,以及清理一些舊的build等文件,可以通過以下操作完成:

    $ ade stop
    $ sudo ade update-cli
    $ ade start --update --enter
    ade$ cd AutowareAuto
    ade$ rm -rf build/ install/ log/ src/external/
    ade$ git pull
    ade$ vcs import < autoware.auto.$ROS_DISTRO.repos
    

    ------ADE環境的使用------

    • 執行ade命令(如ade start、ade enter等)時,要確保當前命令行在路徑

    ~/adehome/AutowareAuto 中;

    • 開啟ADE環境:

    $ ade start

    • 進入ADE環境(此時,會輸出一些鏡像信息):

    $ ade enter

    • 所有的鏡像掛在在/opt下面,可以查看:

    ade$ ls /opt

    • 退出并停止ADE環境(使用完最好手動停止ADE環境,以關閉Docker):

    ade$ exit

    $ ade stop

    ------安裝過程中可能會出現少包,版本不兼容問題,可以使用下面命令排查------

    #查找所有已安裝的軟件包
    $dpkg -l——查看所有已安裝的軟件包
    ?
    #清除所以刪除包的殘余配置文件
    $dpkg -l |grep ^rc|awk ‘{print $2}’ |tr [”"n”] [” “]|sudo xargs dpkg -P -
    ?
    #查看需卸載的軟件包
    $dpkg -l |grep 軟件名
    ?
    #clean 命令刪除所有的軟件安裝包。
    $ sudo apt-get clean
    ?
    #autoclean 命令刪除不再可用的軟件安裝包。
    $ sudo apt-get autoclean
    ?
    #remove 命令移除 以及任何依賴這個包的其它包
    $sudo apt-get remove 軟件名
    ?
    #用purge 命令清除式卸載
    $apt-get purge  <pakage_name>
    ?
    #autoremove 命令刪除不再需要的依賴軟件包。
    $ sudo apt-get autoremove
    ?
    #install 命令下載軟件包,以及所有依賴的包,同時進行包的安裝或升級
    $ apt-get install 軟件名  
    #libc6-dev : Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.4 is to be installed
    $ sudo apt install libc6=2.31-0ubuntu9.2 libc-bin=2.31-0ubuntu9.2
    ?
    #reinstall 命令重新安裝軟件包。
    $ apt-get --reinstall install softname1
    ?
    #升級來自 Debian 鏡像的包列表,如果你想安裝當天的任何軟件,至少每天運行一次,而且每次修改了
    $ sudo apt-get update
    ?
    #升級所有已經安裝的包為最新可用版本。不會安裝新的或移除老的包。建議同時使用 '-u' 選項,因為這樣你就能看到哪些包將會被升級
    $ apt-get upgrade -u
    ?
    #apt-get upgrade 類似,除了 dist-upgrade 會安裝和移除包來滿足依賴關系。因此具有一定的危險性
    $ apt-get dist-upgrade -u
    ?
    #在軟件包名稱和描述中,搜索包含xxx的軟件包
    $ apt-cache search
    ?
    #顯示某個軟件包的完整的描述
    $apt-cache show
    ?
    #Dpkg方式安裝軟件源
    $ dpkg -i package_name.deb
    ?
    #移除式卸載:
    $dpkg -r pkg1 pkg2 ...
    ?
    #清除式卸載:
    $dpkg -P pkg1 pkg2..
    ?
    #將刪除相關軟件,同時刪除該軟件的配置文件
    $ dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -p
    ?
    #重新安裝已安裝的包
    $ dpkg -l | grep ^ii | awk '{print $2}' | xargs sudo apt-get reinstall
    

    3.4 Autoware.auto 相機車道線檢測demo 展示

    1. 代碼及錄制視頻下載

    代碼下載

    $ cd ~/adehome/AutowareAuto/
    $ ade start
    $ ade enter
    $ git clone https://gitee.com/knowmefly/camera-hands-on-ws.git
    

    視頻下載:https://download.csdn.net/download/jiluonian/22771297 下載 laneVideo.h264 視頻文件放置在 ~/adehome/camera-hands-on-ws/src/lane_detection_data_loader/resources/ 目錄下

    2. 編譯安裝

    $ ade enter
    $ cd camera-hands-on-ws/
    $ rm -rf build/ install/ log/
    $ colcon build
    '可能找不到opencv,安裝opencv庫'
    $sudo apt install libopencv-dev python3-opencv
    

    3.運行視頻加載、圖像處理、可視化節點

    • 運行視頻加載節點
    # terminal 1
    $ ade enter
    $ cd  camera-hands-on-ws/
    $ source install/setup.bash
    $ ros2 run lane_detection_data_loader lane_detection_data_loader_node
    
    • 運行圖像處理節點
    # terminal 2
    $ ade enter
    $ cd  camera-hands-on-ws/
    $ source install/setup.bash
    $ ros2 run lane_detection_projection lane_detection_projection_node
    
    • 運行可視化節點
    # terminal 3
    $ ade enter
    $ cd  camera-hands-on-ws/
    $ source install/setup.bash
    $ ros2 run lane_detection_visualization lane_detection_visualization_node
    # terminal 4
    $ ade enter
    $ export QT_DEBUG_PLUGINS=1
    $ export DISPLAY=:0.0
    $ rviz2
    
    • 運行rviz2報錯
    'qt.qpa.xcb: could not connect to display localhost:10.0
    'qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    'This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    'Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
    
    'Aborted (core dumped)''
    

    解決辦法:

    加載插件跟蹤

    $ export QT_DEBUG_PLUGINS=1

    $ export DISPLAY=:0.0

    在vi /etc/profile內添加export DISPLAY=xserverip:0.0 執行source /etc/profile 第二步:然后ssh終端安裝xorg并使用xclock測試能否回傳圖像:

    apt-get install xorg

    xclock

    執行后桌面會跳出一個時鐘的圖案

    本文轉自:https://blog.csdn.net/baiyefenglin/article/details/122921360

    智能小車生動有趣,牽涉到機械結構、電子基礎、傳感器原理、自動控制甚至單片機編程等諸多學科知識,學生通過動手實踐能大大提高解決實際問題的能力,而且增加一些控制電路就能完成ROS小車等課題。那么小車應該如何安裝呢?下面小編帶來ROS小車安裝圖解。

    一、 小車底板安裝說明

    1.1 前向轉彎小車部件如圖(根據套餐不同):

    首先準備好第一層鋁板,也就是貼近地面最下面的一層鋁板, 鋁板在加工過程中有的帶有藍色貼膜,有的沒有,如果拿到的鋁板有一面有 貼膜,則帶貼膜的是朝下,如果沒有貼膜,則通過1.4中STM32板子的安裝 孔來確定哪一面是上。如圖不帶貼膜的是朝上安裝:

    帶藍色貼膜的朝下安裝,如圖:

    首先安裝電機,電機部分由電機安裝支架和電機組成:這里有一點需要注意的是,電機支架是貼在鋁板朝下的一面安裝的,正面安裝,如圖:

    通過螺絲螺母固定,背面如圖:

    電機的安裝位置則是,電機輸出軸在L型電機支架的下方,如圖:

    俯視圖如下:

    同樣的方法安裝好另一側的電機:

    1.2 STM32板子的安裝

    STM32板子是通過四個銅螺柱固定在第一層鋁板上面,固定位置在鋁板的右下方,靠近右側電機(自己可以通過STM32板子固定孔對照著找找)如圖:

    注:STM32板子通過長度為20毫米的銅柱固定,舵機轉向三角板是通過長度25毫米的銅柱固定,請大家比對一下長度。樹莓派是通過長度20MM內徑2.5MM的銅柱固定

    然后通過螺絲固定STM32板子,有PS2接受頭的一側朝向小車車頭:

    安裝好圖示:

    1.3 舵機安裝

    舵機通過舵機安裝支架安裝在底板前端

    舵機安裝支架背面:

    1.3 轉向三腳架安裝

    轉向三腳架和地板之間通過長度為25毫米內徑3MM的銅柱固定,請與固 定STM32板子和樹莓派的長度為20毫米銅柱區分。

    1.4 轉向座安裝

    拿到手的是兩套轉下圖,安裝示意圖如下,第一步:
    (現貨發貨為黑絲塑料件,金屬件有開模誤差,且容易變形,黑色塑料件固定 更穩定)

    黑絲塑料件通過螺絲固定的開孔比較緊,需用M3的螺絲,許多用戶反應M3 螺絲擰不進去,在此強調一下,需要用螺絲刀擰進去,而并不需要換成m2.5的 螺絲,因為用M3螺絲固定的才不會應為轉向而松動。

    一次從右到左穿過大滾珠軸承、轉向座小滾珠軸承、聯軸器:

    通過頂絲頂住聯軸器與軸:

    兩個轉向座是分左右的,安裝原則是:轉向座的直臂距離地板的距離要大于轉向座的直臂到三角形固定座的距離:黑絲塑料件通過螺絲固定的開孔比較緊,需用M3的螺絲,許多用戶反應M3 螺絲擰不進去,在此強調一下,需要用螺絲刀擰進去,而并不需要換成m2.5的 螺絲,因為用M3螺絲固定的才不會應為轉向而松動。

    轉向座的安裝細節:

    拉桿安裝:

    舵機轉臂安裝注意事項:

    經驗:先給舵機上電,因為舵機上電后如果沒有控制信號,舵機是先歸零,所
    以等舵機上電歸零后再固定舵機支臂;而且長短拉桿的長度也會影響前輪朝向, 所以在安裝過程中需要根據前輪具體朝向來調整長短拉桿的長度和舵機支臂的
    朝向。

    轉向結構安裝效果:

    2.3 GPS模塊的安裝

    第二代GPS

    第一步,接線,將USB轉TTL模塊通過杜邦線連接到GPS模塊, GPS: VCC----->5V USB轉TTL

    GND---->GND

    TXD---->RXD

    RXD--->TXD
    注意:GPS的PPS不用接,請務必接對線束,否則會引起燒毀?。?!USB轉TTL模塊的跳線帽不用摘掉,GPS的VCC端需要接USB轉TTL模 塊的5V端。

    第二代GPS模塊不需要再接長天線,功耗低精度高,容易安裝。需要將GPS天線放到上方沒有金屬的地方,如:

    2.4 樹莓派的安裝

    樹莓派通過4根長度為20毫米,內徑為2.5毫米的銅柱固定在第一層鋁板上,通過M2.5的螺絲固定,M2.5的螺絲自帶墊片,粗度比M3的細一點,請大家區別開來。樹莓派建議安裝在STM32前方,鋁板上有專門的開孔,很容易對應上。

    樹莓派供電:樹莓派是通過USB線接在STM32板子左側的USB口上供電的。


    2.4 電池的安裝

    電池和底板貼上魔術貼,一面是毛面,一面是勾面

    固定好電池后,電池輸出線一頭接STM32板,一頭接工控機:

    給工控機供電:

    2.5 底層安裝效果圖(未插PS2手柄接收頭)

    1.6 EAI X4激光雷達的安裝

    激光雷達固定用螺絲和轉接線在雷達下方的盒子里:
    雷達轉接板上有兩個接口,一個標有USB_DATA,一個標有USB_PWR,只需用 USB線連接USB_DATA和主控USB端口就行。
    激光雷達需要固定到第二層鋁板上,通過雷達自帶螺絲固定即可。
    激光雷達的轉接板需要用膠帶等絕緣物質包起來,以免裸露在表面短路。


    1.6 樂視深度攝像頭的安裝說明
    樂視深度攝像頭首先通過3M膠帶將USB延長線與頂板固定,然后插上樂視深 度攝像頭,效果如圖:

    首先用3M交代貼于延長線和頂板之間,如圖

    一面毛面,一面勾面

    注意朝向:

    最后插上樂視攝像頭:

    二 STM32板與主控接線:

    注:根據UDEV規則配置,需要在樹莓派或工控機上電前就將STM32板與激
    光雷達通過MICROUSB線和樹莓派或工控機連接好,每個同學都會有不同的接線
    順序和界限位置,對于USB接線問題,在此著重講一下:

    (經驗:先只接stm32板子,在終端中輸入ls /dev,看是否有ttyUSB0和,如果沒有,請換一個樹莓派或者工控機的usb口。這樣 就能確保bringup.launch的正常運行; 第二個插上的是激光雷達,確保dev下有ttyUSB1和ydlidar 然后接gps模塊,輸入ls /dev,看是否有ttyUSB2)
    目前程序版本中,在bringup.launch中對于dzactuator節點是/dev/ttyUSB0, 對應的GPS模塊是/dev/ttyUSB2,所以如果直接運行roslaunch dzactuator
    bringup.launch,如果出現紅色的錯誤標注,對于對linux的udev規則不是特
    別熟悉的同學,有兩個方法:

    一 請自行修改下udev規則,學習鏈接:
    https://blog.csdn.net/weixin_38717571/article/details/830450

    因為USB口在LINUX系統中對應的設備描述符會根據不同上電順序改變,所以 以下部分請大家格外注意:

    二 接線順序不同

    1、確保bringup.launch中的dzactuator節點打開的是/dev/ttyUSB0,否則 自行修改下。請先將樹莓派或工控機上電,等待樹莓派或工控機完全啟動

    2、首先通過USB線連接STM32板子與主控;然后通過SSH或者顯示屏查看dev下是否有/ttyUSB0,查看方法:(截圖是在虛 擬機未連接樹莓派或者工控機下的終端演示,所以用戶名是 duzhpc。用戶需要先ssh連接主控,在輸入 ls /dev/)


    3、第二個插上的是激光雷達,確保dev下有ydlidar

    4、第三個插上的是GPS模塊,確保dev下有ttyUSB2
    5、第四個插上的是深度相機模塊,確保dev下有video0 這個方法對于跑起來算法尤為重要,初學者會因為先后插上的USB 線束不同而導致運行程序失敗,所以在此簡化了USB端口號的識別 與操作。具體原理是通過roslaunch不同命令啟動的指令所打開的對 應的/dev下的USB設備描述符。
    如果后續想進一步學習的話,大家可以根據dev下有ttyUSB*的名稱更改對應的roslaunch文件。學習鏈接:
    https://blog.csdn.net/weixin_38717571/article/details/830450 40

    2.1 樹莓派

    樹莓派3B+一共有四個USB2.0口

    2.2 工控機
    工控機有三個USB口,左側一個,右側兩個。對于當前工控機只有三個USB口給大家帶來的不便,請大家諒解。

    作者聲明:本篇經驗系本人依照真實經歷原創,未經許可,謝絕轉載。

網站首頁   |    關于我們   |    公司新聞   |    產品方案   |    用戶案例   |    售后服務   |    合作伙伴   |    人才招聘   |   

友情鏈接: 餐飲加盟

地址:北京市海淀區    電話:010-     郵箱:@126.com

備案號:冀ICP備2024067069號-3 北京科技有限公司版權所有