Skip to content

Commit

Permalink
fix units of time objects (autowarefoundation#195)
Browse files Browse the repository at this point in the history
* fix units of time objects

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* fix tests

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* fix test

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>
  • Loading branch information
mitsudome-r authored Dec 21, 2020
1 parent b1e4400 commit 6c65d90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions localization/ekf_localizer/src/ekf_localizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ 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<std::chrono::seconds>(
auto period_control = std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::duration<double>(ekf_dt_));
timer_control_ = std::make_shared<rclcpp::GenericTimer<decltype(timer_control_callback)>>(
this->get_clock(), period_control, std::move(timer_control_callback),
this->get_node_base_interface()->get_context());
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<std::chrono::seconds>(
auto period_tf = std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::duration<double>(1.0 / tf_rate_));
timer_tf_ = std::make_shared<rclcpp::GenericTimer<decltype(timer_tf_callback)>>(
this->get_clock(), period_tf, std::move(timer_tf_callback),
Expand Down

0 comments on commit 6c65d90

Please sign in to comment.