Skip to content

Commit f64c212

Browse files
committed
Merge remote-tracking branch 'origin/feat/diskNetvlad' into feat/Keycloak
2 parents e8e27e1 + 00d2421 commit f64c212

9 files changed

+2760
-789
lines changed

gen/interfaces/IRelocalizationPipeline_grpcProxy.h

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class IRelocalizationPipeline_grpcProxy: public org::bcom::xpcf::ConfigurableBa
2929
SolAR::FrameworkReturnCode setCameraParameters(SolAR::datastructure::CameraParameters const& cameraParams) override;
3030
SolAR::FrameworkReturnCode getCameraParameters(SolAR::datastructure::CameraParameters& cameraParams) const override;
3131
SolAR::FrameworkReturnCode relocalizeProcessRequest(SRef<SolAR::datastructure::Image> const image, SolAR::datastructure::Transform3Df& pose, float_t& confidence, SolAR::datastructure::Transform3Df const& poseCoarse) override;
32+
SolAR::FrameworkReturnCode relocalizeProcessRequest(SRef<SolAR::datastructure::Image> const image, std::vector<SRef<SolAR::datastructure::CloudPoint>>& currPointCloud, SolAR::datastructure::Transform3Df& pose, float_t& confidence, SolAR::datastructure::Transform3Df const& poseCoarse) override;
3233
SolAR::FrameworkReturnCode relocalizeProcessRequest(SRef<SolAR::datastructure::Image> const image, SolAR::datastructure::Transform3Df& pose, float_t& confidence, std::vector<SolAR::datastructure::DetectedObject>& detectedObjects, SolAR::datastructure::Transform3Df const& poseCoarse) override;
3334
SolAR::FrameworkReturnCode getMapRequest(SRef<SolAR::datastructure::Map>& map) const override;
3435

gen/interfaces/IRelocalizationPipeline_grpcServer.h

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class IRelocalizationPipeline_grpcServer: public org::bcom::xpcf::ConfigurableB
3333
::grpc::Status getCameraParameters(::grpc::ServerContext* context, const ::grpcIRelocalizationPipeline::getCameraParametersRequest* request, ::grpcIRelocalizationPipeline::getCameraParametersResponse* response) override;
3434
::grpc::Status relocalizeProcessRequest_grpc0(::grpc::ServerContext* context, const ::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc0Request* request, ::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc0Response* response) override;
3535
::grpc::Status relocalizeProcessRequest_grpc1(::grpc::ServerContext* context, const ::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc1Request* request, ::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc1Response* response) override;
36+
::grpc::Status relocalizeProcessRequest_grpc2(::grpc::ServerContext* context, const ::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc2Request* request, ::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc2Response* response) override;
3637
::grpc::Status getMapRequest(::grpc::ServerContext* context, const ::grpcIRelocalizationPipeline::getMapRequestRequest* request, ::grpcIRelocalizationPipeline::getMapRequestResponse* response) override;
3738

3839
SRef<SolAR::api::pipeline::IRelocalizationPipeline> m_xpcfComponent;

gen/interfaces/grpcIRelocalizationPipelineService.grpc.pb.h

+170-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/interfaces/grpcIRelocalizationPipelineService.pb.h

+1,486-602
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/proto/grpcIRelocalizationPipelineService.proto

+20-1
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,30 @@ message relocalizeProcessRequest_grpc1Request
8989
int32 grpcServerCompressionFormat = 1;
9090
bytes image = 2;
9191
bytes poseCoarse = 3;
92+
bytes currPointCloud = 4;
93+
bytes pose = 5;
94+
bytes confidence = 6;
95+
}
96+
97+
message relocalizeProcessRequest_grpc1Response
98+
{
99+
bytes currPointCloud = 1;
100+
bytes pose = 2;
101+
bytes confidence = 3;
102+
sint32 xpcfGrpcReturnValue = 4;
103+
}
104+
105+
message relocalizeProcessRequest_grpc2Request
106+
{
107+
int32 grpcServerCompressionFormat = 1;
108+
bytes image = 2;
109+
bytes poseCoarse = 3;
92110
bytes pose = 4;
93111
bytes confidence = 5;
94112
bytes detectedObjects = 6;
95113
}
96114

97-
message relocalizeProcessRequest_grpc1Response
115+
message relocalizeProcessRequest_grpc2Response
98116
{
99117
bytes pose = 1;
100118
bytes confidence = 2;
@@ -123,6 +141,7 @@ rpc setCameraParameters(setCameraParametersRequest) returns(setCameraParametersR
123141
rpc getCameraParameters(getCameraParametersRequest) returns(getCameraParametersResponse) {}
124142
rpc relocalizeProcessRequest_grpc0(relocalizeProcessRequest_grpc0Request) returns(relocalizeProcessRequest_grpc0Response) {}
125143
rpc relocalizeProcessRequest_grpc1(relocalizeProcessRequest_grpc1Request) returns(relocalizeProcessRequest_grpc1Response) {}
144+
rpc relocalizeProcessRequest_grpc2(relocalizeProcessRequest_grpc2Request) returns(relocalizeProcessRequest_grpc2Response) {}
126145
rpc getMapRequest(getMapRequestRequest) returns(getMapRequestResponse) {}
127146
}
128147

gen/src/IRelocalizationPipeline_grpcProxy.cpp

+40-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ IRelocalizationPipeline_grpcProxy::IRelocalizationPipeline_grpcProxy():xpcf::Con
1919
declareInterface<SolAR::api::pipeline::IRelocalizationPipeline>(this);
2020
declareProperty("channelUrl",m_channelUrl);
2121
declareProperty("channelCredentials",m_channelCredentials);
22-
m_grpcProxyCompressionConfig.resize(10);
22+
m_grpcProxyCompressionConfig.resize(11);
2323
declarePropertySequence("grpc_compress_proxy", m_grpcProxyCompressionConfig);
2424
}
2525

@@ -260,7 +260,7 @@ SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcess
260260
}
261261

262262

263-
SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcessRequest(SRef<SolAR::datastructure::Image> const image, SolAR::datastructure::Transform3Df& pose, float_t& confidence, std::vector<SolAR::datastructure::DetectedObject>& detectedObjects, SolAR::datastructure::Transform3Df const& poseCoarse)
263+
SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcessRequest(SRef<SolAR::datastructure::Image> const image, std::vector<SRef<SolAR::datastructure::CloudPoint>>& currPointCloud, SolAR::datastructure::Transform3Df& pose, float_t& confidence, SolAR::datastructure::Transform3Df const& poseCoarse)
264264
{
265265
::grpc::ClientContext context;
266266
::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc1Request reqIn;
@@ -272,9 +272,9 @@ SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcess
272272
#endif
273273
reqIn.set_image(xpcf::serialize<SRef<SolAR::datastructure::Image>>(image));
274274
reqIn.set_posecoarse(xpcf::serialize<SolAR::datastructure::Transform3Df>(poseCoarse));
275+
reqIn.set_currpointcloud(xpcf::serialize<std::vector<SRef<SolAR::datastructure::CloudPoint>>>(currPointCloud));
275276
reqIn.set_pose(xpcf::serialize<SolAR::datastructure::Transform3Df>(pose));
276277
reqIn.set_confidence(xpcf::serialize<float_t>(confidence));
277-
reqIn.set_detectedobjects(xpcf::serialize<std::vector<SolAR::datastructure::DetectedObject>>(detectedObjects));
278278
#ifdef ENABLE_PROXY_TIMERS
279279
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
280280
std::cout << "====> IRelocalizationPipeline_grpcProxy::relocalizeProcessRequest request sent at " << to_simple_string(start) << std::endl;
@@ -290,6 +290,43 @@ SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcess
290290
throw xpcf::RemotingException("grpcIRelocalizationPipelineService","relocalizeProcessRequest_grpc1",static_cast<uint32_t>(grpcRemoteStatus.error_code()));
291291
}
292292

293+
currPointCloud = xpcf::deserialize<std::vector<SRef<SolAR::datastructure::CloudPoint>>>(respOut.currpointcloud());
294+
pose = xpcf::deserialize<SolAR::datastructure::Transform3Df>(respOut.pose());
295+
confidence = xpcf::deserialize<float_t>(respOut.confidence());
296+
return static_cast<SolAR::FrameworkReturnCode>(respOut.xpcfgrpcreturnvalue());
297+
}
298+
299+
300+
SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcessRequest(SRef<SolAR::datastructure::Image> const image, SolAR::datastructure::Transform3Df& pose, float_t& confidence, std::vector<SolAR::datastructure::DetectedObject>& detectedObjects, SolAR::datastructure::Transform3Df const& poseCoarse)
301+
{
302+
::grpc::ClientContext context;
303+
::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc2Request reqIn;
304+
::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc2Response respOut;
305+
#ifndef DISABLE_GRPC_COMPRESSION
306+
xpcf::grpcCompressionInfos proxyCompressionInfo = xpcf::deduceClientCompressionInfo(m_serviceCompressionInfos, "relocalizeProcessRequest", m_methodCompressionInfosMap);
307+
xpcf::grpcCompressType serverCompressionType = xpcf::prepareClientCompressionContext(context, proxyCompressionInfo);
308+
reqIn.set_grpcservercompressionformat (static_cast<int32_t>(serverCompressionType));
309+
#endif
310+
reqIn.set_image(xpcf::serialize<SRef<SolAR::datastructure::Image>>(image));
311+
reqIn.set_posecoarse(xpcf::serialize<SolAR::datastructure::Transform3Df>(poseCoarse));
312+
reqIn.set_pose(xpcf::serialize<SolAR::datastructure::Transform3Df>(pose));
313+
reqIn.set_confidence(xpcf::serialize<float_t>(confidence));
314+
reqIn.set_detectedobjects(xpcf::serialize<std::vector<SolAR::datastructure::DetectedObject>>(detectedObjects));
315+
#ifdef ENABLE_PROXY_TIMERS
316+
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
317+
std::cout << "====> IRelocalizationPipeline_grpcProxy::relocalizeProcessRequest request sent at " << to_simple_string(start) << std::endl;
318+
#endif
319+
::grpc::Status grpcRemoteStatus = m_grpcStub->relocalizeProcessRequest_grpc2(&context, reqIn, &respOut);
320+
#ifdef ENABLE_PROXY_TIMERS
321+
boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();
322+
std::cout << "====> IRelocalizationPipeline_grpcProxy::relocalizeProcessRequest response received at " << to_simple_string(end) << std::endl;
323+
std::cout << " => elapsed time = " << ((end - start).total_microseconds() / 1000.00) << " ms" << std::endl;
324+
#endif
325+
if (!grpcRemoteStatus.ok()) {
326+
std::cout << "relocalizeProcessRequest_grpc2 rpc failed." << std::endl;
327+
throw xpcf::RemotingException("grpcIRelocalizationPipelineService","relocalizeProcessRequest_grpc2",static_cast<uint32_t>(grpcRemoteStatus.error_code()));
328+
}
329+
293330
pose = xpcf::deserialize<SolAR::datastructure::Transform3Df>(respOut.pose());
294331
confidence = xpcf::deserialize<float_t>(respOut.confidence());
295332
detectedObjects = xpcf::deserialize<std::vector<SolAR::datastructure::DetectedObject>>(respOut.detectedobjects());

gen/src/IRelocalizationPipeline_grpcServer.cpp

+31-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ IRelocalizationPipeline_grpcServer::IRelocalizationPipeline_grpcServer():xpcf::C
1414
{
1515
declareInterface<xpcf::IGrpcService>(this);
1616
declareInjectable<SolAR::api::pipeline::IRelocalizationPipeline>(m_grpcService.m_xpcfComponent);
17-
m_grpcServerCompressionConfig.resize(10);
17+
m_grpcServerCompressionConfig.resize(11);
1818
declarePropertySequence("grpc_compress_server", m_grpcServerCompressionConfig);
1919
}
2020

@@ -205,6 +205,36 @@ ::grpc::Status IRelocalizationPipeline_grpcServer::grpcIRelocalizationPipelineSe
205205

206206

207207
::grpc::Status IRelocalizationPipeline_grpcServer::grpcIRelocalizationPipelineServiceImpl::relocalizeProcessRequest_grpc1(::grpc::ServerContext* context, const ::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc1Request* request, ::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc1Response* response)
208+
{
209+
#ifndef DISABLE_GRPC_COMPRESSION
210+
xpcf::grpcCompressType askedCompressionType = static_cast<xpcf::grpcCompressType>(request->grpcservercompressionformat());
211+
xpcf::grpcServerCompressionInfos serverCompressInfo = xpcf::deduceServerCompressionType(askedCompressionType, m_serviceCompressionInfos, "relocalizeProcessRequest", m_methodCompressionInfosMap);
212+
xpcf::prepareServerCompressionContext(context, serverCompressInfo);
213+
#endif
214+
#ifdef ENABLE_SERVER_TIMERS
215+
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
216+
std::cout << "====> IRelocalizationPipeline_grpcServer::relocalizeProcessRequest request received at " << to_simple_string(start) << std::endl;
217+
#endif
218+
SRef<SolAR::datastructure::Image> image = xpcf::deserialize<SRef<SolAR::datastructure::Image>>(request->image());
219+
std::vector<SRef<SolAR::datastructure::CloudPoint>> currPointCloud = xpcf::deserialize<std::vector<SRef<SolAR::datastructure::CloudPoint>>>(request->currpointcloud());
220+
SolAR::datastructure::Transform3Df pose = xpcf::deserialize<SolAR::datastructure::Transform3Df>(request->pose());
221+
float_t confidence = xpcf::deserialize<float_t>(request->confidence());
222+
SolAR::datastructure::Transform3Df poseCoarse = xpcf::deserialize<SolAR::datastructure::Transform3Df>(request->posecoarse());
223+
SolAR::FrameworkReturnCode returnValue = m_xpcfComponent->relocalizeProcessRequest(image, currPointCloud, pose, confidence, poseCoarse);
224+
response->set_currpointcloud(xpcf::serialize<std::vector<SRef<SolAR::datastructure::CloudPoint>>>(currPointCloud));
225+
response->set_pose(xpcf::serialize<SolAR::datastructure::Transform3Df>(pose));
226+
response->set_confidence(xpcf::serialize<float_t>(confidence));
227+
response->set_xpcfgrpcreturnvalue(static_cast<int32_t>(returnValue));
228+
#ifdef ENABLE_SERVER_TIMERS
229+
boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();
230+
std::cout << "====> IRelocalizationPipeline_grpcServer::relocalizeProcessRequest response sent at " << to_simple_string(end) << std::endl;
231+
std::cout << " => elapsed time = " << ((end - start).total_microseconds() / 1000.00) << " ms" << std::endl;
232+
#endif
233+
return ::grpc::Status::OK;
234+
}
235+
236+
237+
::grpc::Status IRelocalizationPipeline_grpcServer::grpcIRelocalizationPipelineServiceImpl::relocalizeProcessRequest_grpc2(::grpc::ServerContext* context, const ::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc2Request* request, ::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc2Response* response)
208238
{
209239
#ifndef DISABLE_GRPC_COMPRESSION
210240
xpcf::grpcCompressType askedCompressionType = static_cast<xpcf::grpcCompressType>(request->grpcservercompressionformat());

0 commit comments

Comments
 (0)