Skip to content

Commit

Permalink
Fixed update period computation in test (#693)
Browse files Browse the repository at this point in the history
(cherry picked from commit de7083e)
  • Loading branch information
gwalck authored and mergify[bot] committed Jul 17, 2023
1 parent eaaa084 commit 90d982f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,13 @@ class TrajectoryControllerTest : public ::testing::Test
auto clock = rclcpp::Clock(RCL_STEADY_TIME);
const auto start_time = clock.now();
const auto end_time = start_time + wait_time;
auto previous_time = start_time;

while (clock.now() < end_time)
{
traj_controller_->update(clock.now(), clock.now() - start_time);
auto now = clock.now();
traj_controller_->update(now, now - previous_time);
previous_time = now;
}
}

Expand Down

0 comments on commit 90d982f

Please sign in to comment.