@@ -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 (9 );
22
+ m_grpcProxyCompressionConfig.resize (10 );
23
23
declarePropertySequence (" grpc_compress_proxy" , m_grpcProxyCompressionConfig);
24
24
}
25
25
@@ -230,6 +230,43 @@ SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcess
230
230
}
231
231
232
232
233
+ SolAR::FrameworkReturnCode IRelocalizationPipeline_grpcProxy::relocalizeProcessRequestViz (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)
234
+ {
235
+ ::grpc::ClientContext context;
236
+ ::grpcIRelocalizationPipeline::relocalizeProcessRequestVizRequest reqIn;
237
+ ::grpcIRelocalizationPipeline::relocalizeProcessRequestVizResponse respOut;
238
+ #ifndef DISABLE_GRPC_COMPRESSION
239
+ xpcf::grpcCompressionInfos proxyCompressionInfo = xpcf::deduceClientCompressionInfo (m_serviceCompressionInfos, " relocalizeProcessRequestViz" , m_methodCompressionInfosMap);
240
+ xpcf::grpcCompressType serverCompressionType = xpcf::prepareClientCompressionContext (context, proxyCompressionInfo);
241
+ reqIn.set_grpcservercompressionformat (static_cast <int32_t >(serverCompressionType));
242
+ #endif
243
+ reqIn.set_image (xpcf::serialize<SRef<SolAR::datastructure::Image>>(image));
244
+ reqIn.set_posecoarse (xpcf::serialize<SolAR::datastructure::Transform3Df>(poseCoarse));
245
+ reqIn.set_currpointcloud (xpcf::serialize<std::vector<SRef<SolAR::datastructure::CloudPoint>>>(currPointCloud));
246
+ reqIn.set_pose (xpcf::serialize<SolAR::datastructure::Transform3Df>(pose));
247
+ reqIn.set_confidence (xpcf::serialize<float_t >(confidence));
248
+ #ifdef ENABLE_PROXY_TIMERS
249
+ boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time ();
250
+ std::cout << " ====> IRelocalizationPipeline_grpcProxy::relocalizeProcessRequestViz request sent at " << to_simple_string (start) << std::endl;
251
+ #endif
252
+ ::grpc::Status grpcRemoteStatus = m_grpcStub->relocalizeProcessRequestViz (&context, reqIn, &respOut);
253
+ #ifdef ENABLE_PROXY_TIMERS
254
+ boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time ();
255
+ std::cout << " ====> IRelocalizationPipeline_grpcProxy::relocalizeProcessRequestViz response received at " << to_simple_string (end) << std::endl;
256
+ std::cout << " => elapsed time = " << ((end - start).total_microseconds () / 1000.00 ) << " ms" << std::endl;
257
+ #endif
258
+ if (!grpcRemoteStatus.ok ()) {
259
+ std::cout << " relocalizeProcessRequestViz rpc failed." << std::endl;
260
+ throw xpcf::RemotingException (" grpcIRelocalizationPipelineService" ," relocalizeProcessRequestViz" ,static_cast <uint32_t >(grpcRemoteStatus.error_code ()));
261
+ }
262
+
263
+ currPointCloud = xpcf::deserialize<std::vector<SRef<SolAR::datastructure::CloudPoint>>>(respOut.currpointcloud ());
264
+ pose = xpcf::deserialize<SolAR::datastructure::Transform3Df>(respOut.pose ());
265
+ confidence = xpcf::deserialize<float_t >(respOut.confidence ());
266
+ return static_cast <SolAR::FrameworkReturnCode>(respOut.xpcfgrpcreturnvalue ());
267
+ }
268
+
269
+
233
270
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)
234
271
{
235
272
::grpc::ClientContext context;
0 commit comments