19 #ifndef NODE_ADDERS_MEASUREMENT_BASED_TIMESTAMPED_NODE_ADDER_H_
20 #define NODE_ADDERS_MEASUREMENT_BASED_TIMESTAMPED_NODE_ADDER_H_
28 template <
typename MeasurementType,
typename NodeType,
typename TimestampedNodesType,
29 typename MeasurementBasedTimestampedNodeAdderModelType>
31 :
public TimestampedNodeAdder<NodeType, TimestampedNodesType, MeasurementBasedTimestampedNodeAdderModelType> {
39 std::shared_ptr<nodes::Values> values);
44 std::shared_ptr<TimestampedNodesType> timestamped_nodes);
55 const boost::optional<const gtsam::Marginals&>& marginals,
const gtsam::KeyVector& old_keys,
56 const double huber_k, gtsam::NonlinearFactorGraph& factors)
final;
61 template <
class Archive>
62 void serialize(Archive& ar,
const unsigned int file_version) {
63 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
68 template <
typename MeasurementType,
typename NodeType,
typename TimestampedNodesType,
69 typename MeasurementBasedTimestampedNodeAdderModelType>
70 MeasurementBasedTimestampedNodeAdder<MeasurementType, NodeType, TimestampedNodesType,
71 MeasurementBasedTimestampedNodeAdderModelType>::
72 MeasurementBasedTimestampedNodeAdder(
74 std::shared_ptr<nodes::Values> values)
75 :
Base(params, node_adder_model_params,
std::move(values)) {}
77 template <
typename MeasurementType,
typename NodeType,
typename TimestampedNodesType,
78 typename MeasurementBasedTimestampedNodeAdderModelType>
80 MeasurementBasedTimestampedNodeAdderModelType>::
81 MeasurementBasedTimestampedNodeAdder(
83 std::shared_ptr<TimestampedNodesType> timestamped_nodes)
84 :
Base(params, node_adder_model_params,
std::move(timestamped_nodes)) {}
86 template <
typename MeasurementType,
typename NodeType,
typename TimestampedNodesType,
87 typename MeasurementBasedTimestampedNodeAdderModelType>
89 MeasurementType, NodeType, TimestampedNodesType,
90 MeasurementBasedTimestampedNodeAdderModelType>
::AddMeasurement(
const MeasurementType& measurement) {
91 Base::node_adder_model().AddMeasurement(measurement);
94 template <
typename MeasurementType,
typename NodeType,
typename TimestampedNodesType,
95 typename MeasurementBasedTimestampedNodeAdderModelType>
97 MeasurementBasedTimestampedNodeAdderModelType>::
102 template <
typename MeasurementType,
typename NodeType,
typename TimestampedNodesType,
103 typename MeasurementBasedTimestampedNodeAdderModelType>
105 MeasurementType, NodeType, TimestampedNodesType,
107 const boost::optional<const gtsam::Marginals&>& marginals,
108 const gtsam::KeyVector& old_keys,
const double huber_k,
109 gtsam::NonlinearFactorGraph& factors) {
110 if (!Base::SlideWindow(oldest_allowed_timestamp, marginals, old_keys, huber_k, factors)) {
111 LogError(
"Failed to slide window.");
114 RemoveMeasurements(oldest_allowed_timestamp);
119 #endif // NODE_ADDERS_MEASUREMENT_BASED_TIMESTAMPED_NODE_ADDER_H_