ros-drivers/usb_cam

Failed at catkin_make in Ubuntu 20.04 (arm64v8/ros:noetic docker image)

packetsss opened this issue · 7 comments

Hi, it builds with ROS Melodic but when I tried the Noetic release and this upstream version with catkin_make, they both failed. The below is the error message, Thanks for your help

log file

/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp: In member function ‘int usb_cam::UsbCam::init_mjpeg_decoder(int, int)’:
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:368:24: warning: ‘void avcodec_register_all()’ is deprecated [-Wdeprecated-declarations]
  368 |   avcodec_register_all();
      |                        ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:4159:6: note: declared here
 4159 | void avcodec_register_all(void);
      |      ^~~~~~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:368:24: warning: ‘void avcodec_register_all()’ is deprecated [-Wdeprecated-declarations]
  368 |   avcodec_register_all();
      |                        ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:4159:6: note: declared here
 4159 | void avcodec_register_all(void);
      |      ^~~~~~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:386:89: warning: ‘int avpicture_alloc(AVPicture*, AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  386 |   avpicture_alloc((AVPicture *)avframe_rgb_, AV_PIX_FMT_RGB24, image_width, image_height);
      |                                                                                         ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:5483:5: note: declared here
 5483 | int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
      |     ^~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:386:89: warning: ‘int avpicture_alloc(AVPicture*, AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  386 |   avpicture_alloc((AVPicture *)avframe_rgb_, AV_PIX_FMT_RGB24, image_width, image_height);
      |                                                                                         ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:5483:5: note: declared here
 5483 | int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
      |     ^~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:397:90: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  397 |   avframe_camera_size_ = avpicture_get_size(AV_PIX_FMT_YUV422P, image_width, image_height);
      |                                                                                          ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:5510:5: note: declared here
 5510 | int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
      |     ^~~~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:397:90: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  397 |   avframe_camera_size_ = avpicture_get_size(AV_PIX_FMT_YUV422P, image_width, image_height);
      |                                                                                          ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:5510:5: note: declared here
 5510 | int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
      |     ^~~~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:398:85: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  398 |   avframe_rgb_size_ = avpicture_get_size(AV_PIX_FMT_RGB24, image_width, image_height);
      |                                                                                     ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:5510:5: note: declared here
 5510 | int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
      |     ^~~~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:398:85: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  398 |   avframe_rgb_size_ = avpicture_get_size(AV_PIX_FMT_RGB24, image_width, image_height);
      |                                                                                     ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:5510:5: note: declared here
 5510 | int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
      |     ^~~~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp: In member function ‘void usb_cam::UsbCam::mjpeg2rgb(char*, int, char*, int)’:
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:422:94: warning: ‘int avcodec_decode_video2(AVCodecContext*, AVFrame*, int*, const AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  422 |   decoded_len = avcodec_decode_video2(avcodec_context_, avframe_camera_, &got_picture, &avpkt);
      |                                                                                              ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:4828:5: note: declared here
 4828 | int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
      |     ^~~~~~~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:422:94: warning: ‘int avcodec_decode_video2(AVCodecContext*, AVFrame*, int*, const AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  422 |   decoded_len = avcodec_decode_video2(avcodec_context_, avframe_camera_, &got_picture, &avpkt);
      |                                                                                              ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:4828:5: note: declared here
 4828 | int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
      |     ^~~~~~~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:441:76: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  441 |   int pic_size = avpicture_get_size(avcodec_context_->pix_fmt, xsize, ysize);
      |                                                                            ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:5510:5: note: declared here
 5510 | int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
      |     ^~~~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:441:76: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
  441 |   int pic_size = avpicture_get_size(avcodec_context_->pix_fmt, xsize, ysize);
      |                                                                            ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:5510:5: note: declared here
 5510 | int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
      |     ^~~~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:454:123: warning: ‘int avpicture_layout(const AVPicture*, AVPixelFormat, int, int, unsigned char*, int)’ is deprecated [-Wdeprecated-declarations]
  454 |   int size = avpicture_layout((AVPicture *)avframe_rgb_, AV_PIX_FMT_RGB24, xsize, ysize, (uint8_t *)RGB, avframe_rgb_size_);
      |                                                                                                                           ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:5502:5: note: declared here
 5502 | int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt,
      |     ^~~~~~~~~~~~~~~~
/root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:454:123: warning: ‘int avpicture_layout(const AVPicture*, AVPixelFormat, int, int, unsigned char*, int)’ is deprecated [-Wdeprecated-declarations]
  454 |   int size = avpicture_layout((AVPicture *)avframe_rgb_, AV_PIX_FMT_RGB24, xsize, ysize, (uint8_t *)RGB, avframe_rgb_size_);
      |                                                                                                                           ^
In file included from /root/ros_ws/src/remote_racer/usb_cam-release/include/usb_cam/usb_cam.h:44,
                 from /root/ros_ws/src/remote_racer/usb_cam-release/src/usb_cam.cpp:55:
/usr/include/aarch64-linux-gnu/libavcodec/avcodec.h:5502:5: note: declared here
 5502 | int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt,
      |     ^~~~~~~~~~~~~~~~
[ 96%] Linking CXX shared library /root/ros_ws/devel/lib/libusb_cam.so
[ 96%] Built target usb_cam
Scanning dependencies of target usb_cam_node
[ 98%] Building CXX object remote_racer/usb_cam-release/CMakeFiles/usb_cam_node.dir/nodes/usb_cam_node.cpp.o
[100%] Linking CXX executable /root/ros_ws/devel/lib/usb_cam/usb_cam_node
/usr/bin/ld: warning: libnvll.so, needed by /lib/aarch64-linux-gnu/libdrm.so.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libnvos.so, needed by /lib/aarch64-linux-gnu/libdrm.so.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllIsDisplayConnected'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllDestroyDevice'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllDestroyDisplay'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllSetFlipTimestamp'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllGetNumHeads'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllCreateDevice'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllSetMode'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllCreateImage'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllMapImage'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllGetHeadLut'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllGetNumWindows'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllSetHead'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllSetFlipSyncpt'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllUnmapImage'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllSetCursor'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllReadVblankSyncpt'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllGetMode'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllCreateImageGem'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllReleaseOverlays'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllGetConnectorType'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllVblankSyncptWait'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllGetFlipSyncpt'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllPflipSyncptWait'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllMoveCursor'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllGetModeDB'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllReserveBw'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllSetHeadLut'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllGetEncoderType'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `NvOsGetConfigU32'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllExportDmaBuf'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllGetHdrSupported'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllDestroyImage'
/usr/bin/ld: /lib/aarch64-linux-gnu/libdrm.so.2: undefined reference to `nvllImportDmaBuf'
collect2: error: ld returned 1 exit status
make[2]: *** [remote_racer/usb_cam-release/CMakeFiles/usb_cam_node.dir/build.make:114: /root/ros_ws/devel/lib/usb_cam/usb_cam_node] Error 1
make[1]: *** [CMakeFiles/Makefile2:2613: remote_racer/usb_cam-release/CMakeFiles/usb_cam_node.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Invoking "make -j4 -l4" failed

@packetsss what branch are you trying out? also did you install the dependencies using rosdep?

@flynneva we tried the ros-gpb/usb_cam-release repo (debian/noetic/usb_cam and release/noetic/usb_cam) since it was mentioned here This is the Dockerfile we are using. Also we didn't use rosdep and sorry for the dumb question but how can we install the dependencies using rosdep? (I'm still a ros newbie)

@flynneva Sorry the above details are wrong. rosdep is used as seen in L62 of Dockerfile. The develop branch of usb_cam is used as seen in L39 of Dockerfile

So I can't make out if you are building before you run rosdep, I would recommend running rosdep as soon as you clone the repos to your src directory - that way you know you've got your sources and your deps covered before doing anything else.

rosdep is run before building the package. The 2 you see before that is installing catkin and serial for Noetic from source since we don't have binaries for them currently.

Usually when the issue is rosdep we do get an error indicating which package is missing (which is what prompted us to build catkin and serial from source)

so this is definitely something to do with some nvidia libraries missing (libnvll.so and libnvos.so are missing it says in your logs above) in your environment and not due to the usb_cam package.

from some googling it looks like someone else had the same problem and it was answered over on the nvidia forums.

try some of those suggestions and let me know if that helped you at all

Closed due to inactivity and external dependencies