mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Follow-up of previous commit to convert all float64 timestamps correctly
This commit is contained in:
@@ -3217,6 +3217,21 @@ bool deskew_impl(
|
|||||||
else if(timeDatatype == 8) //float64
|
else if(timeDatatype == 8) //float64
|
||||||
{
|
{
|
||||||
double sec = *((const double*)(&output.data[u*output.point_step]+offsetTime));
|
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 = ros::Time(sec);
|
stamp = ros::Time(sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3296,6 +3311,21 @@ bool deskew_impl(
|
|||||||
else if(timeDatatype == 8)
|
else if(timeDatatype == 8)
|
||||||
{
|
{
|
||||||
double sec = *((const double*)(&output.data[v*output.row_step]+offsetTime));
|
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 = ros::Time(sec);
|
stamp = ros::Time(sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user