@@ -1184,6 +1184,58 @@ void StateEstimationSmoother::process_pending_gtsam_updates_locked()
11841184 << " nr factors. New factors=" << state_.gtsam ->newFactors .size ()
11851185 << " , new values=" << state_.gtsam ->newValues .size ());
11861186
1187+ // Per-type factor counts in the current sliding window. Useful to diagnose
1188+ // which sensor streams are actively contributing to the smoother.
1189+ if (isLoggingLevelVisible (mrpt::system::LVL_DEBUG ))
1190+ {
1191+ size_t nPosePrior = 0 , nPoseBetween = 0 , nTwistPrior = 0 ;
1192+ size_t nImuAttitude = 0 , nImuGravity = 0 , nGnss = 0 ;
1193+ size_t nConstVel = 0 , nTrapInt = 0 , nAngVelInt = 0 , nTricycle = 0 ;
1194+ size_t nOther = 0 , nNullSlots = 0 ;
1195+
1196+ for (const auto & f : smoother.getFactors ())
1197+ {
1198+ if (!f)
1199+ {
1200+ ++nNullSlots; // unused slots (findUnusedFactorSlots=true)
1201+ continue ;
1202+ }
1203+ const auto * p = f.get ();
1204+ if (dynamic_cast <const gtsam::PriorFactor<gtsam::Pose3>*>(p))
1205+ ++nPosePrior;
1206+ else if (dynamic_cast <const gtsam::BetweenFactor<gtsam::Pose3>*>(p))
1207+ ++nPoseBetween;
1208+ else if (dynamic_cast <const gtsam::PriorFactor<gtsam::Point3>*>(p))
1209+ ++nTwistPrior;
1210+ else if (dynamic_cast <const mola::factors::Pose3RotationFactor*>(p))
1211+ ++nImuAttitude;
1212+ else if (dynamic_cast <const mola::factors::MeasuredGravityFactor*>(p))
1213+ ++nImuGravity;
1214+ else if (dynamic_cast <const mola::factors::FactorGnssMapEnu*>(p))
1215+ ++nGnss;
1216+ else if (dynamic_cast <const mola::factors::FactorConstLocalVelocityPose*>(p))
1217+ ++nConstVel;
1218+ else if (dynamic_cast <const mola::factors::FactorTrapezoidalIntegratorPose*>(p))
1219+ ++nTrapInt;
1220+ else if (dynamic_cast <const mola::factors::FactorAngularVelocityIntegrationPose*>(p))
1221+ ++nAngVelInt;
1222+ else if (dynamic_cast <const mola::factors::FactorTricycleKinematic*>(p))
1223+ ++nTricycle;
1224+ else
1225+ ++nOther;
1226+ }
1227+
1228+ MRPT_LOG_DEBUG_FMT (
1229+ " [sliding-window factors] KFs=%zu odom-frames=%zu | "
1230+ " pose priors=%zu pose between (odom)=%zu twist priors=%zu | "
1231+ " IMU attitude=%zu IMU gravity=%zu GNSS=%zu | "
1232+ " kinematics: const-vel=%zu trap-int=%zu ang-vel-int=%zu tricycle=%zu | "
1233+ " other=%zu null-slots=%zu total-active=%zu" ,
1234+ state_.last_estimated_states .size (), state_.known_odom_frames .size (), nPosePrior,
1235+ nPoseBetween, nTwistPrior, nImuAttitude, nImuGravity, nGnss, nConstVel, nTrapInt,
1236+ nAngVelInt, nTricycle, nOther, nNullSlots, smoother.getFactors ().nrFactors ());
1237+ }
1238+
11871239 const auto optValues = smoother.calculateEstimate ();
11881240
11891241 // Retrieve the latest estimate and save it into "state_.last_estimated_state":
0 commit comments