diff --git a/interfaces/api/loop/ILoopCorrector.h b/interfaces/api/loop/ILoopCorrector.h index 5b01bec2..304b9bc4 100644 --- a/interfaces/api/loop/ILoopCorrector.h +++ b/interfaces/api/loop/ILoopCorrector.h @@ -66,13 +66,15 @@ class XPCF_CLIENTUUID("51f449f8-c9df-4c3a-ac57-7ca95debfdbc") XPCF_SERVERUUID("7 /// @param[in] duplicatedPointsIndices: indices of duplicated cloud points. /// The first index is the id of point cloud seen from the detected loop keyframe. /// The second one is id of point cloud seen from the query keyframe - /// @param[out] correctedKeyframeIds: list of corrected keyframes' IDs (of which pose has been modified in the method) + /// @param[out] correctedKeyframeIds: list of corrected keyframes' IDs (of which pose has been modified in the method) + /// @param[out] correctedCloudpointIds: list of corrected cloud points' IDs (of which spatial coordinates has been modified in the method) /// @return FrameworkReturnCode::_SUCCESS if loop closure is correctly corrected, else FrameworkReturnCode::_ERROR_ virtual FrameworkReturnCode correct(const SRef queryKeyframe, const SRef detectedLoopKeyframe, const SolAR::datastructure::Transform3Df & S_wl_wc, const std::vector> & duplicatedPointsIndices, - std::vector& correctedKeyframeIds) = 0; + std::vector& correctedKeyframeIds, + std::vector& correctedCloudpointIds) = 0; }; } diff --git a/interfaces/datastructure/CloudPoint.h b/interfaces/datastructure/CloudPoint.h index 2669c031..2ee38a4a 100644 --- a/interfaces/datastructure/CloudPoint.h +++ b/interfaces/datastructure/CloudPoint.h @@ -273,6 +273,16 @@ class SOLARFRAMEWORK_API CloudPoint : public Point3Df, public PrimitiveInformat /// @return true if remove successfully bool removeVisibility(const uint32_t& keyframe_id); + /// + /// @brief set whether the cloud point has fixed spatial position or not + /// @param[in] isPositionFixed: boolean, if true the cloudpoint has fixed spatial coordinates X/Y/Z + void setPositionFixed(bool isPositionFixed); + + /// + /// @brief is cloud point has fixed position + /// @return boolean, true if has fixed spatial position, false if not + bool isPositionFixed() const; + private: friend class boost::serialization::access; template @@ -286,6 +296,7 @@ class SOLARFRAMEWORK_API CloudPoint : public Point3Df, public PrimitiveInformat Vector3f m_rgb = {0.0, 0.0, 0.0}; Vector3f m_viewDirection = {0.0, 0.0, 0.0}; double m_reproj_error = 0.0; + bool m_isPositionFixed = false; // fixed spatial position (fixed spatial coordinates x y z) }; DECLARESERIALIZE(CloudPoint); diff --git a/src/datastructure/CloudPoint.cpp b/src/datastructure/CloudPoint.cpp index 07c60940..db86b285 100644 --- a/src/datastructure/CloudPoint.cpp +++ b/src/datastructure/CloudPoint.cpp @@ -163,6 +163,16 @@ bool CloudPoint::removeVisibility(const uint32_t& keyframe_id) } } +void CloudPoint::setPositionFixed(bool isPositionFixed) +{ + m_isPositionFixed = isPositionFixed; +} + +bool CloudPoint::isPositionFixed() const +{ + return m_isPositionFixed; +} + template void CloudPoint::serialize(Archive &ar, const unsigned int /* version */) {