ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You have a race condition with cv_ptr_rgb
.
You set this global variable in imageCallbackrgb
and use it in imageCallbackdepth
.
If the latter callback is called first you get your null-pointer error.
Check if cv_ptr_rgb
has been set and only then use it.
2 | No.2 Revision |
You have a race condition with cv_ptr_rgb
.
You set this global variable in imageCallbackrgb
and use it in imageCallbackdepth
.
If the latter callback is called first you get your null-pointer error.
Check if cv_ptr_rgb
has been set and only then use it.
You could do it like this:
if (cv_ptr_rgb != NULL) addWeighted( cv_ptr_rgb->image, alpha, image8U, 0.5, 0.5, dst);