Ask Your Question
0

services with sensor_msgs::Image response in diamondback ubuntu10.10

asked 2011-02-26 08:04:34 -0500

makokal gravatar image

updated 2011-02-26 08:58:23 -0500

Eric Perko gravatar image

Hi,

I am making some set of nodes for which I want grab images from a camera(usb) only at certain times and I need very strict timings to do evaluation. I have created a service to return a sensor_msgs::Image img as a response. But I keep getting

error: no match for ‘operator=’ in ‘res->perception_srvs::GetRawImageResponse_<std::allocator<void> >::img = sensor_msgs::CvBridge::cvToImgMsg(const IplImage*, std::string)(std::basic_string<char, std::char_traits<char>, std::allocator<char> >(((const char*)"passthrough"), ((const std::allocator<char>&)((const std::allocator<char>*)(& std::allocator<char>()))))) `

when doing res.img = cv_bridge_converter.cvToImgMsg(current_img) with current_img being an IplImage.

I have checked the polled_camera package as option, but it still does not give me the flow I need. Publishing the images for me will be an overkill, I just need to move them around at very few and specific instances.

Here is my code snippet for this piece

`// some code`
camera >> current_img;
try
{
  IplImage img = current_img;
  res.img = cv_converter.cvToImgMsg(&img, "passthrough"); 
}
catch (sensor_msgs::CvBridgeException e)
{
  ROS_ERROR("CvBridge conversion exception, [%s]", e.what());
}
// some more code
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2011-02-26 09:01:46 -0500

Eric Perko gravatar image

The cv_bridge API changed significantly in Diamondback. I suggest you take a look at the C++ tutorial again and make sure you select "diamondback" in the version selector at the top of the page.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-02-26 08:04:34 -0500

Seen: 1,003 times

Last updated: Feb 26 '11