Skip to content

Commit

Permalink
Restore time difference order so future extrapolation exceptions don'…
Browse files Browse the repository at this point in the history
…t show non-sensical negative seconds into the future (#522)
  • Loading branch information
lucasw authored Feb 4, 2022
1 parent 9fa9eec commit c0cb44e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tf2/src/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ void createExtrapolationException2(ros::Time t0, ros::Time t1, std::string* erro
{
if (error_str)
{
ros::Duration tdiff = t1 - t0;
// Want this to come out positive, because this is a future extrapolation problem with t0
// t0 needs to come first because it will be bigger than t1
ros::Duration tdiff = t0 - t1;
char str[163]; // Text without formatting strings has 102, each timestamp has up to 20
snprintf(
str, sizeof(str),
Expand Down

0 comments on commit c0cb44e

Please sign in to comment.