Update launch file and sync interval duration

This commit is contained in:
Joe Dong
2024-03-26 11:06:28 +08:00
parent 13d707ff3c
commit 2a666ea345
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -30,7 +30,9 @@ D2CViewer::D2CViewer(rclcpp::Node* const node, rmw_qos_profile_t rgb_qos,
node_, "depth/image_raw", depth_qos);
sync_ = std::make_shared<message_filters::Synchronizer<MySyncPolicy>>(MySyncPolicy(10), *rgb_sub_,
*depth_sub_);
sync_->setMaxIntervalDuration(rclcpp::Duration::from_seconds(1.0)); // 1s
// set 2ms as the max interval duration
int64_t max_interval_duration_ns = 2000000;
sync_->setMaxIntervalDuration(rclcpp::Duration::from_nanoseconds(max_interval_duration_ns));
using std::placeholders::_1;
using std::placeholders::_2;