mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
MainWindow: don't save empty database. Odometry: return null pose when not initialized.
This commit is contained in:
@@ -69,7 +69,6 @@ Odometry::Odometry(const rtabmap::ParametersMap & parameters) :
|
||||
_angularUpdate(Parameters::defaultOdomAngularUpdate()),
|
||||
_resetCountdown(Parameters::defaultOdomResetCountdown()),
|
||||
_force2D(Parameters::defaultOdomForce2D()),
|
||||
_pose(Transform::getIdentity()),
|
||||
_resetCurrentCount(0)
|
||||
{
|
||||
Parameters::parse(parameters, Parameters::kOdomLinearUpdate(), _linearUpdate);
|
||||
@@ -121,6 +120,11 @@ bool Odometry::isLargeEnoughTransform(const Transform & transform)
|
||||
|
||||
Transform Odometry::process(SensorData & data, int * quality, int * features, int * localMapSize)
|
||||
{
|
||||
if(_pose.isNull())
|
||||
{
|
||||
_pose.setIdentity(); // initialized
|
||||
}
|
||||
|
||||
Transform t = this->computeTransform(data, quality, features, localMapSize);
|
||||
if(!t.isNull())
|
||||
{
|
||||
|
||||
@@ -1045,11 +1045,12 @@ bool Rtabmap::process(const SensorData & data)
|
||||
}
|
||||
else if(hypothesis.second < _loopRatio*_lcHypothesisValue)
|
||||
{
|
||||
UDEBUG("rejected hypothesis: not satisfying ratio");
|
||||
UWARN("rejected hypothesis: not satisfying hypothesis ratio (%f < %f * %f)",
|
||||
hypothesis.second, _loopRatio, _lcHypothesisValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
UDEBUG("rejected hypothesis: by epipolar geometry");
|
||||
UWARN("rejected hypothesis: by epipolar geometry");
|
||||
}
|
||||
rejectedHypothesis = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user