当前位置: 首页 > news >正文

博客网站开发流程项目营销推广方案

博客网站开发流程,项目营销推广方案,index 石家庄网站建设,php 手机网站源码这里写目录标题 docker中使用ros2humble的rviz2不显示问题删除 Docker 镜像和容器删除 Docker 容器Linux服务器下查看系统CPU个数、核心数、(make编译最大的)线程数总结: RVIZ2 不能显示数据集 docker中使用ros2humble的rviz2不显示问题 问题描述: roo…

这里写目录标题

  • docker中使用ros2humble的rviz2不显示问题
    • 删除 Docker 镜像和容器
    • 删除 Docker 容器
    • Linux服务器下查看系统CPU个数、核心数、(make编译最大的)线程数
    • 总结:
  • RVIZ2 不能显示数据集

docker中使用ros2humble的rviz2不显示问题

问题描述:

root@9f20405a1baf:/# rviz2 
qt.qpa.xcb: could not connect to display 
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查看问题的具体显示,输出问题的内容形式如下:

root@020b7a1aa6d4:/fastlio2# rviz2 
qt.qpa.xcb: could not connect to display 
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)
root@020b7a1aa6d4:/fastlio2# cd ..
root@020b7a1aa6d4:/# export QT_DEBUG_PLUGINS=1 
root@020b7a1aa6d4:/# ros2 run rivz2 rivz2
Package 'rivz2' not found
root@020b7a1aa6d4:/# ros2 run rviz2 rivz2
No executable found
root@020b7a1aa6d4:/# ros2 run rviz2 rviz2
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["eglfs"]},"archreq": 0,"className": "QEglFSIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["linuxfb"]},"archreq": 0,"className": "QLinuxFbIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["minimal"]},"archreq": 0,"className": "QMinimalIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["minimalegl"]},"archreq": 0,"className": "QMinimalEglIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("minimalegl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["offscreen"]},"archreq": 0,"className": "QOffscreenIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["vnc"]},"archreq": 0,"className": "QVncIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["xcb"]},"archreq": 0,"className": "QXcbIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/opt/ros/humble/lib/rviz2/platforms" ...
loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
qt.qpa.xcb: could not connect to display 
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.[ros2run]: Aborted
root@020b7a1aa6d4:/# echo $DISPLAY root@020b7a1aa6d4:/# 
exit

这里参考非常宝藏的社区解决方法
在宿主机中运行:

docker run -it -v /tmp/.X11-unix/:/tmp/.X11-unix/:rw --env=DISPLAY --name ros2_container osrf/ros:humble-desktop-full

解释:

-v /tmp/.X11-unix/:/tmp/.X11-unix/:rw :
-v 选项允许 Docker 将一个卷挂载到容器上,这样容器就能访问宿主机文件系统上的目录
/tmp/.X11-unix/ 是宿主机上由 X 服务器用于显示的一个目录
:/tmp/.X11-unix/ 是容器中挂载卷的位置,与宿主机上的目录相同
:rw 部分允许对卷进行读写访问,这对显示内容是必要的。
--env=DISPLAY 
这个参数将宿主机的 DISPLAY 环境变量传递给容器。
DISPLAY 变量以启用可视化

这里我重点排查了一下:貌似是因为之前通过

docker image pull osrf/ros:humble-desktop-full 
#拉取的镜像有些东西没有拉取成功 导致RVIZ2始终运行不成功

使得我又重新构建了一个container_ros2 !
在这里插入图片描述docker run -it --name ros2_container osrf/ros:humble-desktop-full
接下来报错问题:

root@cf4125aa605c:/# ros2 run rviz2 rviz2
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["eglfs"]},"archreq": 0,"className": "QEglFSIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["linuxfb"]},"archreq": 0,"className": "QLinuxFbIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["minimal"]},"archreq": 0,"className": "QMinimalIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["minimalegl"]},"archreq": 0,"className": "QMinimalEglIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("minimalegl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["offscreen"]},"archreq": 0,"className": "QOffscreenIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["vnc"]},"archreq": 0,"className": "QVncIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so, metadata=
{"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3","MetaData": {"Keys": ["xcb"]},"archreq": 0,"className": "QXcbIntegrationPlugin","debug": false,"version": 331520
}Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/opt/ros/humble/lib/rviz2/platforms" ...
loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
No protocol specified
qt.qpa.xcb: could not connect to display :1
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.[ros2run]: Aborted

解决方法:
大概是没有同意通过docker容器访问宿主机的X服务器:
所以采取的方法为:宝藏解决方法

#执行:
export QT_DEBUG_PLUGINS=1 // 用来输出QT报错的完整信息
再次在docker中运行rviz2的节点
ros2 run rviz2 rviz2 #查看完整报错内容
echo $DISPLAY 判断是不是利用宿主机显示rviz2出现的问题
本地终端输入:
sudo xhost 然后按下回车
输入密码
出现下图:
再在docker中:
ros2 run rviz2 rviz2

请添加图片描述成功展示界面:
在这里插入图片描述
这里要注意:你rviz2启动的container需要一致!!!
例如:我这里的docker image 存在多种:请添加图片描述
但是这里只有ros2_container成功拉取了rviz2,所以 其他的仍然存在rviz2显示问题!!!(那就重新下载一下我的SDK相关包和依赖库)

删除 Docker 镜像和容器

我是个眼里不容沙子的人,没用的docker container需要选择删除

列出所有镜像以获取镜像的 ID
docker images -a
明确删除哪个镜像:
docker rmi <your-image-id>
操作如下:

sudo systemctl start docker
sudo systemctl enable dockerdocker images -a

请添加图片描述

docker rmi d2c94e258dcb
docker iamges -a

请添加图片描述

删除 Docker 容器

#停止所有正在运行的容器
docker ps -a //列出 所有容器 停止和未停止
docker ps //列出所有正在运行的容器

请添加图片描述删除多个容器

docker rm $(docker ps -a -q)
#用来删除所有停止的容器

一般情况下:可以将线程数设置为CPU核心数的2倍

Linux服务器下查看系统CPU个数、核心数、(make编译最大的)线程数

# 查看CPU
lscpu #查看cpu的所有信息
#######################################################
root@cf4125aa605c:/Livox-SDK2/build# lscpu 
Architecture:             x86_64CPU op-mode(s):         32-bit, 64-bitAddress sizes:          46 bits physical, 48 bits virtualByte Order:             Little Endian
CPU(s):                   8On-line CPU(s) list:    0-7
Vendor ID:                GenuineIntelModel name:             Intel(R) Xeon(R) W-2223 CPU @ 3.60GHzCPU family:           6Model:                85Thread(s) per core:   2Core(s) per socket:   4Socket(s):            1Stepping:             7CPU max MHz:          3900.0000CPU min MHz:          1200.0000BogoMIPS:             7200.00Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida aratpln pts hwp hwp_act_window hwp_epp hwp_pkg_req avx512_vnni md_clear flush_l1d arch_capabilities
Virtualization features:  Virtualization:         VT-x
Caches (sum of all):      L1d:                    128 KiB (4 instances)L1i:                    128 KiB (4 instances)L2:                     4 MiB (4 instances)L3:                     8.3 MiB (1 instance)
NUMA:                     NUMA node(s):           1NUMA node0 CPU(s):      0-7
Vulnerabilities:          Gather data sampling:   Mitigation; MicrocodeItlb multihit:          KVM: Mitigation: VMX disabledL1tf:                   Not affectedMds:                    Not affectedMeltdown:               Not affectedMmio stale data:        Mitigation; Clear CPU buffers; SMT vulnerableReg file data sampling: Not affectedRetbleed:               Mitigation; Enhanced IBRSSpec rstack overflow:   Not affectedSpec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl and seccompSpectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitizationSpectre v2:             Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI SW loop, KVM SW loopSrbds:                  Not affectedTsx async abort:        Mitigation; TSX disabled
#######################################################

查看物理CPU数量
CPU物理核心就是计算机上实际配置的CPU个数:

cat /proc/cpuinfo |grep "physical id"|sort|uniq|wc -l#通过sort 列出cpu信息
grep 'physical id' /proc/cpuinfo | sort -u

逻辑CPU的个数
计算机没有开启超线程时,逻辑CPU的个数就是计算机的核数
超线程开启后,逻辑CPU的个数是核数的两倍
实际上逻辑CPU的数量就是平时称呼的几核几线程中的线程数量,在linux的cpuinfo中逻辑CPU数就是processor的数量

cat /proc/cpuinfo| grep "processor"| wc -l
grep 'physical id' /proc/cpuinfo 

查看核心数量
每个物理CPU含有的核心个数。

cat /proc/cpuinfo| grep "cpu cores"| uniq
grep 'core id' /proc/cpuinfo | sort -u |wc -l

总核数 = 物理CPU个数 X 每颗物理CPU的核数

grep 'core id' /proc/cpuinfo |wc -l

查看线程数
cpu支持的线程数 = cpu数目 * 每个cpu含有的核心数目* 每个核心含有的线程数(64=2162)
CPU是一个影响编译速度的重要因素,所以make -j带上一个参数,可以把项目在进行中的并行编译,现在服务器上的CPU差不多都是多核多线程的,所以完全可以用make -j64,让make最多允许64个编译进程同时执行,这样可以更有效的利用CPU资源。

cat /proc/cpuinfo |grep "processor"|wc -l
grep 'processor' /proc/cpuinfo | sort -u | wc -l
grep 'processor' /proc/cpuinfo |  wc -l

博主中线程数 : 64 = 2(physical cpu) * 16(cpu kernel number) * 2(每个核心是双核)
请添加图片描述
我的是卑微的8 所以 安装库的时候 每一个需要make -j的我都选择make -j8

总结:

pcl:没有选择安装,直接将pcl的include加入到相应的bashrc中-最终选择第二种方式

vim ~/.bashrc
export CPLUS_INCLUDE_PATH="/usr/include/pcl-1.12:$CPLUS_INCLUDE_PATH" #我是pcl-1.12
export LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH"

Eigen:直接大片的**sudo apt install libeigen3-dev**
sophus:

git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout 1.22.10
mkdir build && cd build
cmake .. -DSOPHUS_USE_BASIC_LOGGING=ON
make
sudo make install

gtsam

#安装依赖
sudo apt-get install libboost-all-dev
sudo apt-get install cmake
sudo apt-get install libtbb-devgit clone https://github.com/borglab/gtsam.git
cd gtsam
mkdir build && cd build
cmake ..
make check (optional, runs unit tests)
make install

livox_ros_driver2

mkdir -r ws_livox/src
git clone https://github.com/Livox-SDK/livox_ros_driver2.git ws_livox/src/livox_ros_driver2
cd ws_livox/src/livox_ros_driver2
source /opt/ros/humble/setup.sh
./build.sh humble

#在后面需要修改livox_ros_driver2_DIR

vim /FastLIO2_ws/src/FASTLIO2_ROS2/fastlio2/CMakeLists.txt 
set(livox_ros_driver2_DIR /ws_livox/install/livox_ros_driver2/share/livox_ros_driver2/cmake)

请添加图片描述

RVIZ2 不能显示数据集

数据连接

首先在安装完成fastlio2需要的依赖库后,
mkdir -p /FastLIO2_ws/src && cd /FastLIO2_ws/src
git clone --recursive https://github.com/liangheming/FASTLIO2_ROS2.git
cd .. #这里colcon 需要在src目录下
colcon build --symlink-install. ./install/setup.bash #激活安装的fastlio2 node

问题:rviz2不能播放db3的rosbag数据
新开启一个终端

docker exec -it rose_container /bin/bash
source /opt/ros/humble/setup.bash
source /FastLIO2_ws/install/setup.bash
ros2 bag play FastLIO_ROS2_Data

问题解决
需要在colcon build --symlink-install build fastlio2之前
一定要在colcon build --symlink-install 之前source /ws_livox/install/setup.bash!!!

 source /ws_livox/install/setup.bash ###!!!!!!cd /FastLIO2_ws/colcon build --symlink-install ## !!!!. ./install/setup.bash  ##!!!! 

然后在按照上面的方法开启新的终端 ros2 bag play ors_bag_dir 最终能够成功播放数据集。
在这里插入图片描述
结果展示!
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

http://www.hengruixuexiao.com/news/5200.html

相关文章:

  • html可以做动态网站吗平原县网站seo优化排名
  • 网站建设对网络营销的影响百度关键词优化排名
  • 花生壳做网站百度认证是什么
  • 手机软件编程百度优化seo
  • jsp网站开发小程序搜索引擎营销成功的案例
  • 如何在电脑上做物流网站上海网络推广营销策划方案
  • 免费ai写作网站b站引流推广网站
  • 购物网站建设的原理网页优化seo公司
  • 惠州建设局网站首页昆明百度推广开户
  • 湘潭做网站 磐石网络很专业电脑培训学校
  • 美容美发网站源码优化最狠的手机优化软件
  • 达县网站制作网站优化软件费用
  • 网站空间一般多大seo管理软件
  • 威海网站制作镇江seo公司
  • 怎么做不花钱的网站千万别在百度上搜别人的名字
  • 苏州园区疫情seo属于运营还是技术
  • qq建设网站首页蜗牛精灵seo
  • 哪个网站专做滨水景观短视频seo是什么
  • 如何做网站的链接结构北京网站建设公司大全
  • 做繁体书的网站网络营销主要做什么
  • 企业建设企业网站的好处青岛seo外包服务
  • 武汉营销网站建设公司学网络营销
  • 做网站点击率赚钱吗抖音营销软件
  • wordpress站长地图东方网络律师团队
  • 做牛津布面料在哪个网站找客户软文外链购买平台
  • 可以充值的网站怎么做qq群排名优化
  • 济南哪个公司做网站好深圳关键词推广优化
  • WordPress中英文旅游模板seo整站网站推广优化排名
  • 专业北京网站建设公司流程优化四个方法
  • 网站防红链接怎么做自动秒收录网