26 std::cout <<
"Nr iterations: " <<
iterations <<
'\n' 30 <<
"error: " <<
error << std::endl;
36 std::cout <<
" smoother lag: " <<
smootherLag_ << std::endl;
48 for(
const auto& key_timestamp: timestamps) {
50 KeyTimestampMap::iterator keyIter =
keyTimestampMap_.find(key_timestamp.first);
55 std::pair<TimestampKeyMap::iterator,TimestampKeyMap::iterator> range =
timestampKeyMap_.equal_range(keyIter->second);
56 TimestampKeyMap::iterator timeIter = range.first;
57 while(timeIter->second != key_timestamp.first) {
63 timestampKeyMap_.insert(TimestampKeyMap::value_type(key_timestamp.second, key_timestamp.first));
65 keyIter->second = key_timestamp.second;
70 timestampKeyMap_.insert(TimestampKeyMap::value_type(key_timestamp.second, key_timestamp.first));
83 if(iter->second ==
key) {
108 keys.push_back(
iter->second);
116 TimestampKeyMap::const_iterator begin =
timestampKeyMap_.upper_bound(timestamp);
118 keys.push_back(
iter->second);
void updateKeyTimestampMap(const KeyTimestampMap &newTimestamps)
size_t iterations
The number of optimizer iterations performed.
std::map< Key, double > KeyTimestampMap
Typedef for a Key-Timestamp map/database.
size_t linearVariables
The number of variables that must keep a constant linearization point.
double error
The final factor graph error.
virtual bool equals(const FixedLagSmoother &rhs, double tol=1e-9) const
KeyTimestampMap keyTimestampMap_
Base class for a fixed-lag smoother. This mimics the basic interface to iSAM2.
KeyVector findKeysBefore(double timestamp) const
iterator iter(handle obj)
KeyVector findKeysAfter(double timestamp) const
virtual void print(const std::string &s="FixedLagSmoother:\n", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
size_t intermediateSteps
The number of intermediate steps performed within the optimization. For L-M, this is the number of la...
void eraseKeyTimestampMap(const KeyVector &keys)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
const KeyTimestampMap & timestamps() const
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
double getCurrentTimestamp() const
size_t nonlinearVariables
The number of variables that can be relinearized.
TimestampKeyMap timestampKeyMap_
bool equal(const T &obj1, const T &obj2, double tol)
std::uint64_t Key
Integer nonlinear key type.