Skip to content

Commit

Permalink
Deskewing: add support for timestamp float64 field in nanoseconds (Li…
Browse files Browse the repository at this point in the history
…vox)
  • Loading branch information
matlabbe committed Dec 1, 2024
1 parent 6f81a8f commit e5667b2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions rtabmap_conversions/src/MsgConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3058,6 +3058,25 @@ bool deskew_impl(
}
}

if(secFirst > 1.e18)
{
// convert nanoseconds to seconds
secFirst /= 1.e9;
secLast /= 1.e9;
}
else if(secFirst > 1.e15)
{
// convert microseconds to seconds
secFirst /= 1.e6;
secLast /= 1.e6;
}
else if(secFirst > 1.e12)
{
// convert milliseconds to seconds
secFirst /= 1.e3;
secLast /= 1.e3;
}

firstStamp = ros::Time(secFirst);
lastStamp = ros::Time(secLast);
}
Expand Down

0 comments on commit e5667b2

Please sign in to comment.