Trouble with compressed image transport and ardrone_autonomy
I recorded some .bag files from a few runs with the ardrone_autonomy node. I was recording the compressed image topic, and I can successfully play it back using image_view.
However, I tried putting together a simple node that would subscribe to the data. It looks like this:
int main(int argc, char **argv)
{
ros::init(argc, argv, "detector_node");
ros::Time::init();
ros::NodeHandle nh;
image_transport::ImageTransport it(nh);
image_transport::Subscriber sub = it.subscribe("ardrone/front/image_raw", 1, imageCallback);
ros::spin();
return 0;
}
I then run the node as such:
rosrun detector_node _image_transport:=compressed
However, I get this error endlessly:
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /tmp/buildd/ros-groovy-opencv2-2.4.6-0precise-20130721-1609/modules/imgproc/src/color.cpp, line 3346 [ERROR] [1379682592.318100441]: /tmp/buildd/ros-groovy-opencv2-2.4.6-0precise-20130721-1609/modules/imgproc/src/color.cpp:3346: error: (-215) scn == 3 || scn == 4 in function cvtColor`
Here's the output from rostopic info:
Type: sensor_msgs/CompressedImage
Publishers: * /play_1379682668712408406 (http://aramis:36403/)
Subscribers: * /detector_node (http://aramis:35284/)
EDIT: When I run the drone live (i.e., not from a bag file), I get the same error. However, if I use the theora transport, it works fine.
EDIT: I'm using ROS Groovy on Ubuntu 12.04.