Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions interfaces/api/loop/ILoopCorrector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<SolAR::datastructure::Keyframe> queryKeyframe,
const SRef<SolAR::datastructure::Keyframe> detectedLoopKeyframe,
const SolAR::datastructure::Transform3Df & S_wl_wc,
const std::vector<std::pair<uint32_t, uint32_t>> & duplicatedPointsIndices,
std::vector<uint32_t>& correctedKeyframeIds) = 0;
std::vector<uint32_t>& correctedKeyframeIds,
std::vector<uint32_t>& correctedCloudpointIds) = 0;

};
}
Expand Down
11 changes: 11 additions & 0 deletions interfaces/datastructure/CloudPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename Archive>
Expand All @@ -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);
Expand Down
10 changes: 10 additions & 0 deletions src/datastructure/CloudPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename Archive>
void CloudPoint::serialize(Archive &ar, const unsigned int /* version */)
{
Expand Down