mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-09 03:07:45 +08:00
Fixed new map trigger from Identity odom when DetectionRate=0 and BufferSize=0. MainWindow: fixed overwritting database on close
This commit is contained in:
@@ -518,13 +518,29 @@ void RtabmapThread::addData(const SensorData & sensorData)
|
||||
return;
|
||||
}
|
||||
|
||||
if(!lastPose_.isIdentity() && sensorData.pose().isIdentity())
|
||||
if(_rate>0.0f)
|
||||
{
|
||||
if(_frameRateTimer->getElapsedTime() < 1.0f/_rate)
|
||||
{
|
||||
if(!lastPose_.isIdentity() && sensorData.pose().isIdentity())
|
||||
{
|
||||
UWARN("Odometry is reset (identity pose detected). Increment map id!");
|
||||
pushNewState(kStateTriggeringMap);
|
||||
_rotVariance = 0;
|
||||
_transVariance = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(_dataBufferMaxSize > 0 && !lastPose_.isIdentity() && sensorData.pose().isIdentity())
|
||||
{
|
||||
UWARN("Odometry is reset (identity pose detected). Increment map id!");
|
||||
pushNewState(kStateTriggeringMap);
|
||||
_rotVariance = 0;
|
||||
_transVariance = 0;
|
||||
}
|
||||
_frameRateTimer->start();
|
||||
|
||||
lastPose_ = sensorData.pose();
|
||||
if(sensorData.poseRotVariance() > _rotVariance)
|
||||
@@ -536,15 +552,6 @@ void RtabmapThread::addData(const SensorData & sensorData)
|
||||
_transVariance = sensorData.poseTransVariance();
|
||||
}
|
||||
|
||||
if(_rate>0.0f)
|
||||
{
|
||||
if(_frameRateTimer->getElapsedTime() < 1.0f/_rate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
_frameRateTimer->start();
|
||||
|
||||
bool notify = true;
|
||||
_dataMutex.lock();
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user