From 6c65d90fe8b4842e9a6efc2281e4ab105c954904 Mon Sep 17 00:00:00 2001 From: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> Date: Mon, 21 Dec 2020 20:49:12 +0900 Subject: [PATCH] fix units of time objects (#195) * fix units of time objects Signed-off-by: mitsudome-r * fix tests Signed-off-by: mitsudome-r * fix test Signed-off-by: mitsudome-r --- localization/ekf_localizer/src/ekf_localizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localization/ekf_localizer/src/ekf_localizer.cpp b/localization/ekf_localizer/src/ekf_localizer.cpp index f2eef6e5634ba..7fadff0ebbddd 100644 --- a/localization/ekf_localizer/src/ekf_localizer.cpp +++ b/localization/ekf_localizer/src/ekf_localizer.cpp @@ -84,7 +84,7 @@ EKFLocalizer::EKFLocalizer(const std::string & node_name, const rclcpp::NodeOpti /* initialize ros system */ auto timer_control_callback = std::bind(&EKFLocalizer::timerCallback, this); - auto period_control = std::chrono::duration_cast( + auto period_control = std::chrono::duration_cast( std::chrono::duration(ekf_dt_)); timer_control_ = std::make_shared>( this->get_clock(), period_control, std::move(timer_control_callback), @@ -92,7 +92,7 @@ EKFLocalizer::EKFLocalizer(const std::string & node_name, const rclcpp::NodeOpti this->get_node_timers_interface()->add_timer(timer_control_, nullptr); auto timer_tf_callback = std::bind(&EKFLocalizer::timerTFCallback, this); - auto period_tf = std::chrono::duration_cast( + auto period_tf = std::chrono::duration_cast( std::chrono::duration(1.0 / tf_rate_)); timer_tf_ = std::make_shared>( this->get_clock(), period_tf, std::move(timer_tf_callback),