
PX4编译问题本周收到一个Nvidia Jeston Orin NX开发板搭建PX4开发环境问题make px4_sitl gazebo成功后卡住未显示gazebo界面 2026年5月29日OpenCVlibopencv_core.so.x.x.x 不存在CMake Error at /usr/lib/cmake/opencv4/OpenCVModules.cmake:172 (message):The imported target “opencv_core” references the file/usr/lib/libopencv_core.so.4.8.0but this file does not exist. Possible reasons include:The file was deleted, renamed, or moved to another location.An install or uninstall procedure did not complete successfully.The installation package was faulty and contained“/usr/lib/cmake/opencv4/OpenCVModules.cmake”but not all the files it references.Call Stack (most recent call first):/usr/lib/cmake/opencv4/OpenCVConfig.cmake:126 (include)src/modules/simulation/gz_plugins/optical_flow/optical_flow.cmake:35 (find_package)src/modules/simulation/gz_plugins/optical_flow/CMakeLists.txt:37 (include)– Configuring incomplete, errors occurred!总结可能是前面操作的同学尝试源码安装OpenCV没有清理干净。手动清除OpenCV的CMake文件sudorm-rf/usr/lib/cmake/opencv4sudorm-rf/usr/local/lib/cmake/opencv4apt安装libopencv后遇到CMake Error at src/modules/simulation/gz_plugins/optical_flow/optical_flow.cmake:35 (find_package): By not providing FindOpenCV.cmake in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by OpenCV, but CMake did not find one. Could not find a package configuration file provided by OpenCV with any of the following names: OpenCVConfig.cmake opencv-config.cmake再安装libopencv-dev编译正常。CMake Error at src/modules/simulation/gz_plugins/optical_flow/optical_flow.cmake:35 (find_package): By not providing FindOpenCV.cmake in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by OpenCV, but CMake did not find one. Could not find a package configuration file provided by OpenCV with any of the following names: OpenCVConfig.cmake opencv-config.cmake再安装libopencv-dev编译正常。CMake Error at src/modules/simulation/gz_plugins/optical_flow/optical_flow.cmake:35 (find_package): By not providing FindOpenCV.cmake in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by OpenCV, but CMake did not find one. Could not find a package configuration file provided by OpenCV with any of the following names: OpenCVConfig.cmake opencv-config.cmake再安装libopencv-dev编译正常。libopencv-dev和libopencv这两个包的核心区别在于libopencv-dev是用来开发程序的而libopencv只是个用来安装它的“空壳”。使用源码编译。cmake-DCMAKE_BUILD_TYPERELEASE-DCMAKE_INSTALL_PREFIX/usr/local-DOPENCV_EXTRA_MODULES_PATH../opencv_contrib-4.13.0/modules-DOPENCV_GENERATE_PKGCONFIGON-DWITH_IPPOFF-DBUILD_EXAMPLESOFF..make-jsudomakeinstallsudoldconfiggazebo问题You need to have gazebo simulator installed!查看gazebo版本或者GUI点击aboutgz sim--version显示harmonicUbuntu22.04系统版本与PX4匹配。PX4源码根目录下make distclean重新编译make px4_sitl gazebo