depthai-ros icon indicating copy to clipboard operation
depthai-ros copied to clipboard

[Feature-Request] Add Color Order Parameter in ROS Driver

Open HJGrant opened this issue 1 year ago • 1 comments

Start with the why:

For a larger pipeline I need the /oak/rgb/image_raw to publish in RGB format instead of BGR format, since my downstream nodes don't support the BGR color order.

Move to the what:

Please add the option to specify the color order in the depthai_ros_dirver parameters .yaml files, since it seems this option is missing in the parameters list.

Move to the how:

I tried editing line 75 in src/depthai-ros/depthai_ros_driver/src/dai_nodes/sensors/rgb.cpp to:

convConfig.encoding = dai::RawImgFrame::Type::RGB888i;

But this didn't cause the right format to be published on the /oak/rgb/image_raw topic. The format bgr8 is still being published.

HJGrant avatar Feb 28 '25 16:02 HJGrant

Hi, sorry for the reply, will add it to the backlog, probably will be in the next release, though please keep in mind that this might break some things in the pipeline if you use nodes that don't expect different color ordering. convConfig.encoding is only used for low_bandwidth mode, to switch color ordering you would need to call colorCam->setColorOrder(dai::ColorCameraProperties::ColorOrder::RGB); for example here

Serafadam avatar Mar 10 '25 18:03 Serafadam