diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch b/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch index 15b79c7..9c6e49c 100644 --- a/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch +++ b/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch @@ -156,5 +156,37 @@ + + + + - 'image_transport/compressedDepth' + + + + + - 'image_transport/compressedDepth' + + + + + - 'image_transport/compressedDepth' + + + + + - 'image_transport/compressedDepth' + + + + + - 'image_transport/compressedDepth' + + + + + - 'image_transport/compressedDepth' + + + diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc b/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc index 189418e..8dd656d 100644 --- a/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc +++ b/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc @@ -322,9 +322,10 @@ class ROSWrapperNodelet : public nodelet::Nodelet { api_->EnableStreamData(Stream::POINTS); api_->SetStreamCallback( Stream::POINTS, [this](const api::StreamData &data) { + ros::Time stamp = hardTimeToSoftTime(data.img->timestamp); static std::size_t count = 0; ++count; - publishPoints(data, count, ros::Time::now()); + publishPoints(data, count, stamp); }); is_published_[Stream::POINTS] = true; } @@ -341,10 +342,10 @@ class ROSWrapperNodelet : public nodelet::Nodelet { api_->EnableStreamData(stream); api_->SetStreamCallback( stream, [this, stream](const api::StreamData &data) { - // data.img is null, not hard timestamp + ros::Time stamp = hardTimeToSoftTime(data.img->timestamp); static std::size_t count = 0; ++count; - publishCamera(stream, data, count, ros::Time::now()); + publishCamera(stream, data, count, stamp); }); is_published_[stream] = true; }