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
4 changes: 3 additions & 1 deletion ILoopCorrector_grpcProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ SolAR::FrameworkReturnCode ILoopCorrector_grpcProxy::correct(SRef<SolAR::datast
}


SolAR::FrameworkReturnCode ILoopCorrector_grpcProxy::correct(SRef<SolAR::datastructure::Keyframe> const queryKeyframe, SRef<SolAR::datastructure::Keyframe> const detectedLoopKeyframe, SolAR::datastructure::Transform3Df const& S_wl_wc, std::vector<std::pair<uint32_t,uint32_t>> const& duplicatedPointsIndices, std::vector<uint32_t>& correctedKeyframeIds)
SolAR::FrameworkReturnCode ILoopCorrector_grpcProxy::correct(SRef<SolAR::datastructure::Keyframe> const queryKeyframe, SRef<SolAR::datastructure::Keyframe> const detectedLoopKeyframe, SolAR::datastructure::Transform3Df const& S_wl_wc, std::vector<std::pair<uint32_t,uint32_t>> const& duplicatedPointsIndices, std::vector<uint32_t>& correctedKeyframeIds, std::vector<uint32_t>& correctedCloudpointIds)
{
::grpc::ClientContext context;
::grpcILoopCorrector::correct_grpc1Request reqIn;
Expand All @@ -90,6 +90,7 @@ SolAR::FrameworkReturnCode ILoopCorrector_grpcProxy::correct(SRef<SolAR::datast
reqIn.set_s_wl_wc(xpcf::serialize<SolAR::datastructure::Transform3Df>(S_wl_wc));
reqIn.set_duplicatedpointsindices(xpcf::serialize<std::vector<std::pair<uint32_t,uint32_t>>>(duplicatedPointsIndices));
reqIn.set_correctedkeyframeids(xpcf::serialize<std::vector<uint32_t>>(correctedKeyframeIds));
reqIn.set_correctedcloudpointids(xpcf::serialize<std::vector<uint32_t>>(correctedCloudpointIds));
#ifdef ENABLE_PROXY_TIMERS
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
std::cout << "====> ILoopCorrector_grpcProxy::correct request sent at " << to_simple_string(start) << std::endl;
Expand All @@ -106,6 +107,7 @@ SolAR::FrameworkReturnCode ILoopCorrector_grpcProxy::correct(SRef<SolAR::datast
}

correctedKeyframeIds = xpcf::deserialize<std::vector<uint32_t>>(respOut.correctedkeyframeids());
correctedCloudpointIds = xpcf::deserialize<std::vector<uint32_t>>(respOut.correctedcloudpointids());
return static_cast<SolAR::FrameworkReturnCode>(respOut.xpcfgrpcreturnvalue());
}

Expand Down
2 changes: 1 addition & 1 deletion ILoopCorrector_grpcProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ILoopCorrector_grpcProxy: public org::bcom::xpcf::ConfigurableBase, virtu
org::bcom::xpcf::XPCFErrorCode onConfigured() override;

SolAR::FrameworkReturnCode correct(SRef<SolAR::datastructure::Keyframe> const queryKeyframe, SRef<SolAR::datastructure::Keyframe> const detectedLoopKeyframe, SolAR::datastructure::Transform3Df const& S_wl_wc, std::vector<std::pair<uint32_t,uint32_t>> const& duplicatedPointsIndices) override;
SolAR::FrameworkReturnCode correct(SRef<SolAR::datastructure::Keyframe> const queryKeyframe, SRef<SolAR::datastructure::Keyframe> const detectedLoopKeyframe, SolAR::datastructure::Transform3Df const& S_wl_wc, std::vector<std::pair<uint32_t,uint32_t>> const& duplicatedPointsIndices, std::vector<uint32_t>& correctedKeyframeIds) override;
SolAR::FrameworkReturnCode correct(SRef<SolAR::datastructure::Keyframe> const queryKeyframe, SRef<SolAR::datastructure::Keyframe> const detectedLoopKeyframe, SolAR::datastructure::Transform3Df const& S_wl_wc, std::vector<std::pair<uint32_t,uint32_t>> const& duplicatedPointsIndices, std::vector<uint32_t>& correctedKeyframeIds, std::vector<uint32_t>& correctedCloudpointIds) override;


private:
Expand Down
4 changes: 3 additions & 1 deletion ILoopCorrector_grpcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ ::grpc::Status ILoopCorrector_grpcServer::grpcILoopCorrectorServiceImpl::correct
SolAR::datastructure::Transform3Df S_wl_wc = xpcf::deserialize<SolAR::datastructure::Transform3Df>(request->s_wl_wc());
std::vector<std::pair<uint32_t,uint32_t>> duplicatedPointsIndices = xpcf::deserialize<std::vector<std::pair<uint32_t,uint32_t>>>(request->duplicatedpointsindices());
std::vector<uint32_t> correctedKeyframeIds = xpcf::deserialize<std::vector<uint32_t>>(request->correctedkeyframeids());
SolAR::FrameworkReturnCode returnValue = m_xpcfComponent->correct(queryKeyframe, detectedLoopKeyframe, S_wl_wc, duplicatedPointsIndices, correctedKeyframeIds);
std::vector<uint32_t> correctedCloudpointIds = xpcf::deserialize<std::vector<uint32_t>>(request->correctedcloudpointids());
SolAR::FrameworkReturnCode returnValue = m_xpcfComponent->correct(queryKeyframe, detectedLoopKeyframe, S_wl_wc, duplicatedPointsIndices, correctedKeyframeIds, correctedCloudpointIds);
response->set_correctedkeyframeids(xpcf::serialize<std::vector<uint32_t>>(correctedKeyframeIds));
response->set_correctedcloudpointids(xpcf::serialize<std::vector<uint32_t>>(correctedCloudpointIds));
response->set_xpcfgrpcreturnvalue(static_cast<int32_t>(returnValue));
#ifdef ENABLE_SERVER_TIMERS
boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();
Expand Down
Loading