fix(ros): add mutex_data_ in mono
This commit is contained in:
parent
b4ddf5a816
commit
c64fec21d7
|
@ -668,9 +668,11 @@ class ROSWrapperNodelet : public nodelet::Nodelet {
|
||||||
header.seq = seq;
|
header.seq = seq;
|
||||||
header.stamp = stamp;
|
header.stamp = stamp;
|
||||||
header.frame_id = frame_ids_[stream];
|
header.frame_id = frame_ids_[stream];
|
||||||
|
pthread_mutex_lock(&mutex_data_);
|
||||||
cv::Mat mono;
|
cv::Mat mono;
|
||||||
cv::cvtColor(data.frame, mono, CV_RGB2GRAY);
|
cv::cvtColor(data.frame, mono, CV_RGB2GRAY);
|
||||||
auto &&msg = cv_bridge::CvImage(header, enc::MONO8, mono).toImageMsg();
|
auto &&msg = cv_bridge::CvImage(header, enc::MONO8, mono).toImageMsg();
|
||||||
|
pthread_mutex_unlock(&mutex_data_);
|
||||||
auto &&info = getCameraInfo(stream);
|
auto &&info = getCameraInfo(stream);
|
||||||
info->header.stamp = msg->header.stamp;
|
info->header.stamp = msg->header.stamp;
|
||||||
mono_publishers_[stream].publish(msg, info);
|
mono_publishers_[stream].publish(msg, info);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user