christianrauch / camera_ros

ROS 2 node for libcamera supported cameras (V4L2, Raspberry Pi Camera Modules)
https://libcamera.org
MIT License
68 stars 30 forks source link

Error "what(): cannot create std::vector larger than max_size() [ros2run]: Aborted" when run camera_node #22

Closed thuhangkhuat closed 9 months ago

thuhangkhuat commented 9 months ago

Hi, i try to run camera_node in Raspberry Pi 4 by command: ros2 run camera_ros camera_node --ros-args -p width:=640 -p height:=480 And I have an error:

[1:16:46.295450271] [14117] INFO Camera camera_manager.cpp:284 libcamera v0.2.0+31-5e4dc46a [1:16:46.406360344] [14128] WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise [1:16:46.420912211] [14128] INFO RPI vc4.cpp:401 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media4 and ISP device /dev/media0 [INFO] [1708395316.185715280] [camera]:

cameras: 0: imx708 (/base/soc/i2c0mux/i2c@1/imx708@1a) [WARN] [1708395316.186056480] [camera]: no camera selected, using default: "/base/soc/i2c0mux/i2c@1/imx708@1a" [INFO] [1708395316.188579951] [camera]: stream formats:

  • Pixelformat: NV21 (64x64 - 4608x2592)
  • Pixelformat: YUV420 (64x64 - 4608x2592)
  • Pixelformat: NV12 (64x64 - 4608x2592)
  • Pixelformat: YVU420 (64x64 - 4608x2592)
  • Pixelformat: XBGR8888 (64x64 - 4608x2592)
  • Pixelformat: BGR888 (64x64 - 4608x2592)
  • Pixelformat: RGB888 (64x64 - 4608x2592)
  • Pixelformat: XRGB8888 (64x64 - 4608x2592)
  • Pixelformat: RGB565 (64x64 - 4608x2592)
  • Pixelformat: YVYU (64x64 - 4608x2592)
  • Pixelformat: YUYV (64x64 - 4608x2592)
  • Pixelformat: VYUY (64x64 - 4608x2592)
  • Pixelformat: UYVY (64x64 - 4608x2592) [WARN] [1708395316.189108444] [camera]: no pixel format selected, using default: "XBGR8888" [WARN] [1708395316.189741122] [camera]: stream configuration adjusted from "640x480-XBGR8888" to "640x480-XBGR8888" [1:16:46.426388739] [14117] INFO Camera camera.cpp:1183 configuring streams: (0) 640x480-XBGR8888 [1:16:46.428186181] [14128] INFO RPI vc4.cpp:559 Sensor: /base/soc/i2c0mux/i2c@1/imx708@1a - Selected sensor format: 1536x864-SBGGR10_1X10 - Selected unicam format: 1536x864-pBAA [INFO] [1708395316.197436143] [camera]: camera "/base/soc/i2c0mux/i2c@1/imx708@1a" configured with 640x480-XBGR8888 stream terminate called after throwing an instance of 'std::length_error' what(): cannot create std::vector larger than max_size()

Is it necessary to have a camera.yaml file somewhere to specify parameters? Thank you.

christianrauch commented 9 months ago

Which camera are you using? Is this the same issue as https://github.com/christianrauch/camera_ros/issues/13?

thuhangkhuat commented 9 months ago

Hi, I am using Raspberry camera module v3 (imx708). when I run on a USB camera (imx335), package is still working. So, I will follow the issue as 13. Thank you.

thuhangkhuat commented 9 months ago

Hi, I follow the issue and still have error file:///root/.ros/camera_info/imx708__base_soc_i2c0mux_i2c_1_imx708_1a_3840x2400.yaml [ERROR] [1708496416.367063180] [camera_calibration_parsers]: Unable to open camera calibration file [/root/.ros/camera_info/imx708__base_soc_i2c0mux_i2c_1_imx708_1a_3840x2400.yaml] [WARN] [1708496416.367205567] [camera]: Camera calibration file /root/.ros/camera_info/imx708__base_soc_i2c0mux_i2c_1_imx708_1a_3840x2400.yaml not found camera_node: ../include/libcamera/controls.h:167: T libcamera::ControlValue::get() const [with T = libcamera::Span<const libcamera::Rectangle>; typename std::enable_if<(libcamera::details::is_span<U>::value || std::is_same<std::__cxx11::basic_string<char>, typename std::remove_cv< <template-parameter-1-1> >::type>::value), std::nullptr_t>::type <anonymous> = nullptr]: AssertionisArray_' failed.`

christianrauch commented 9 months ago

You are using the same camera as @Woojin-Crive in the original issue. I am closing this as a duplicate.

Duplicate of #13 .