ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Trouble with compressed image transport and ardrone_autonomy

asked 2013-09-20 03:15:59 -0500

Tom Moore gravatar image

updated 2013-11-14 11:36:19 -0500

tfoote gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-06-24 13:50:07 -0500

Tom Moore gravatar image

updated 2015-06-24 13:50:17 -0500

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

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-09-20 03:15:59 -0500

Seen: 739 times

Last updated: Jun 24 '15