diff --git a/gtsam/navigation/ConstantVelocityFactor.h b/gtsam/navigation/ConstantVelocityFactor.h index f676108ce..f5a35947f 100644 --- a/gtsam/navigation/ConstantVelocityFactor.h +++ b/gtsam/navigation/ConstantVelocityFactor.h @@ -35,8 +35,8 @@ class ConstantVelocityFactor : public NoiseModelFactor2 { boost::optional H1 = boost::none, boost::optional H2 = boost::none) const override { // only used to use update() below - const Vector3 b_accel{0.0, 0.0, 0.0}; - const Vector3 b_omega{0.0, 0.0, 0.0}; + static const Vector3 b_accel{0.0, 0.0, 0.0}; + static const Vector3 b_omega{0.0, 0.0, 0.0}; Matrix predicted_H_x1; NavState predicted = x1.update(b_accel, b_omega, dt_, predicted_H_x1, {}, {});