Closed cardboardcode closed 2 years ago
Narrowed down the issue to the cv_bridge
conversion.
sensor_msgs::msg::Image::SharedPtr output_msg =
cv_bridge::CvImage(std_msgs::msg::Header(), "bgr8", resultImg).toImageMsg();
visual_pub->publish(*output_msg);
Include the following line before the the cv_bridge
conversion as show above:
cv::cvtColor(resultImg, resultImg, CV_BGR2RGB); // Include this line.
sensor_msgs::msg::Image::SharedPtr output_msg =
cv_bridge::CvImage(std_msgs::msg::Header(), "bgr8", resultImg).toImageMsg();
Issue Description
The following image is outputted when running default virtual_camera test image with EPD on ROS2 Humble:
Source of Error
For some reason, the RGB format of incoming
sensor_msgs::msg::Image
is flipped as shown by the output image.