Fix serialization bug in RangeFactor

Closes #443
release/4.3a0
Jose Luis Blanco-Claraco 2020-07-28 12:05:41 +02:00 committed by Jose Luis Blanco Claraco
parent 7b18d33c00
commit 4e34d64453
No known key found for this signature in database
GPG Key ID: D443304FBD70A641
1 changed files with 4 additions and 1 deletions

View File

@ -135,9 +135,12 @@ class RangeFactorWithTransform : public ExpressionFactorN<T, A1, A2> {
friend class boost::serialization::access;
template <typename ARCHIVE>
void serialize(ARCHIVE& ar, const unsigned int /*version*/) {
// **IMPORTANT** We need to (de)serialize parameters before the base class,
// since it calls expression() and we need all parameters ready at that
// point.
ar& BOOST_SERIALIZATION_NVP(body_T_sensor_);
ar& boost::serialization::make_nvp(
"Base", boost::serialization::base_object<Base>(*this));
ar& BOOST_SERIALIZATION_NVP(body_T_sensor_);
}
}; // \ RangeFactorWithTransform