ethz-asl / rovio

Other
1.12k stars 506 forks source link

Error when use camera of ar drone parrot 2 #201

Closed ZakariaChekakta closed 5 years ago

ZakariaChekakta commented 5 years ago

I have a problem (cv_bridge exception) when use the Rovio with Ar drone camera as an input (/ardrone/image_raw). Any help?

[ERROR] [1543498947.803930866]: cv_bridge exception: [rgb8] is a color format but [8UC1] is not so they must have the same OpenCV type, CV_8UC3, CV16UC1 ....

odinhr commented 5 years ago

Hi @chekakta,

I think your error is caused by the color format. You should give Rovio a grayscale image. You can convert your image to grayscale with the image_proc ROS node (http://wiki.ros.org/image_proc). Then subscribe Rovio to one of the new published topics(image_rect or image_mono). Try it!

RigerLee commented 5 years ago

In my case, change sensor_msgs::image_encodings::TYPE_8UC1 to sensor_msgs::image_encodings::MONO8 in imgCallback solved the problem. (If you use RGB as input)