Skip to content

Commit

Permalink
CallbackQueue: use SteadyTime instead of WallTime to get independent …
Browse files Browse the repository at this point in the history
…of system-time changes
  • Loading branch information
cwecht authored and Christopher Wecht committed Jul 30, 2020
1 parent 13547f7 commit 1ae22ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clients/roscpp/src/libros/callback_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ CallbackQueue::CallOneResult CallbackQueue::callOne(ros::WallDuration timeout)
return Disabled;
}

ros::WallTime start_time(ros::WallTime::now());
ros::SteadyTime start_time(ros::SteadyTime::now());

if (callbacks_.empty())
{
Expand Down Expand Up @@ -271,7 +271,7 @@ CallbackQueue::CallOneResult CallbackQueue::callOne(ros::WallDuration timeout)
{
// do not spend more than `timeout` seconds in the callback; we already waited for some time when waiting for
// nonempty queue
ros::WallTime now(ros::WallTime::now());
ros::SteadyTime now(ros::SteadyTime::now());
ros::WallDuration time_spent = now - start_time;
ros::WallDuration time_to_wait = timeout - time_spent;

Expand Down

0 comments on commit 1ae22ec

Please sign in to comment.