From 39be4ac81bc404c67479d12b5b8d9572cfe322c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu> Date: Fri, 15 Jan 2021 14:14:04 +0100 Subject: [PATCH] Remove obsolete references to aux frames --- include/core/problem/problem.h | 6 ------ include/core/trajectory/trajectory_base.h | 2 -- src/problem/problem.cpp | 18 +++++++++--------- test/gtest_trajectory.cpp | 1 - 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/include/core/problem/problem.h b/include/core/problem/problem.h index 5ab5f053f..dc810f276 100644 --- a/include/core/problem/problem.h +++ b/include/core/problem/problem.h @@ -205,7 +205,6 @@ class Problem : public std::enable_shared_from_this<Problem> const double &_time_tol); /** \brief Emplace frame from string frame_structure, dimension and vector - * \param _frame_key_type Either AUXILIARY or NON_ESTIMATED * \param _time_stamp Time stamp of the frame * \param _frame_structure String indicating the frame structure. * \param _dim variable indicating the dimension of the problem @@ -222,7 +221,6 @@ class Problem : public std::enable_shared_from_this<Problem> const Eigen::VectorXd& _frame_state); /** \brief Emplace frame from string frame_structure and state - * \param _frame_key_type Either AUXILIARY or NON_ESTIMATED * \param _time_stamp Time stamp of the frame * \param _frame_structure String indicating the frame structure. * \param _frame_state State vector; must match the size and format of the chosen frame structure @@ -239,7 +237,6 @@ class Problem : public std::enable_shared_from_this<Problem> const VectorComposite& _frame_state); /** \brief Emplace frame from state - * \param _frame_key_type Either AUXILIARY or NON_ESTIMATED * \param _time_stamp Time stamp of the frame * \param _frame_state State; must be part of the problem's frame structure * @@ -255,7 +252,6 @@ class Problem : public std::enable_shared_from_this<Problem> const VectorComposite& _frame_state); /** \brief Emplace frame from string frame_structure and dimension - * \param _frame_key_type Either AUXILIARY or NON_ESTIMATED * \param _time_stamp Time stamp of the frame * \param _frame_structure String indicating the frame structure. * \param _dim variable indicating the dimension of the problem @@ -273,7 +269,6 @@ class Problem : public std::enable_shared_from_this<Problem> const SizeEigen _dim); /** \brief Emplace frame from state vector - * \param _frame_key_type Either AUXILIARY or NON_ESTIMATED * \param _time_stamp Time stamp of the frame * \param _frame_state State vector; must match the size and format of the chosen frame structure * @@ -289,7 +284,6 @@ class Problem : public std::enable_shared_from_this<Problem> const Eigen::VectorXd& _frame_state); /** \brief Emplace frame, guess all values - * \param _frame_key_type Either AUXILIARY or NON_ESTIMATED * \param _time_stamp Time stamp of the frame * * - The structure is taken from Problem diff --git a/include/core/trajectory/trajectory_base.h b/include/core/trajectory/trajectory_base.h index 6029815eb..431524af9 100644 --- a/include/core/trajectory/trajectory_base.h +++ b/include/core/trajectory/trajectory_base.h @@ -58,8 +58,6 @@ class TrajectoryBase : public NodeBase, public std::enable_shared_from_this<Traj protected: StateStructure frame_structure_; // Defines the structure of the Frames in the Trajectory. - // FrameBasePtr last_key_frame_ptr_; // keeps pointer to the last key frame - // FrameBasePtr last_key_or_aux_frame_ptr_; // keeps pointer to the last estimated frame public: TrajectoryBase(); diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index 3dceffdd7..40396509f 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -428,10 +428,10 @@ TimeStamp Problem::getTimeStamp ( ) const if (not ts.ok()) { - const auto& last_kf_or_aux = trajectory_ptr_->getLastFrame(); + const auto& last_kf = trajectory_ptr_->getLastFrame(); - if (last_kf_or_aux) - ts = last_kf_or_aux->getTimeStamp(); // Use last estimated frame's state + if (last_kf) + ts = last_kf->getTimeStamp(); // Use last estimated frame's state } @@ -462,10 +462,10 @@ VectorComposite Problem::getState(const StateStructure& _structure) const VectorComposite state_last; - const auto& last_kf_or_aux = trajectory_ptr_->getLastFrame(); + const auto& last_kf = trajectory_ptr_->getLastFrame(); - if (last_kf_or_aux) - state_last = last_kf_or_aux->getState(structure); + if (last_kf) + state_last = last_kf->getState(structure); else if (prior_options_ and prior_options_->mode != "nothing") state_last = prior_options_->state; @@ -511,10 +511,10 @@ VectorComposite Problem::getState (const TimeStamp& _ts, const StateStructure& _ VectorComposite state_last; - const auto& last_kf_or_aux = trajectory_ptr_->closestFrameToTimeStamp(_ts); + const auto& last_kf = trajectory_ptr_->closestFrameToTimeStamp(_ts); - if (last_kf_or_aux) - state_last = last_kf_or_aux->getState(structure); + if (last_kf) + state_last = last_kf->getState(structure); else if (prior_options_ and prior_options_->mode != "nothing") state_last = prior_options_->state; diff --git a/test/gtest_trajectory.cpp b/test/gtest_trajectory.cpp index bd05620f6..7c4831134 100644 --- a/test/gtest_trajectory.cpp +++ b/test/gtest_trajectory.cpp @@ -34,7 +34,6 @@ TEST(TrajectoryBase, ClosestKeyFrame) FrameBasePtr F1 = P->emplaceFrame( 1, Eigen::Vector3d::Zero() ); FrameBasePtr F2 = P->emplaceFrame( 2, Eigen::Vector3d::Zero() ); - // FrameBasePtr F3 = P->emplaceFrame(AUXILIARY, 3, Eigen::Vector3d::Zero() ); FrameBasePtr F3 = std::make_shared<FrameBase>(3, P->getFrameStructure(), // P->getDim(), std::list<VectorXd>({Eigen::Vector2d::Zero(),Eigen::Vector1d::Zero()}) ); -- GitLab