Added override

release/4.3a0
Frank Dellaert 2021-08-28 16:30:25 -04:00
parent 37b001307e
commit f712d62150
1 changed files with 8 additions and 8 deletions

View File

@ -129,7 +129,7 @@ class ProjectionFactorRollingShutter : public NoiseModelFactor3<Pose3, Pose3,
} }
/// @return a deep copy of this factor /// @return a deep copy of this factor
virtual gtsam::NonlinearFactor::shared_ptr clone() const { gtsam::NonlinearFactor::shared_ptr clone() const override {
return boost::static_pointer_cast < gtsam::NonlinearFactor return boost::static_pointer_cast < gtsam::NonlinearFactor
> (gtsam::NonlinearFactor::shared_ptr(new This(*this))); > (gtsam::NonlinearFactor::shared_ptr(new This(*this)));
} }
@ -140,7 +140,7 @@ class ProjectionFactorRollingShutter : public NoiseModelFactor3<Pose3, Pose3,
* @param keyFormatter optional formatter useful for printing Symbols * @param keyFormatter optional formatter useful for printing Symbols
*/ */
void print(const std::string& s = "", const KeyFormatter& keyFormatter = void print(const std::string& s = "", const KeyFormatter& keyFormatter =
DefaultKeyFormatter) const { DefaultKeyFormatter) const override {
std::cout << s << "ProjectionFactorRollingShutter, z = "; std::cout << s << "ProjectionFactorRollingShutter, z = ";
traits<Point2>::Print(measured_); traits<Point2>::Print(measured_);
std::cout << " rolling shutter interpolation param = " << alpha_; std::cout << " rolling shutter interpolation param = " << alpha_;
@ -150,7 +150,7 @@ class ProjectionFactorRollingShutter : public NoiseModelFactor3<Pose3, Pose3,
} }
/// equals /// equals
virtual bool equals(const NonlinearFactor& p, double tol = 1e-9) const { bool equals(const NonlinearFactor& p, double tol = 1e-9) const override {
const This *e = dynamic_cast<const This*>(&p); const This *e = dynamic_cast<const This*>(&p);
return e && Base::equals(p, tol) && (alpha_ == e->alpha()) return e && Base::equals(p, tol) && (alpha_ == e->alpha())
&& traits<Point2>::Equals(this->measured_, e->measured_, tol) && traits<Point2>::Equals(this->measured_, e->measured_, tol)
@ -163,11 +163,11 @@ class ProjectionFactorRollingShutter : public NoiseModelFactor3<Pose3, Pose3,
} }
/// Evaluate error h(x)-z and optionally derivatives /// Evaluate error h(x)-z and optionally derivatives
Vector evaluateError(const Pose3& pose_a, const Pose3& pose_b, Vector evaluateError(
const Point3& point, boost::optional<Matrix&> H1 = const Pose3& pose_a, const Pose3& pose_b, const Point3& point,
boost::none, boost::optional<Matrix&> H1 = boost::none,
boost::optional<Matrix&> H2 = boost::none, boost::optional<Matrix&> H2 = boost::none,
boost::optional<Matrix&> H3 = boost::none) const; boost::optional<Matrix&> H3 = boost::none) const override;
/** return the measurement */ /** return the measurement */
const Point2& measured() const { const Point2& measured() const {