IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.51k stars 1.74k forks source link

"disparity_filter.enable" : "true" does not work #3184

Closed Shunichi09 closed 2 weeks ago

Shunichi09 commented 3 weeks ago

Required Info
Camera Model D435 / D435i
Firmware Version 5.16.0.1
Operating System & Version ubuntu 22.04}
Kernel Version (Linux Only) (e.g. 5.4)
Platform PC
Librealsense SDK Version 2.<?>.<?> }
Language cpp and ros2
Segment {Robot}
ROS Distro Humble }
RealSense ROS Wrapper Version current ros2-dev branch

Issue Description

When I apply "disparity_filter.enable": "true", I encounter the following error:

[realsense2_camera_node-1] Please try different format of this stream.
[realsense2_camera_node-1] [ERROR] [1723874490.956257341] [camera.rs_745412071535]: cv::Mat is empty. Ignoring this frame.
[realsense2_camera_node-1] [ERROR] [1723874490.956261868] [camera.rs_745412071535]: Could not fill ROS message. Frame was dropped.
[realsense2_camera_node-1] [ERROR] [1723874490.992304169] [camera.rs_745412071535]: Format DISPARITY32 is not supported in realsense2_camera node.

I suspect this error might be due to an incorrect format setting for either the depth or RGB streams. My current configuration is as follows:

"depth_module.depth_profile": "1280x720x30",
"rgb_camera.color_profile": "1280x720x30",
"depth_module.infra_profile": "1280x720x30",

I searched through the documentation but couldn't find any information regarding this issue.

Could you please advise me on how to resolve this?

I really appreciate your help in advance.

My current launch settingis

realsense_launch = IncludeLaunchDescription(
        PythonLaunchDescriptionSource(
            os.path.join(
                get_package_share_directory("realsense2_camera"),
                "launch",
                "rs_launch.py",
            )
        ),
        launch_arguments={
            "serial_no": LaunchConfiguration("realsense_serial_number"),
            "depth_module.depth_profile": "1280x720x30",
            "rgb_camera.color_profile": "1280x720x30",
            "depth_module.infra_profile": "1280x720x30",
            "rgb_camera.color_format": "RGB8",
            "enable_sync": "true",
            "align_depth.enable": "true",
            "enable_rgbd": "false",
            "enable_color": "true",
            "enable_depth": "true",
            "camera_name": LaunchConfiguration("realsense_camera_name"),
            "rgb_camera.enable_auto_white_balance": "false",
            "rgb_camera.white_balance": "4600",
            "spatial_filter.enable": "true",  
            "temporal_filter.enable": "true", 
            "hole_filling_filter.enable": "false", 
            "decimation_filter.enable": "true",  
            "disparity_filter.enable": "true",
            "hdr_merge.enable": "true",
        }.items(),
        condition=IfCondition(LaunchConfiguration("realsense_node")),
    )
MartyG-RealSense commented 3 weeks ago

Hi @Shunichi09 A RealSense ROS user at https://github.com/IntelRealSense/realsense-ros/issues/2304 who also had problems with setting the disparity filter to true found that they also had to set disparity_to_depth.enable to true to resolve the problem, as the disparity image is then output in 16-bit format instead of the unsupported 32-bit format.

Shunichi09 commented 3 weeks ago

Thank you for the quick reply!!

Wow! I solved the problem. I really appreciate your help.

MartyG-RealSense commented 3 weeks ago

You are very welcome, @Shunichi09 - I'm pleased that I could help. Thanks very much for the update!

MartyG-RealSense commented 2 weeks ago

Case closed due to solution achieved and no further comments received.