fix(wrapper): fix camera info repeat bug
This commit is contained in:
parent
30ed3ed5e2
commit
b6d4037357
|
@ -315,7 +315,7 @@ class ROSWrapperNodelet : public nodelet::Nodelet {
|
||||||
for (auto &&it = mono_topics.begin(); it != mono_topics.end(); ++it) {
|
for (auto &&it = mono_topics.begin(); it != mono_topics.end(); ++it) {
|
||||||
auto &&topic = mono_topics[it->first];
|
auto &&topic = mono_topics[it->first];
|
||||||
if (it->first == Stream::LEFT || it->first == Stream::RIGHT) {
|
if (it->first == Stream::LEFT || it->first == Stream::RIGHT) {
|
||||||
mono_publishers_[it->first] = it_mynteye.advertiseCamera(topic, 1);
|
mono_publishers_[it->first] = it_mynteye.advertise(topic, 1);
|
||||||
}
|
}
|
||||||
NODELET_INFO_STREAM("Advertized on topic " << topic);
|
NODELET_INFO_STREAM("Advertized on topic " << topic);
|
||||||
}
|
}
|
||||||
|
@ -828,9 +828,7 @@ class ROSWrapperNodelet : public nodelet::Nodelet {
|
||||||
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_);
|
pthread_mutex_unlock(&mutex_data_);
|
||||||
auto &&info = getCameraInfo(stream);
|
mono_publishers_[stream].publish(msg);
|
||||||
info->header.stamp = msg->header.stamp;
|
|
||||||
mono_publishers_[stream].publish(msg, info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void publishPoints(
|
void publishPoints(
|
||||||
|
@ -1517,7 +1515,7 @@ class ROSWrapperNodelet : public nodelet::Nodelet {
|
||||||
std::map<Stream, std::string> image_encodings_;
|
std::map<Stream, std::string> image_encodings_;
|
||||||
|
|
||||||
// mono: LEFT, RIGHT
|
// mono: LEFT, RIGHT
|
||||||
std::map<Stream, image_transport::CameraPublisher> mono_publishers_;
|
std::map<Stream, image_transport::Publisher> mono_publishers_;
|
||||||
|
|
||||||
// pointcloud: POINTS
|
// pointcloud: POINTS
|
||||||
ros::Publisher points_publisher_;
|
ros::Publisher points_publisher_;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user