• DepthAI-v2ROS
  • pipeline_graph: qt.qpa.xcb: could not connect to display

I am running

  • ROS 2 Humble in Docker
  • over Raspberry Pi OS 64-bit Bookworm Server
  • on a Raspberry Pi 5

My Oak-D-W97 camera is working well with depthai_ros_driver and apriltag_ros (by remapping the RGB camera images to the AprilTag detector).

I am seeing tons of warnings (that do not seem to be affecting operation):

[VideoEncoder(10)] [warning] Arrived frame type (14) is not either NV12 or YUV400p (8-bit Gray)

pi@GoPi5Go:DOCKER:~/GoPi5Go/ros2ws $ more params/camera.yaml 
/oak:
  ros__parameters:
    camera:
      i_enable_imu: true
      i_enable_ir: false
      i_nn_type: spatial
      i_pipeline_type: RGBD
      cam_pos_x: 0.08
      cam_pos_z: 0.162
      use_rviz: false
    nn:
      i_nn_config_path: depthai_ros_driver/mobilenet
    rgb:
      i_low_bandwidth: true
    left:
      i_low_bandwidth: true
    right:
      i_low_bandwidth: true
    stereo:
      i_low_bandwidth: true

I saw recommendation on the forum to install "DepthAi pipeline_graph tool".

When I attempt to run the pipeline_graph tool, it cores with the following error:

pi@GoPi5Go:DOCKER:~/GoPi5Go/ros2ws $ pipeline_graph run "ros2 launch depthai_ros_driver camera.launch.py camera_model:=OAK-D-W params_file:=/home/pi/GoPi5Go/ros2ws/params/camera.yaml"
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
...
#9    Object "/usr/lib/python3/dist-packages/PySide2/QtWidgets.cpython-310-aarch64-linux-gnu.so", at 0x7fff71eb2923, in 
#8    Object "/lib/aarch64-linux-gnu/libQt5Widgets.so.5", at 0x7fff723286b3, in QApplicationPrivate::init()
#7    Object "/lib/aarch64-linux-gnu/libQt5Gui.so.5", at 0x7fff73aacbe7, in QGuiApplicationPrivate::init()
#6    Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0x7fff7b683f47, in QCoreApplicationPrivate::init()
#5    Object "/lib/aarch64-linux-gnu/libQt5Gui.so.5", at 0x7fff73aa98db, in QGuiApplicationPrivate::createEventDispatcher()
#4    Object "/lib/aarch64-linux-gnu/libQt5Gui.so.5", at 0x7fff73aa942b, in QGuiApplicationPrivate::createPlatformIntegration()
#3    Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0x7fff7b470f63, in QMessageLogger::fatal(char const*, ...) const
#2    Object "/lib/aarch64-linux-gnu/libc.so.6", at 0x7fff878d712f, in abort
#1    Object "/lib/aarch64-linux-gnu/libc.so.6", at 0x7fff878ea67b, in raise
#0    Object "/lib/aarch64-linux-gnu/libc.so.6", at 0x7fff8792f200, in 
Aborted (Signal sent by tkill() 14603 1000)
Aborted (core dumped)

Any guidance for me?

  • jakaskerl replied to this.
    • Best Answerset by cycob

    jakaskerl

    Cool - I was suspicious with the references to noetic and wondered if I needed to "fill in something" for the capitalized "DISPLAY", but adding -e DISPLAY to my docker invocation did the trick:

    pi@GoPi5Go:~/GoPi5Go/ros2ws $ ./display_to_goPi5GoROS2.sh 
    CONTAINER ID   IMAGE          COMMAND                  CREATED      STATUS      PORTS     NAMES
    f88cd4ea79be   gopi5gor2hdp   "/ros_entrypoint.sh ?"   2 days ago   Up 2 days             gopi5goROS2
    
    Starting BASH TERMINAL (with DISPLAY available) to gopi5goROS2 DOCKER container
    docker exec -it -e DISPLAY gopi5goROS2 bash
    To exit:  exit (will not terminate container)
    
    *** Sourcing install/setup.bash
    pi@GoPi5Go:DOCKER:~/GoPi5Go/ros2ws $ pipeline_graph run "ros2 launch depthai_ros_driver camera.launch.py camera_model:=OAK-D-W params_file:=/home/pi/GoPi5Go/ros2ws/params/camera.yaml"
    
    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-pi'
    Pipeline schema retrieved
    Program exited.
    0. ColorCamera.preview (12) -> ImageManip.inputImage (55)
    1. StereoDepth.depth (44) -> SpatialDetectionNetwork.inputDepth (49)
    2. ImageManip.out (57) -> SpatialDetectionNetwork.in (50)
    3. MonoCamera.out (27) -> StereoDepth.right (29)
    4. MonoCamera.out (22) -> StereoDepth.left (30)
    5. VideoEncoder.bitstream (48) -> XLinkOut.in (45)
    6. StereoDepth.depth (44) -> VideoEncoder.in (46)
    7. XLinkIn.out (28) -> MonoCamera.inputControl (24)
    8. SystemLogger.out (2) -> XLinkOut.in (1)
    9. XLinkIn.out (23) -> MonoCamera.inputControl (19)
    10. SpatialDetectionNetwork.out (54) -> XLinkOut.in (5)
    11. XLinkIn.out (18) -> ColorCamera.inputControl (6)
    12. VideoEncoder.bitstream (17) -> XLinkOut.in (14)
    13. IMU.out (4) -> XLinkOut.in (3)
    14. ColorCamera.video (13) -> VideoEncoder.in (15)
    qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 191, resource id: 0, major code: 140 (Unknown), minor code: 20

    {launch_camera ROS2 Humble in Docker on Raspberry Pi}

    jakaskerl

    Cool - I was suspicious with the references to noetic and wondered if I needed to "fill in something" for the capitalized "DISPLAY", but adding -e DISPLAY to my docker invocation did the trick:

    pi@GoPi5Go:~/GoPi5Go/ros2ws $ ./display_to_goPi5GoROS2.sh 
    CONTAINER ID   IMAGE          COMMAND                  CREATED      STATUS      PORTS     NAMES
    f88cd4ea79be   gopi5gor2hdp   "/ros_entrypoint.sh ?"   2 days ago   Up 2 days             gopi5goROS2
    
    Starting BASH TERMINAL (with DISPLAY available) to gopi5goROS2 DOCKER container
    docker exec -it -e DISPLAY gopi5goROS2 bash
    To exit:  exit (will not terminate container)
    
    *** Sourcing install/setup.bash
    pi@GoPi5Go:DOCKER:~/GoPi5Go/ros2ws $ pipeline_graph run "ros2 launch depthai_ros_driver camera.launch.py camera_model:=OAK-D-W params_file:=/home/pi/GoPi5Go/ros2ws/params/camera.yaml"
    
    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-pi'
    Pipeline schema retrieved
    Program exited.
    0. ColorCamera.preview (12) -> ImageManip.inputImage (55)
    1. StereoDepth.depth (44) -> SpatialDetectionNetwork.inputDepth (49)
    2. ImageManip.out (57) -> SpatialDetectionNetwork.in (50)
    3. MonoCamera.out (27) -> StereoDepth.right (29)
    4. MonoCamera.out (22) -> StereoDepth.left (30)
    5. VideoEncoder.bitstream (48) -> XLinkOut.in (45)
    6. StereoDepth.depth (44) -> VideoEncoder.in (46)
    7. XLinkIn.out (28) -> MonoCamera.inputControl (24)
    8. SystemLogger.out (2) -> XLinkOut.in (1)
    9. XLinkIn.out (23) -> MonoCamera.inputControl (19)
    10. SpatialDetectionNetwork.out (54) -> XLinkOut.in (5)
    11. XLinkIn.out (18) -> ColorCamera.inputControl (6)
    12. VideoEncoder.bitstream (17) -> XLinkOut.in (14)
    13. IMU.out (4) -> XLinkOut.in (3)
    14. ColorCamera.video (13) -> VideoEncoder.in (15)
    qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 191, resource id: 0, major code: 140 (Unknown), minor code: 20

    {launch_camera ROS2 Humble in Docker on Raspberry Pi}