我在 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 上编译?所有建议都非常感谢。
Raspberry Pi 的 CPU 电源即将耗尽。运行
catkin_make -j1
以创建更少的线程。这将防止 Pi 崩溃。