KavenYau / ros2_astra_camera

ROS2 wrapper for Astra camera
Apache License 2.0
22 stars 6 forks source link

/camera/color/image_raw/compressed no image showed #6

Open beyondli opened 2 years ago

beyondli commented 2 years ago

Hi I found topic /camera/color/image_raw/compressed no image showed in rviz2, only /camera/color/image_raw worked, how to modify ocde that compressed can be worked? thanks

KavenYau commented 1 year ago

https://github.com/KavenYau/ros2_astra_camera/blob/f230765cd1efbc0d4408b4978483cd1c76892ff3/ros2_astra_camera/src/camera_driver.cpp#L31-L32

I only create a CameraPublisher of topic camera/color/image_raw and publish uncompressed images. I have not try to dig out how to get compressed images. Do you know something about this?

KavenYau commented 1 year ago

@beyondli Hi, I found something you might be interested. I am trying to use this package in WSL2(Ubuntu 22.04) + ROS2 Humble + usbipd environment. With applying this patch(https://github.com/KavenYau/ros2_astra_camera/commit/39433ab9bc35ecfdc200e9d4504ba7ac55471aab), I can get images from topic camera/color/image_raw/compressed. But I not sure whether it works in pure Ubuntu.

image

The astra_pro.yaml I used is:

astra_camera_node:
  ros__parameters:
    auto_exposure: true
    auto_white_balance: true
    color_depth_synchronization: false
    ir_frame_id: camera_ir_optical_frame
    rgb_frame_id: camera_rgb_optical_frame
    color_time_offset: -0.033
    data_skip: 0
    depth_camera_info_url: ''
    depth_frame_id: camera_depth_optical_frame
    depth_ir_offset_x: 5.0
    depth_ir_offset_y: 4.0
    depth_mode: 7
    depth_registration: true
    depth_time_offset: 0.0
    device_id: '#1'
    ir_mode: 7
    ir_time_offset: -0.033
    rgb_camera_info_url: ''
    rgb_preferred: true
    use_color: false
    use_depth: true
    use_device_time: false
    use_ir: true
    use_sim_time: false
    z_offset_mm: 0.0
    z_scaling: 1.0

uvc_camera_node:
  ros__parameters:
    vendor: "0x2bc5"
    product: "0x0502"
    serial: ""
    index: 0
    width: 640
    height: 480
    # video_mode: mjpeg
    video_mode: compressed # uncompressed
    frame_rate: 30.0
    timestamp_method: start
    frame_id: camera
    camera_info_url: ""
    scanning_mode: 0
    auto_exposure: 3
beyondli commented 1 year ago

Hi Kaven, Yes, I donot know how to create compress image topic, but I would like to try this patch! any result ,I will feedback. BTW, happy new year 2023!

beyondli commented 1 year ago

Hi Kaven, I try video_mode: compressed # uncompressed, camera cannot bring up successfully

uvc_camera_node-3] [INFO] [1677373529.181744145] [uvc_camera_node]: uvc mode: 640x480@30.000000 compressed [astra_camera_node-2] [INFO] [1677373529.262718668] [astra_camera_node]: depth_mode is Resolution: 640x480@30Hz Format: Depth 1mm [astra_camera_node-2] [INFO] [1677373529.262930982] [astra_camera_node]: color mode is Resolution: 640x480@30Hz Format: RGB888 [astra_camera_node-2] [INFO] [1677373529.263012483] [astra_camera_node]: IR mode is Resolution: 640x480@30Hz Format: Gray16

component_container-1] Image messages received: 8 [component_container-1] CameraInfo messages received: 30 [component_container-1] Synchronized pairs: 8 [uvc_camera_node-3] Couldn't convert frame to RGB: Not supported (-12) [uvc_camera_node-3] Couldn't convert frame to RGB: Not supported (-12) [uvc_camera_node-3] Couldn't convert frame to RGB: Not supported (-12) [uvc_camera_node-3] Couldn't convert frame to RGB: Not supported (-12) [uvc_camera_node-3] Couldn't convert frame to RGB: Not supported (-12) [uvc_camera_node-3] Couldn't convert frame to RGB: Not supported (-12) [uvc_camera_node-3] Couldn't convert frame to RGB: Not supported (-12) [uvc_camera_node-3] Couldn't convert frame to RGB: Not supported (-12) [uvc_camera_node-3] Couldn't convert frame to RGB: Not supported (-12)

seems compress format cannot be convert to RGB data. Have you ever seen this issue ' and another question is can I turn off depth image, since I just need rgb image from uvc?