From cb59f5927775c01ab3173eeb28a14b409c95f493 Mon Sep 17 00:00:00 2001 From: cyy_mac Date: Sat, 28 Mar 2026 05:03:46 +0800 Subject: [PATCH] try fix gray --- .../ros2_hik_camera/src/hik_camera_node.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rm_hardware_driver/ros2_hik_camera/src/hik_camera_node.cpp b/src/rm_hardware_driver/ros2_hik_camera/src/hik_camera_node.cpp index 0fddf93..bcdfbe2 100644 --- a/src/rm_hardware_driver/ros2_hik_camera/src/hik_camera_node.cpp +++ b/src/rm_hardware_driver/ros2_hik_camera/src/hik_camera_node.cpp @@ -280,6 +280,10 @@ private: // Apply ROI/offset before querying image info applyRoiLocked(); + // Set pixel format to RGB8 (try to force color output) + // PixelType_Gvsp_RGB8_Packed = 0x02100014 + (void)MV_CC_SetEnumValue(camera_handle_, "PixelFormat", PixelType_Gvsp_RGB8_Packed); + // Set exposure / gain (void)MV_CC_SetFloatValue(camera_handle_, "ExposureTime", static_cast(exposure_time_)); (void)MV_CC_SetFloatValue(camera_handle_, "Gain", static_cast(gain_));