MCPcopy Create free account
hub / github.com/TUC-ProAut/libRSF / removeFactorsOutsideWindow

Method removeFactorsOutsideWindow

src/FactorGraph.cpp:573–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571 }
572
573 void FactorGraph::removeFactorsOutsideWindow(const FactorType CurrentFactorType, const double TimeWindow, const double CurrentTime)
574 {
575 /** find start of the existing factors */
576 double FirstTime;
577 _Structure.getTimeFirst(CurrentFactorType, FirstTime);
578
579 /** calculate cut-off time */
580 const double TimeWindowEnd = roundToTick(CurrentTime - TimeWindow);
581
582 /** remove factors one by one */
583 if (TimeWindowEnd >= FirstTime)
584 {
585 /** get relevant Timestamps */
586 std::vector<double> Timestamps;
587 _Structure.getTimesBelow(CurrentFactorType, TimeWindowEnd, Timestamps);
588
589 /** remove all */
590 for (const double &Time : Timestamps)
591 {
592 this->removeFactor(CurrentFactorType, Time);
593 }
594 }
595 }
596
597 void FactorGraph::removeAllFactorsOutsideWindow(const double TimeWindow, const double CurrentTime)
598 {

Callers

nothing calls this directly

Calls 4

removeFactorMethod · 0.95
roundToTickFunction · 0.85
getTimesBelowMethod · 0.80
getTimeFirstMethod · 0.45

Tested by

no test coverage detected