编译 UVC 相机至 25% 时 Catkin_make 失败

编译 UVC 相机至 25% 时 Catkin_make 失败

我在 Raspberry Pi 3B+ 上运行 Ubuntu 20.04.1,并且已安装并运行 ROS Noetic。我想使用 PiCamera,因此我插入相机,然后决定UVC_Camera在 ROS 上使用节点,因此我将其从 GitHub 下载到我的src/文件夹中,然后运行catkin_make。这是我得到的输出:

Base path: /home/ubuntu/catkin_ws
Source space: /home/ubuntu/catkin_ws/src
Build space: /home/ubuntu/catkin_ws/build
Devel space: /home/ubuntu/catkin_ws/devel
Install space: /home/ubuntu/catkin_ws/install
####
#### Running command: "cmake /home/ubuntu/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/ubuntu/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/ubuntu/catkin_ws/install -G Unix Makefiles" in "/home/ubuntu/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ubuntu/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/ubuntu/catkin_ws/devel;/opt/ros/noetic
-- This workspace overlays: /home/ubuntu/catkin_ws/devel;/opt/ros/noetic
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.5", minimum required is "3")
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Using Debian Python package layout
-- Using empy: /usr/lib/python3/dist-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/ubuntu/catkin_ws/build/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python3 (found version "3.8.5")
-- Using Python nosetests: /usr/bin/nosetests3
-- catkin 0.8.9
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 4 packages in topological order:
-- ~~  - camera_umd (metapackage)
-- ~~  - testbot
-- ~~  - jpeg_streamer
-- ~~  - uvc_camera
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'camera_umd'
-- ==> add_subdirectory(camera_umd/camera_umd)
-- +++ processing catkin package: 'testbot'
-- ==> add_subdirectory(testbot)
-- Installing devel-space wrapper /home/ubuntu/catkin_ws/src/testbot/scripts/listener.py to /home/ubuntu/catkin_ws/devel/lib/testbot
-- +++ processing catkin package: 'jpeg_streamer'
-- ==> add_subdirectory(camera_umd/jpeg_streamer)
-- +++ processing catkin package: 'uvc_camera'
-- ==> add_subdirectory(camera_umd/uvc_camera)
-- Found Boost: /usr/lib/aarch64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: thread system
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/catkin_ws/build
####
#### Running command: "make -j4 -l4" in "/home/ubuntu/catkin_ws/build"
####
Scanning dependencies of target jpeg_streamer
Scanning dependencies of target uvc_camera_node
Scanning dependencies of target uvc_stereo_node
Scanning dependencies of target nodelet_uvc_camera
[  6%] Building CXX object camera_umd/jpeg_streamer/CMakeFiles/jpeg_streamer.dir/src/jpeg_streamer.cpp.o
[ 12%] Building CXX object camera_umd/uvc_camera/CMakeFiles/uvc_camera_node.dir/src/camera_node.cpp.o
[ 18%] Building CXX object camera_umd/uvc_camera/CMakeFiles/uvc_stereo_node.dir/src/stereo_node.cpp.o
[ 25%] Building CXX object camera_umd/uvc_camera/CMakeFiles/nodelet_uvc_camera.dir/src/nodelets.cpp.o
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [camera_umd/uvc_camera/CMakeFiles/uvc_camera_node.dir/build.make:63: camera_umd/uvc_camera/CMakeFiles/uvc_camera_node.dir/src/camera_node.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1314: camera_umd/uvc_camera/CMakeFiles/uvc_camera_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

命令运行了一段时间,但后来发生了一些事情,导致程序崩溃。原因是什么?我该如何修复?是不是内存问题,因为我要在 Ubuntu VM 上进行编译?非常感谢大家提出建议。

答案1

Raspberry Pi 的 CPU 电量即将耗尽。请运行catkin_make -j1以创建较少的线程。这将防止 Pi 崩溃。

相关内容