mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 08:47:45 +08:00
refactored time jump detection
This commit is contained in:
@@ -1023,15 +1023,6 @@ bool CoreWrapper::odomUpdate(const nav_msgs::OdometryConstPtr & odomMsg, ros::Ti
|
||||
{
|
||||
if(!paused_)
|
||||
{
|
||||
// Check time jump in the past
|
||||
if(stamp < previousStamp_) {
|
||||
ROS_WARN("Detected time jump in the past of %f sec (previous stamp=%f, current stamp=%f). Resetting internal stamps and abort!",
|
||||
previousStamp_.toSec() - stamp.toSec(), previousStamp_.toSec(), stamp.toSec());
|
||||
previousStamp_ = ros::Time();
|
||||
tfListener_.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
Transform odom = rtabmap_conversions::transformFromPoseMsg(odomMsg->pose.pose);
|
||||
if(!odom.isNull())
|
||||
{
|
||||
@@ -1143,15 +1134,6 @@ bool CoreWrapper::odomTFUpdate(const ros::Time & stamp)
|
||||
{
|
||||
if(!paused_)
|
||||
{
|
||||
// Check time jump in the past
|
||||
if(stamp < previousStamp_) {
|
||||
ROS_WARN("Detected time jump in the past of %f sec (previous stamp=%f, current stamp=%f). Resetting internal stamps and abort!",
|
||||
previousStamp_.toSec() - stamp.toSec(), previousStamp_.toSec(), stamp.toSec());
|
||||
previousStamp_ = ros::Time();
|
||||
tfListener_.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Odom TF ready?
|
||||
Transform odom = rtabmap_conversions::getTransform(odomFrameId_, frameId_, stamp, tfListener_, waitForTransform_?waitForTransformDuration_:0.0);
|
||||
if(odom.isNull())
|
||||
|
||||
Reference in New Issue
Block a user