0
$\begingroup$

Rosanswers logo

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.


Originally posted by Tom Moore on ROS Answers with karma: 13689 on 2013-09-20

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I believe my issue for this was that I had a conflicting installation of OpenCV.


Originally posted by Tom Moore with karma: 13689 on 2015-06-24

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.