ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Your
IplImage copy = currentImage;
beacause at that point the image cannot be filled. Your callback is called in ros::spinOnce(), so before your first call of spinOnce() your currentImage is 100% empty.Afterwards it might be empty.
Check in your while loop and process only if filled:
ros::Rate loop_rate(5);
IplImage copy = currentImage; IplImage* frame = © // computation......ERROR while (ros::ok()) { ros::spinOnce();
if ( !currentImage.empty() )
{ IplImage copy = currentImage;
//other computations.......Error
}
loop_rate.sleep();
}
2 | No.2 Revision |
Your
IplImage copy = currentImage;
beacause at that point the image cannot be filled. Your callback is called in ros::spinOnce(), so before your first call of spinOnce() your currentImage is 100% empty.Afterwards it might be empty.
Check in your while loop and process only if filled:
ros::Rate loop_rate(5); IplImage copy = currentImage; IplImage* frame = © // computation......ERROR
}
3 | No.3 Revision |
Your
IplImage copy = currentImage;
beacause cannot work because at that point the image cannot be filled. Your callback is called in ros::spinOnce(), so before your first call of spinOnce() your currentImage is 100% empty.Afterwards it might be empty.
Check in your while loop and process only if filled:
ros::Rate loop_rate(5);
while (ros::ok())
{
ros::spinOnce();
if ( !currentImage.empty() )
{
IplImage copy = currentImage;
//other computations.
}
loop_rate.sleep();
}