博客列表 >AutoWare.auto 与ROS2 亲测安装成功

AutoWare.auto 与ROS2 亲测安装成功

哈
原创
2022年05月20日 15:35:062608浏览

镜像下载、域名解析、时间同步请点击 阿里云开源镜像站

AutoWare.auto 安装实践

1. 相关程序版本说明

ubuntu版本:20.04 ADE:4.4.0

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

<!--最开始使用的 **ubuntu版本:18.04版本,后面发现ros foxy需要ubuntu20版本,本来想着切到utoware.auto dashing版本,由于本人能力有限,不知道咋整,直接升级了系统**-->

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更换为自己熟悉的编辑器)

添加阿里源

  1. deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
  2. # deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
  3. deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
  4. # deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
  5. deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
  6. # deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
  7. # deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
  8. # deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
  9. deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
  10. # 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

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

// 使用docker repository安装docker engine

  1. #step1:在新主机上首次安装Docker Engine之前,需要设置Docker存储库。之后,您可以从存储库安装和更新Docker
  2. #更新apt软件包索引并安装软件包,以允许apt通过HTTPS使用存储库
  3. $ sudo apt-get install \
  4. ca-certificates \
  5. curl \
  6. gnupg \
  7. lsb-release
  8. #Step2:Add Docker’s official GPG key:
  9. $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  10. #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.
  11. $ echo \
  12. "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  13. $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  14. #Step4:Install Docker Engine
  15. $ sudo apt-get update
  16. $ sudo apt-get install docker-ce docker-ce-cli containerd.io //如果没有指定版本,默认安装最高版本
  17. #Step5:Verify that Docker Engine is installed correctly by running the hello-world image.
  18. $ sudo docker run hello-world
  19. Hello from Docker!
  20. This message shows that your installation appears to be working correctly.

Manage Docker as a non-root user

  1. # 创建docker用户组
  2. $ sudo groupadd docker
  3. #将当前用户加入docker用户组
  4. $ sudo usermod -aG docker $USER
  5. #Log out and log back in so that your group membership is re-evaluated.
  6. $ newgrp docker
  7. #Verify that you can run docker commands without sudo.
  8. $ docker run hello-world
  9. $ sudo chmod 666 /var/run/docker.sock
  10. #重启电脑或者重启docker服务
  11. $ sudo systemctl daemon-reload
  12. $ sudo systemctl restart docker
  13. $ sudo docker login registry.gitlab.com # Use token from Gitlab

3. Autoware.auto容器安装

3.1 程序说明

基于Docker封装的开发容器,包含以下内容:

file

3.2 ADE安装

ADE 是模块化的 Docker-based 工具,它确保所有的开发者构建项目时有一个共同的、一致的开发环境

官网安装文档:Installation — ADE 4.4.0dev documentation

  1. #install it in “/usr/local/bin” PATH
  2. $ cd /usr/local/bin
  3. $ sudo wget https://gitlab.com/ApexAI/ade-cli/-/jobs/1859684348/artifacts/raw/dist/ade+x86_64
  4. $ sudo mv ade+x86_64 ade
  5. $ sudo chmod +x ade
  6. $ which ade
  7. /path/to/ade
  8. # 查看ade版本号
  9. $ ade --version
  10. <version>
  11. # Update ade
  12. $ sudo ./ade update-cli #这个地方需要一段时间
  13. Newer version available:
  14. 4.4.0
  15. 4.3.0
  16. 4.2.0
  17. Do you want to update to version 4.4.0 [y/N]: y
  18. <!-- '注意:升级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目录下
  1. $ mkdir -p ~/adehome
  2. $ cd ~/adehome
  3. $ touch .adehome
  4. $ git clone https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git
  5. '注意:不要使用官网视频课程里面的递归循环安装,编译会报错'
  6. 'git clone --recurse-submodules https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git'
  7. $ cd AutowareAuto
  8. #拉取一些其他分支到master
  9. $ vcs import < autoware.auto.$ROS_DISTRO.repos
  10. #切换到发布分支,如果不切换,默认使用master 分支代码,可能包含一些正在开发的功能,建议切换稳定发布版本
  11. $ git checkout tags/1.0.0 -b release-1.0.0
  12. #共享环境变量
  13. $ cd ~
  14. $ mv ~/.bashrc ~/adehome/.bashrc
  15. $ ln -s ~/adehome/.bashrc
  16. $ cd ~/adehome/AutowareAuto
  17. #其实,有很多预先配置好的ADE环境供我们选择,官网提供了三个ADE配置文件:AMD64/ARM64/AMD64+LGSVL
  18. $ ls -l .aderc*
  19. lrwxrwxrwx 1 wtcl wtcl 17 12 23 12:14 .aderc -> .aderc-amd64-foxy
  20. -rw-rw-r-- 1 wtcl wtcl 407 12 23 12:25 .aderc-amd64-dashing
  21. -rw-rw-r-- 1 wtcl wtcl 499 12 23 12:25 .aderc-amd64-dashing-lgsvl
  22. -rw-rw-r-- 1 wtcl wtcl 401 12 23 12:25 .aderc-amd64-foxy
  23. -rw-rw-r-- 1 wtcl wtcl 490 12 23 12:25 .aderc-amd64-foxy-lgsvl
  24. lrwxrwxrwx 1 wtcl wtcl 17 12 23 12:14 .aderc-arm64 -> .aderc-arm64-foxy
  25. -rw-rw-r-- 1 wtcl wtcl 407 12 23 12:25 .aderc-arm64-dashing
  26. -rw-rw-r-- 1 wtcl wtcl 401 12 23 12:25 .aderc-arm64-foxy
  27. lrwxrwxrwx 1 wtcl wtcl 23 12 23 12:14 .aderc-lgsvl -> .aderc-amd64-foxy-lgsvl
  28. #可以看到有好几种可选的环境,其中.aderc-lgsvl对应的环境中包含LGSVL模拟器。然后,可以通过如下命令,切换并进入相应的ADE环境:
  29. #二选一安装,这个地方安装有点慢,需要等待一会,ade --rc 命令可以加载并启动相关的镜像容器
  30. $ ade --rc .aderc-amd64-foxy start --update --enter
  31. <!-- '注意:启动ade报错
  32. “Starting ade with the following images:
  33. ade-foxy | ec7293d289ad | master | registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/ade-foxy:master
  34. binary-foxy | 9ffc6c658b7a | master | registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/binary-foxy:master
  35. ade_registry.gitlab.com_autowarefoundation_autoware.auto_autowareauto_amd64_binary-foxy_master
  36. xhost: unable to open display "localhost:10.0"
  37. WARNING: Could not find xhost, you won't be able to launch X applications"
  38. 解决办法:设置本地显示命令-- $ export DISPLAY=localhost:10.0 $ xhost +>
  39. #What is where inside ADE?
  40. ade$ls /opt
  41. AutowareAuto # image: binary-foxy:master
  42. lgsvl # image: ade-lgsvl/foxy:2020.06
  43. ros # image: ade-foxy:master

ade安装过程中可能需要访问gitlab的令牌,需要登录gitlab申请

  1. In one terminal, source the setup file and then run a C++ talker:
  2. ade$ ade enter
  3. ade$ source ~/AutowareAuto/install/setup.bash
  4. ade$ ros2 run demo_nodes_cpp talker
  5. In another terminal source the setup file and then run a Python listener:
  6. ade$ cd ~/AutowareAuto
  7. ade$ source ~/AutowareAuto/install/setup.bash
  8. ade$ ros2 run demo_nodes_py listener
  9. You should see the talker saying that its Publishing messages and the listener saying I heard those messages. This verifies both the C++ and Python APIs are working properly. Hooray!
  10. #docker容器 清理无用镜像,卷
  11. $ cd ~/adehome/AutowareAuto
  12. $ ade start
  13. #To assess the disk usage situation, run the following command:
  14. $ docker system df
  15. #Use docker system prune to remove any Docker items not used for currently running containers:
  16. $ docker system prune -a --volumes
  17. #Restart your system after installing the new NVIDIA driver.
  18. ade$ exit
  19. $ ade stop
  20. $ 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

  1. #如果安装了旧版本,先卸载
  2. $ sudo apt-get purge ros-foxy*
  3. $ sudo rm -rf /etc/ros
  4. $ sudo gedit ~/.bashrc
  5. 删除那个东西bash
  6. $ source ~/.bashrc
  7. #安装编译工具包
  8. #Apt packages
  9. $ sudo apt install -y git cmake python3-pip
  10. #Python modules
  11. $ pip3 install -U colcon-common-extensions vcstool
  12. #First, the ROS 2 core components and tools must be installed
  13. #安装ROS2核心包
  14. #设置语言环境,确保语言环境支持UTF-8
  15. $ locale # check for UTF-8
  16. #只检查是否有可用更新,给出汇总报告和提示信息
  17. $ sudo apt update
  18. #查看可升级的软件的全部版本信息
  19. $ sudo apt list --upgradable -a
  20. $ sudo apt install locales
  21. $ sudo locale-gen en_US en_US.UTF-8
  22. $ sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
  23. $ export LANG=en_US.UTF-8
  24. $ locale # verify settings
  25. #确保ros2仓库可用
  26. $ apt-cache policy | grep universe
  27. #如果不可用,执行下面命令
  28. $ sudo apt install software-properties-common
  29. $ sudo add-apt-repository universe
  30. #需要在系统中添加ROS 2 apt存储库。为此,请首先使用如下所示的apt授权GPG密钥:
  31. #Now add the ROS 2 apt repository to your system. First authorize our GPG key with apt.
  32. $ sudo apt update
  33. $ sudo apt install curl gnupg lsb-release
  34. $ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
  35. #然后将存储库添加到源列表中
  36. #Then add the repository to your sources list.
  37. $ 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
  38. #Install development tools and ROS tools
  39. sudo apt update && sudo apt install -y \
  40. build-essential \
  41. cmake \
  42. git \
  43. python3-colcon-common-extensions \
  44. python3-flake8 \
  45. python3-pip \
  46. python3-pytest-cov \
  47. python3-rosdep \
  48. python3-setuptools \
  49. python3-vcstool \
  50. wget
  51. # install some pip packages needed for testing
  52. python3 -m pip install -U \
  53. flake8-blind-except \
  54. flake8-builtins \
  55. flake8-class-newline \
  56. flake8-comprehensions \
  57. flake8-deprecated \
  58. flake8-docstrings \
  59. flake8-import-order \
  60. flake8-quotes \
  61. pytest-repeat \
  62. pytest-rerunfailures \
  63. pytest
  64. # install Fast-RTPS dependencies
  65. sudo apt install --no-install-recommends -y \
  66. libasio-dev \
  67. libtinyxml2-dev
  68. # install Cyclone DDS dependencies
  69. sudo apt install --no-install-recommends -y \
  70. libcunit1-dev
  71. # Get ROS 2 code
  72. # ROS2源码下载,Install ROS 2 packages
  73. $ mkdir -p ~/ros2_foxy/src
  74. $ cd ~/ros2_foxy
  75. $ wget https://raw.githubusercontent.com/ros2/ros2/foxy/ros2.repos
  76. $ vcs import src < ros2.repos
  77. #Install dependencies using rosdep
  78. $ sudo apt update
  79. $ sudo rm -rf /etc/ros/rosdep/sources.list.d/20-default.list
  80. $ sudo rosdep init
  81. $ rosdep update
  82. $ rosdep install --from-paths src --reinstall --ignore-src -y --rosdistro=foxy --skip-keys "fastcdr rti-connext-dds-5.3.1 urdfdom_headers"
  83. $ rosdep check --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-5.3.1 urdfdom_headers"
  84. '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.'
  85. #rti-dds可以单独安装
  86. #https://docs.ros.org/en/foxy/Installation/DDS-Implementations.html
  87. #工作空间编译源码安装
  88. #检查ROS环境变量,确保没有使用“source /opt/ros/${ROS_DISTRO}/setup.bash”设置过环境变量
  89. $ printenv | grep -i ROS #如果显示空,后面编译会有问题
  90. PWD=/pathto/ros2_foxy
  91. $ cd ~/ros2_foxy/
  92. $ colcon build --symlink-install
  93. $ colcon test
  94. $ colcon test-result --verbose
  95. #Demo test,In one terminal, source the setup file and then run a C++ talker:
  96. $ source ~/ros2_foxy/install/setup.bash
  97. $ ros2 run demo_nodes_cpp talker
  98. #In another terminal source the setup file and then run a Python listener:
  99. $ source ~/ros2_foxy/install/setup.bash
  100. $ ros2 run demo_nodes_py listener
  101. =================================================以上是ROS2 源码安装,下面是安装Autoware.auto源码安装 =============================
  102. $ export ROS_DISTRO = foxy
  103. $ echo $ROS_DISTRO
  104. #ROS2安装完成后, 设置环境变量
  105. $ source ~/ros2_foxy/install/setup.bash
  106. #将ROS环境变量添加到bashrc文件里面
  107. $ echo "source ~/ros2_foxy/install/setup.bash" >> ~/.bashrc
  108. $ source ~/.bashrc
  109. # 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.
  110. $ sudo apt update
  111. $ sudo apt install -y python3-rosdep
  112. $ sudo rosdep init
  113. $ rosdep update
  114. #安装Autoware.Auto依赖的ROS2的其它包,rosdep会自动搜索安装
  115. $ mkdir -p ~/adehome
  116. $ cd ~/adehome
  117. $ touch .adehome
  118. $ git clone https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git
  119. $ cd AutowareAuto
  120. $ vcs import < autoware.auto.$ROS_DISTRO.repos
  121. $ export ROS_VERSION=2
  122. #rosdep 一次安装src下所有依赖
  123. $ rosdep install --reinstall -y -i --from-paths src
  124. // 这一步可有可不有。
  125. //目的是切换想要安装的autoware版本,如果不切换master将使用最新分支
  126. #Checkout the latest release by checking out the corresponding tag or release branch.
  127. $ git checkout tags/1.0.0 -b release-1.0.0
  128. # If running tests or demos, also pull binary files with
  129. $ git lfs pull --exclude="" --include="*"
  130. #共享环境变量
  131. $ cd ~
  132. $ mv ~/.bashrc ~/adehome/.bashrc
  133. $ ln -s ~/adehome/.bashrc
  134. #打开一个干净的ade容器进行编译
  135. $ ade stop
  136. $ sudo ade update-cli
  137. $ ade --rc .aderc-amd64-foxy-lgsvl start --update --enter
  138. ade$ cd AutowareAuto
  139. ade$ rm -rf build/ install/ log/
  140. #To build all packages in Autoware.Auto, navigate into the AutowareAuto directory and run
  141. ade$ colcon build
  142. ade$ colcon test
  143. ade$ colcon test-result --verbose
  144. 上述步骤中,第二步命令可以拉取一些其他分支到master,补充一些文件。我开始没有执行这个命令,
  145. 导致在执行colcon build,出现无法找到文件
  146. autoware_auto_msgs/msg/trajectory.hpp的错误。
  147. 如果colcon 不起作用,配置colcon 环境变量
  148. Take the defaults file that comes with the Autoware.Auto source checkout and add it to your shell startup;
  149. echo COLCON_DEFAULTS_FILE
  150. $ echo "export COLCON_DEFAULTS_FILE=/path/to/AutowareAuto/tools/ade_image/colcon-defaults.yaml" >> .bashrc
  151. 或者手工导入
  152. $ export COLCON_DEFAULTS_FILE=/path/to/AutowareAuto/tools/ade_image/colcon-defaults.yaml
  153. 编译完一定要source
  154. $ source /opt/AutowareAuto/setup.bash
  155. $ source ~/AutowareAuto/install/setup.bash

———使用一个干净的ADE环境———

我们可能遇到的很多问题都是由于代码版本、旧的编译文件存在等导致,所以需要更新ade和docker容器,以及清理一些旧的build等文件,可以通过以下操作完成:

  1. $ ade stop
  2. $ sudo ade update-cli
  3. $ ade start --update --enter
  4. ade$ cd AutowareAuto
  5. ade$ rm -rf build/ install/ log/ src/external/
  6. ade$ git pull
  7. 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

———安装过程中可能会出现少包,版本不兼容问题,可以使用下面命令排查———

  1. #查找所有已安装的软件包
  2. $dpkg -l——查看所有已安装的软件包
  3. #清除所以删除包的残余配置文件
  4. $dpkg -l |grep ^rc|awk ‘{print $2}’ |tr [”"n”] [” “]|sudo xargs dpkg -P -
  5. #查看需卸载的软件包
  6. $dpkg -l |grep 软件名
  7. #clean 命令删除所有的软件安装包。
  8. $ sudo apt-get clean
  9. #autoclean 命令删除不再可用的软件安装包。
  10. $ sudo apt-get autoclean
  11. #remove 命令移除 以及任何依赖这个包的其它包
  12. $sudo apt-get remove 软件名
  13. #用purge 命令清除式卸载
  14. $apt-get purge <pakage_name>
  15. #autoremove 命令删除不再需要的依赖软件包。
  16. $ sudo apt-get autoremove
  17. #install 命令下载软件包,以及所有依赖的包,同时进行包的安装或升级
  18. $ apt-get install 软件名
  19. #libc6-dev : Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.4 is to be installed
  20. $ sudo apt install libc6=2.31-0ubuntu9.2 libc-bin=2.31-0ubuntu9.2
  21. #reinstall 命令重新安装软件包。
  22. $ apt-get --reinstall install softname1
  23. #升级来自 Debian 镜像的包列表,如果你想安装当天的任何软件,至少每天运行一次,而且每次修改了
  24. $ sudo apt-get update
  25. #升级所有已经安装的包为最新可用版本。不会安装新的或移除老的包。建议同时使用 '-u' 选项,因为这样你就能看到哪些包将会被升级
  26. $ apt-get upgrade -u
  27. #apt-get upgrade 类似,除了 dist-upgrade 会安装和移除包来满足依赖关系。因此具有一定的危险性
  28. $ apt-get dist-upgrade -u
  29. #在软件包名称和描述中,搜索包含xxx的软件包
  30. $ apt-cache search
  31. #显示某个软件包的完整的描述
  32. $apt-cache show
  33. #Dpkg方式安装软件源
  34. $ dpkg -i package_name.deb
  35. #移除式卸载:
  36. $dpkg -r pkg1 pkg2 ...
  37. #清除式卸载:
  38. $dpkg -P pkg1 pkg2..
  39. #将删除相关软件,同时删除该软件的配置文件
  40. $ dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -p
  41. #重新安装已安装的包
  42. $ dpkg -l | grep ^ii | awk '{print $2}' | xargs sudo apt-get reinstall

3.4 Autoware.auto 相机车道线检测demo 展示

1. 代码及录制视频下载

代码下载

  1. $ cd ~/adehome/AutowareAuto/
  2. $ ade start
  3. $ ade enter
  4. $ 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. 编译安装

  1. $ ade enter
  2. $ cd camera-hands-on-ws/
  3. $ rm -rf build/ install/ log/
  4. $ colcon build
  5. '可能找不到opencv,安装opencv库'
  6. $sudo apt install libopencv-dev python3-opencv

3.运行视频加载、图像处理、可视化节点

  • 运行视频加载节点
  1. # terminal 1
  2. $ ade enter
  3. $ cd camera-hands-on-ws/
  4. $ source install/setup.bash
  5. $ ros2 run lane_detection_data_loader lane_detection_data_loader_node
  • 运行图像处理节点
  1. # terminal 2
  2. $ ade enter
  3. $ cd camera-hands-on-ws/
  4. $ source install/setup.bash
  5. $ ros2 run lane_detection_projection lane_detection_projection_node
  • 运行可视化节点
  1. # terminal 3
  2. $ ade enter
  3. $ cd camera-hands-on-ws/
  4. $ source install/setup.bash
  5. $ ros2 run lane_detection_visualization lane_detection_visualization_node
  6. # terminal 4
  7. $ ade enter
  8. $ export QT_DEBUG_PLUGINS=1
  9. $ export DISPLAY=:0.0
  10. $ rviz2
  • 运行rviz2报错
  1. 'qt.qpa.xcb: could not connect to display localhost:10.0
  2. 'qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
  3. 'This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
  4. 'Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
  5. '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

执行后桌面会跳出一个时钟的图案

file

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

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议