From 1f07142b5bfdbb22e12f1ff559d666aae9d6e897 Mon Sep 17 00:00:00 2001 From: lcarlone Date: Fri, 23 Jul 2021 19:03:23 -0400 Subject: [PATCH] renamed params. need one last test --- .../SmartProjectionPoseFactorRollingShutter.h | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/gtsam_unstable/slam/SmartProjectionPoseFactorRollingShutter.h b/gtsam_unstable/slam/SmartProjectionPoseFactorRollingShutter.h index 03c44dbe9..4d0d6d9e6 100644 --- a/gtsam_unstable/slam/SmartProjectionPoseFactorRollingShutter.h +++ b/gtsam_unstable/slam/SmartProjectionPoseFactorRollingShutter.h @@ -52,7 +52,7 @@ PinholePose > { std::vector> world_P_body_key_pairs_; /// interpolation factor (one for each observation) to interpolate between pair of consecutive poses - std::vector interp_param_; + std::vector interp_params_; /// Pose of the camera in the body frame std::vector body_P_sensors_; ///< Pose of the camera in the body frame @@ -95,11 +95,11 @@ PinholePose > { * single landmark in the a single view (the measurement), interpolated from the 2 poses * @param world_P_body_key1 is the key corresponding to the first body poses (time <= time pixel is acquired) * @param world_P_body_key2 is the key corresponding to the second body poses (time >= time pixel is acquired) - * @param gamma in [0,1] is the interpolation factor, such that if gamma = 0 the interpolated pose is the same as world_P_body_key + * @param interp_param in [0,1] is the interpolation factor, such that if interp_param = 0 the interpolated pose is the same as world_P_body_key * @param K is the (fixed) camera intrinsic calibration */ void add(const Point2& measured, const Key& world_P_body_key1, - const Key& world_P_body_key2, const double& gamma, + const Key& world_P_body_key2, const double& interp_param, const boost::shared_ptr& K, const Pose3 body_P_sensor = Pose3::identity()) { // store measurements in base class (note: we manyally add keys below to make sure they are unique this->measured_.push_back(measured); @@ -117,7 +117,7 @@ PinholePose > { this->keys_.push_back(world_P_body_key2); // add only unique keys // store interpolation factors - interp_param_.push_back(gamma); + interp_params_.push_back(interp_param); // store fixed calibration K_all_.push_back(K); @@ -135,15 +135,15 @@ PinholePose > { */ void add(const Point2Vector& measurements, const std::vector>& world_P_body_key_pairs, - const std::vector& gammas, + const std::vector& interp_params, const std::vector>& Ks, const std::vector body_P_sensors) { assert(world_P_body_key_pairs.size() == measurements.size()); - assert(world_P_body_key_pairs.size() == gammas.size()); + assert(world_P_body_key_pairs.size() == interp_params.size()); assert(world_P_body_key_pairs.size() == Ks.size()); for (size_t i = 0; i < measurements.size(); i++) { add(measurements[i], world_P_body_key_pairs[i].first, - world_P_body_key_pairs[i].second, gammas[i], Ks[i], + world_P_body_key_pairs[i].second, interp_params[i], Ks[i], body_P_sensors[i]); } } @@ -158,13 +158,13 @@ PinholePose > { */ void add(const Point2Vector& measurements, const std::vector>& world_P_body_key_pairs, - const std::vector& gammas, + const std::vector& interp_params, const boost::shared_ptr& K, const Pose3 body_P_sensor = Pose3::identity()) { assert(world_P_body_key_pairs.size() == measurements.size()); - assert(world_P_body_key_pairs.size() == gammas.size()); + assert(world_P_body_key_pairs.size() == interp_params.size()); for (size_t i = 0; i < measurements.size(); i++) { add(measurements[i], world_P_body_key_pairs[i].first, - world_P_body_key_pairs[i].second, gammas[i], K, body_P_sensor); + world_P_body_key_pairs[i].second, interp_params[i], K, body_P_sensor); } } @@ -178,9 +178,9 @@ PinholePose > { return world_P_body_key_pairs_; } - /// return the interpolation factors gammas - const std::vector getGammas() const { - return interp_param_; + /// return the interpolation factors interp_params + const std::vector interp_params() const { + return interp_params_; } /// return the extrinsic camera calibration body_P_sensors @@ -202,7 +202,7 @@ PinholePose > { << keyFormatter(world_P_body_key_pairs_[i].first) << std::endl; std::cout << " pose2 key: " << keyFormatter(world_P_body_key_pairs_[i].second) << std::endl; - std::cout << " gamma: " << interp_param_[i] << std::endl; + std::cout << " interp_param: " << interp_params_[i] << std::endl; body_P_sensors_[i].print("extrinsic calibration:\n"); K_all_[i]->print("intrinsic calibration = "); } @@ -237,7 +237,7 @@ PinholePose > { }else{ extrinsicCalibrationEqual = false; } return e && Base::equals(p, tol) && K_all_ == e->calibration() - && interp_param_ == e->getGammas() && keyPairsEqual && extrinsicCalibrationEqual; + && interp_params_ == e->interp_params() && keyPairsEqual && extrinsicCalibrationEqual; } /** @@ -264,7 +264,7 @@ PinholePose > { for (size_t i = 0; i < numViews; i++) { // for each camera/measurement Pose3 w_P_body1 = values.at(world_P_body_key_pairs_[i].first); Pose3 w_P_body2 = values.at(world_P_body_key_pairs_[i].second); - double interpolationFactor = interp_param_[i]; + double interpolationFactor = interp_params_[i]; // get interpolated pose: Pose3 w_P_body = interpolate(w_P_body1, w_P_body2,interpolationFactor, dInterpPose_dPoseBody1, dInterpPose_dPoseBody2); Pose3 body_P_cam = body_P_sensors_[i]; @@ -368,7 +368,7 @@ PinholePose > { typename Base::Cameras cameras(const Values& values) const override { size_t numViews = this->measured_.size(); assert(numViews == K_all_.size()); - assert(numViews == interp_param_.size()); + assert(numViews == interp_params_.size()); assert(numViews == body_P_sensors_.size()); assert(numViews == world_P_body_key_pairs_.size()); @@ -376,7 +376,7 @@ PinholePose > { for (size_t i = 0; i < numViews; i++) { // for each measurement Pose3 w_P_body1 = values.at(world_P_body_key_pairs_[i].first); Pose3 w_P_body2 = values.at(world_P_body_key_pairs_[i].second); - double interpolationFactor = interp_param_[i]; + double interpolationFactor = interp_params_[i]; Pose3 w_P_body = interpolate(w_P_body1, w_P_body2, interpolationFactor); Pose3 body_P_cam = body_P_sensors_[i]; Pose3 w_P_cam = w_P_body.compose(body_P_cam);