我使用catkin_make构建工作区时遇到问题。我在 Docker容器中使用ROS旋律。
我的/workspace/src
文件夹中有2个软件包。一种叫做 pluto-ros-package 和 pluto_camera_ros_package 。这两个添加了一些功能来控制我的PlutoX纳米无人机。当我安装 pluto-ros-package 时,一切正常……但是当我尝试安装 pluto_camera_ros_package 时,出现以下错误:
root@064f7b7f1c56:/workspace# catkin_make
Base path: /workspace
Source space: /workspace/src
Build space: /workspace/build
Devel space: /workspace/devel
Install space: /workspace/install
####
#### Running command: "make cmake_check_build_system" in "/workspace/build"
####
####
#### Running command: "make -j12 -l12" in "/workspace/build"
####
[ 0%] Built target geometry_msgs_generate_messages_nodejs
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_eus
[ 0%] Built target std_msgs_generate_messages_nodejs
[ 0%] Built target std_msgs_generate_messages_cpp
[ 0%] Built target std_msgs_generate_messages_py
[ 0%] Built target rosgraph_msgs_generate_messages_nodejs
[ 1%] Built target plutoserver_generate_messages
[ 1%] Built target _plutodrone_generate_messages_check_deps_PlutoMsgAP
[ 1%] Built target _plutodrone_generate_messages_check_deps_PlutoMsg
[ 3%] Built target plutodrone
[ 3%] Built target _plutodrone_generate_messages_check_deps_PlutoPilot
[ 3%] Built target roscpp_generate_messages_eus
[ 3%] Built target rosgraph_msgs_generate_messages_lisp
[ 3%] Built target rosgraph_msgs_generate_messages_py
[ 3%] Built target roscpp_generate_messages_cpp
[ 3%] Built target roscpp_generate_messages_py
[ 3%] Built target rosgraph_msgs_generate_messages_cpp
[ 3%] Built target roscpp_generate_messages_lisp
[ 3%] Built target rosgraph_msgs_generate_messages_eus
[ 3%] Built target sensor_msgs_generate_messages_py
[ 3%] Built target roscpp_generate_messages_nodejs
[ 3%] Built target geometry_msgs_generate_messages_cpp
[ 3%] Built target sensor_msgs_generate_messages_cpp
[ 3%] Built target sensor_msgs_generate_messages_eus
[ 3%] Built target geometry_msgs_generate_messages_eus
[ 3%] Built target geometry_msgs_generate_messages_lisp
[ 3%] Built target sensor_msgs_generate_messages_nodejs
[ 3%] Built target geometry_msgs_generate_messages_py
[ 7%] Built target plutodrone_generate_messages_lisp
[ 7%] Built target sensor_msgs_generate_messages_lisp
[ 10%] Built target gtest
[ 14%] Built target plutodrone_generate_messages_cpp
[ 15%] Built target pluto_camera_sense
[ 18%] Built target pluto_image_sub
[ 23%] Built target plutodrone_generate_messages_eus
[ 34%] Built target plutodrone_generate_messages_nodejs
[ 34%] Built target plutodrone_generate_messages_py
[ 36%] Built target plutoswarm
[ 39%] Built target plutojoystick
[ 47%] Built target camera_calibration_parsers
[ 47%] Built target plutoserver
[ 50%] Built target plutonode
[ 50%] Built target _polled_camera_generate_messages_check_deps_GetPolledImage
[ 60%] Built target image_transport
[ 60%] Built target plutodrone_generate_messages
[ 61%] Built target polled_camera_generate_messages_cpp
[ 64%] Built target polled_camera_generate_messages_py
[ 65%] Built target polled_camera_generate_messages_lisp
[ 68%] Built target polled_camera_generate_messages_eus
[ 69%] Built target polled_camera_generate_messages_nodejs
[ 72%] Built target convert
[ 75%] Built target camera_calibration_parsers_wrapper
[ 77%] Built target republish
[ 80%] Built target camera_info_manager
[ 84%] Built target image_transport_plugins
[ 86%] Built target list_transports
[ 86%] Built target polled_camera_generate_messages
[ 89%] Built target imagepronode
[ 92%] Built target polled_camera
[ 93%] Building CXX object pluto_camera_ros_packages/pluto_camera_sense/CMakeFiles/plutocamera.dir/src/plutocamera.cpp.o
[ 96%] Built target unit_test
[ 98%] Built target poller
/workspace/src/pluto_camera_ros_packages/pluto_camera_sense/src/plutocamera.cpp: In function ‘void read_buffer(void*, lewei_video_frame*)’:
/workspace/src/pluto_camera_ros_packages/pluto_camera_sense/src/plutocamera.cpp:87:73: warning: ‘int avcodec_decode_video2(AVCodecContext*, AVFrame*, int*, const AVPacket*)’ is deprecated [-Wdeprecated-declarations]
ret = avcodec_decode_video2(pCodecCtxc, pVideoFrame, &got_picture, &pkt);
^
In file included from /workspace/src/pluto_camera_ros_packages/pluto_camera_sense/src/plutocamera.cpp:20:0:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4993:5: note: declared here
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
^~~~~~~~~~~~~~~~~~~~~
/workspace/src/pluto_camera_ros_packages/pluto_camera_sense/src/plutocamera.cpp:116:112: error: ‘PIX_FMT_BGR24’ was not declared in this scope
SwsContext* conversion = sws_getContext(width, height, (AVPixelFormat) pVideoFrame->format, width, height, PIX_FMT_BGR24, SWS_FAST_BILINEAR, NULL, NULL, NULL);
^~~~~~~~~~~~~
/workspace/src/pluto_camera_ros_packages/pluto_camera_sense/src/plutocamera.cpp:116:112: note: suggested alternative: ‘AV_PIX_FMT_BGR24’
SwsContext* conversion = sws_getContext(width, height, (AVPixelFormat) pVideoFrame->format, width, height, PIX_FMT_BGR24, SWS_FAST_BILINEAR, NULL, NULL, NULL);
^~~~~~~~~~~~~
AV_PIX_FMT_BGR24
pluto_camera_ros_packages/pluto_camera_sense/CMakeFiles/plutocamera.dir/build.make:62: recipe for target 'pluto_camera_ros_packages/pluto_camera_sense/CMakeFiles/plutocamera.dir/src/plutocamera.cpp.o' failed
make[2]: *** [pluto_camera_ros_packages/pluto_camera_sense/CMakeFiles/plutocamera.dir/src/plutocamera.cpp.o] Error 1
CMakeFiles/Makefile2:3018: recipe for target 'pluto_camera_ros_packages/pluto_camera_sense/CMakeFiles/plutocamera.dir/all' failed
make[1]: *** [pluto_camera_ros_packages/pluto_camera_sense/CMakeFiles/plutocamera.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j12 -l12" failed
如果您需要更多信息(Makefile,文件夹结构等),请询问。
非常感谢!