Skip to content

Commit

Permalink
merged master->ros2
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Dec 2, 2024
2 parents 3a782a7 + 3bdbcdf commit 9197e99
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions rtabmap_conversions/src/MsgConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3215,6 +3215,21 @@ bool deskew_impl(
else if(timeDatatype == 8) //float64
{
double sec = *((const double*)(&output.data[u*output.point_step]+offsetTime));
if(sec > 1.e18)
{
// convert nanoseconds to seconds
sec /= 1.e9;
}
else if(sec > 1.e15)
{
// convert microseconds to seconds
sec /= 1.e6;
}
else if(sec > 1.e12)
{
// sec milliseconds to seconds
sec /= 1.e3;
}
stamp = timestampToROS(sec);
}

Expand Down Expand Up @@ -3294,6 +3309,21 @@ bool deskew_impl(
else if(timeDatatype == 8)
{
double sec = *((const double*)(&output.data[v*output.row_step]+offsetTime));
if(sec > 1.e18)
{
// convert nanoseconds to seconds
sec /= 1.e9;
}
else if(sec > 1.e15)
{
// convert microseconds to seconds
sec /= 1.e6;
}
else if(sec > 1.e12)
{
// sec milliseconds to seconds
sec /= 1.e3;
}
stamp = timestampToROS(sec);
}

Expand Down

0 comments on commit 9197e99

Please sign in to comment.