'JPEG compression requires 8-bit, 1/3-channel images' error since Fuerte
I developed an application based on the old RVIZ (wxWidgets) and I have a tool that takes an OgreImage (from a video feed) and publishes on a different topic as a screenshot. I use a standard image_transport publisher.
In Diamondback, the listener could choose between raw, compressed, and theora. In Fuerte, only raw works.
On the publisher side, I get the following error with compressed: Compressed Image Transport - JPEG compression requires 8-bit, 1/3-channel images (input format is: rgba8)
I'm wondering if some format support was removed in Fuerte, since this used to work. Here is my code:
void PhotoTool::publishImageToROS(const Ogre::Image& ogreImage, const std::string& referenceFrame)
{
sensor_msgs::Image rosImage;
static int seq = 0;
rosImage.header.seq = seq++;
rosImage.header.frame_id = referenceFrame;
rosImage.header.stamp = ros::Time::now();
rosImage.height = ogreImage.getHeight();
rosImage.width = ogreImage.getWidth();
rosImage.encoding = "rgba8";
rosImage.is_bigendian = false;
rosImage.step = ogreImage.getRowSpan();
size_t size = rosImage.step * rosImage.height;
rosImage.data.resize(size);
// Copies the data from the Ogre Image to the ROS Image
memcpy((char*) (&rosImage.data[0]), ogreImage.getData(), size);
publisher.publish(rosImage);
}