@@ -19,7 +19,7 @@ IRelocalizationPipeline_grpcProxy::IRelocalizationPipeline_grpcProxy():xpcf::Con
19
19
declareInterface<SolAR::api::pipeline::IRelocalizationPipeline>(this );
20
20
declareProperty (" channelUrl" ,m_channelUrl);
21
21
declareProperty (" channelCredentials" ,m_channelCredentials);
22
- m_grpcProxyCompressionConfig.resize (10 );
22
+ m_grpcProxyCompressionConfig.resize (11 );
23
23
declarePropertySequence (" grpc_compress_proxy" , m_grpcProxyCompressionConfig);
24
24
}
25
25
@@ -260,7 +260,7 @@ SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcess
260
260
}
261
261
262
262
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)
264
264
{
265
265
::grpc::ClientContext context;
266
266
::grpcIRelocalizationPipeline::relocalizeProcessRequest_grpc1Request reqIn;
@@ -272,9 +272,9 @@ SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcess
272
272
#endif
273
273
reqIn.set_image (xpcf::serialize<SRef<SolAR::datastructure::Image>>(image));
274
274
reqIn.set_posecoarse (xpcf::serialize<SolAR::datastructure::Transform3Df>(poseCoarse));
275
+ reqIn.set_currpointcloud (xpcf::serialize<std::vector<SRef<SolAR::datastructure::CloudPoint>>>(currPointCloud));
275
276
reqIn.set_pose (xpcf::serialize<SolAR::datastructure::Transform3Df>(pose));
276
277
reqIn.set_confidence (xpcf::serialize<float_t >(confidence));
277
- reqIn.set_detectedobjects (xpcf::serialize<std::vector<SolAR::datastructure::DetectedObject>>(detectedObjects));
278
278
#ifdef ENABLE_PROXY_TIMERS
279
279
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time ();
280
280
std::cout << " ====> IRelocalizationPipeline_grpcProxy::relocalizeProcessRequest request sent at " << to_simple_string (start) << std::endl;
@@ -290,6 +290,43 @@ SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcess
290
290
throw xpcf::RemotingException (" grpcIRelocalizationPipelineService" ," relocalizeProcessRequest_grpc1" ,static_cast <uint32_t >(grpcRemoteStatus.error_code ()));
291
291
}
292
292
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
+
293
330
pose = xpcf::deserialize<SolAR::datastructure::Transform3Df>(respOut.pose ());
294
331
confidence = xpcf::deserialize<float_t >(respOut.confidence ());
295
332
detectedObjects = xpcf::deserialize<std::vector<SolAR::datastructure::DetectedObject>>(respOut.detectedobjects ());
0 commit comments