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

Revision history [back]

cv_bridge::CvImagePtr is a pointer type that points to NULL by default. You have to allocate storage before you can actually use it, and the boost assertion catches the null pointer dereference.

Correct would be either something like

cv_bridge::CvImagePtr cv_ptr(new cv_bridge::CvImage);

or

cv_bridge::CvImagePtr cv_ptr;
cv_ptr.reset (new cv_bridge::CvImage);

As a rule of thumb, every ROS type xxxPtr is a pointer type for xxx.