0
$\begingroup$

Rosanswers logo

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

Originally posted by makokal on ROS Answers with karma: 1295 on 2011-02-26

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Eric Perko with karma: 8406 on 2011-02-26

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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