Skip to content

Commit ba44340

Browse files
committed
update according to last solar framework commit
1 parent 0bffebc commit ba44340

36 files changed

+3845
-131
lines changed

IAsyncRelocalizationPipeline_grpcProxy.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ void IAsyncRelocalizationPipeline_grpcProxy::unloadComponent ()
3333

3434
XPCFErrorCode IAsyncRelocalizationPipeline_grpcProxy::onConfigured()
3535
{
36-
m_channel = ::grpc::CreateChannel(m_channelUrl, xpcf::GrpcHelper::getCredentials(static_cast<xpcf::grpcCredentials>(m_channelCredentials)));
36+
::grpc::ChannelArguments ch_args;
37+
ch_args.SetMaxReceiveMessageSize(-1);
38+
ch_args.SetMaxSendMessageSize(-1);
39+
m_channel = ::grpc::CreateCustomChannel(m_channelUrl,
40+
xpcf::GrpcHelper::getCredentials(static_cast<xpcf::grpcCredentials>(m_channelCredentials)),
41+
ch_args);
3742
m_grpcStub = ::grpcIAsyncRelocalizationPipeline::grpcIAsyncRelocalizationPipelineService::NewStub(m_channel);
3843
for (auto & compressionLine : m_grpcProxyCompressionConfig) {
3944
translateClientConfiguration(compressionLine, m_serviceCompressionInfos, m_methodCompressionInfosMap);

IAsyncRelocalizationPipeline_grpcProxy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::proxy
6767
};
6868

6969

70-
#endif
70+
#endif

IAsyncRelocalizationPipeline_grpcServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::serve
7070
static constexpr const char * DESCRIPTION = "IAsyncRelocalizationPipeline_grpcServer grpc server component";
7171
};
7272

73-
#endif
73+
#endif

IDenseMappingPipeline_grpcProxy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::proxy
5252
};
5353

5454

55-
#endif
55+
#endif

IDenseMappingPipeline_grpcServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::serve
5555
static constexpr const char * DESCRIPTION = "IDenseMappingPipeline_grpcServer grpc server component";
5656
};
5757

58-
#endif
58+
#endif

IMapManager_grpcProxy.cpp

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ IMapManager_grpcProxy::IMapManager_grpcProxy():xpcf::ConfigurableBase(xpcf::toMa
1919
declareInterface<SolAR::api::storage::IMapManager>(this);
2020
declareProperty("channelUrl",m_channelUrl);
2121
declareProperty("channelCredentials",m_channelCredentials);
22-
m_grpcProxyCompressionConfig.resize(19);
22+
m_grpcProxyCompressionConfig.resize(20);
2323
declarePropertySequence("grpc_compress_proxy", m_grpcProxyCompressionConfig);
2424
}
2525

@@ -505,6 +505,35 @@ int IMapManager_grpcProxy::keyframePruning(std::vector<SRef<SolAR::datastructur
505505
}
506506

507507

508+
SolAR::FrameworkReturnCode IMapManager_grpcProxy::visibilityPruning()
509+
{
510+
::grpc::ClientContext context;
511+
::grpcIMapManager::visibilityPruningRequest reqIn;
512+
::grpcIMapManager::visibilityPruningResponse respOut;
513+
#ifndef DISABLE_GRPC_COMPRESSION
514+
xpcf::grpcCompressionInfos proxyCompressionInfo = xpcf::deduceClientCompressionInfo(m_serviceCompressionInfos, "visibilityPruning", m_methodCompressionInfosMap);
515+
xpcf::grpcCompressType serverCompressionType = xpcf::prepareClientCompressionContext(context, proxyCompressionInfo);
516+
reqIn.set_grpcservercompressionformat (static_cast<int32_t>(serverCompressionType));
517+
#endif
518+
#ifdef ENABLE_PROXY_TIMERS
519+
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
520+
std::cout << "====> IMapManager_grpcProxy::visibilityPruning request sent at " << to_simple_string(start) << std::endl;
521+
#endif
522+
::grpc::Status grpcRemoteStatus = m_grpcStub->visibilityPruning(&context, reqIn, &respOut);
523+
#ifdef ENABLE_PROXY_TIMERS
524+
boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();
525+
std::cout << "====> IMapManager_grpcProxy::visibilityPruning response received at " << to_simple_string(end) << std::endl;
526+
std::cout << " => elapsed time = " << ((end - start).total_microseconds() / 1000.00) << " ms" << std::endl;
527+
#endif
528+
if (!grpcRemoteStatus.ok()) {
529+
std::cout << "visibilityPruning rpc failed." << std::endl;
530+
throw xpcf::RemotingException("grpcIMapManagerService","visibilityPruning",static_cast<uint32_t>(grpcRemoteStatus.error_code()));
531+
}
532+
533+
return static_cast<SolAR::FrameworkReturnCode>(respOut.xpcfgrpcreturnvalue());
534+
}
535+
536+
508537
SolAR::FrameworkReturnCode IMapManager_grpcProxy::saveToFile() const
509538
{
510539
::grpc::ClientContext context;

IMapManager_grpcProxy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class IMapManager_grpcProxy: public org::bcom::xpcf::ConfigurableBase, virtual
3737
SolAR::FrameworkReturnCode getCameraParameters(uint32_t const id, SolAR::datastructure::CameraParameters& cameraParameters) override;
3838
int pointCloudPruning(std::vector<SRef<SolAR::datastructure::CloudPoint>> const& cloudPoints) override;
3939
int keyframePruning(std::vector<SRef<SolAR::datastructure::Keyframe>> const& keyframes) override;
40+
SolAR::FrameworkReturnCode visibilityPruning() override;
4041
SolAR::FrameworkReturnCode saveToFile() const override;
4142
SolAR::FrameworkReturnCode loadFromFile() override;
4243
SolAR::FrameworkReturnCode deleteFile() override;

IMapManager_grpcServer.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ IMapManager_grpcServer::IMapManager_grpcServer():xpcf::ConfigurableBase(xpcf::to
1414
{
1515
declareInterface<xpcf::IGrpcService>(this);
1616
declareInjectable<SolAR::api::storage::IMapManager>(m_grpcService.m_xpcfComponent);
17-
m_grpcServerCompressionConfig.resize(19);
17+
m_grpcServerCompressionConfig.resize(20);
1818
declarePropertySequence("grpc_compress_server", m_grpcServerCompressionConfig);
1919
}
2020

@@ -398,6 +398,28 @@ ::grpc::Status IMapManager_grpcServer::grpcIMapManagerServiceImpl::keyframePruni
398398
}
399399

400400

401+
::grpc::Status IMapManager_grpcServer::grpcIMapManagerServiceImpl::visibilityPruning(::grpc::ServerContext* context, const ::grpcIMapManager::visibilityPruningRequest* request, ::grpcIMapManager::visibilityPruningResponse* response)
402+
{
403+
#ifndef DISABLE_GRPC_COMPRESSION
404+
xpcf::grpcCompressType askedCompressionType = static_cast<xpcf::grpcCompressType>(request->grpcservercompressionformat());
405+
xpcf::grpcServerCompressionInfos serverCompressInfo = xpcf::deduceServerCompressionType(askedCompressionType, m_serviceCompressionInfos, "visibilityPruning", m_methodCompressionInfosMap);
406+
xpcf::prepareServerCompressionContext(context, serverCompressInfo);
407+
#endif
408+
#ifdef ENABLE_SERVER_TIMERS
409+
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
410+
std::cout << "====> IMapManager_grpcServer::visibilityPruning request received at " << to_simple_string(start) << std::endl;
411+
#endif
412+
SolAR::FrameworkReturnCode returnValue = m_xpcfComponent->visibilityPruning();
413+
response->set_xpcfgrpcreturnvalue(static_cast<int32_t>(returnValue));
414+
#ifdef ENABLE_SERVER_TIMERS
415+
boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();
416+
std::cout << "====> IMapManager_grpcServer::visibilityPruning response sent at " << to_simple_string(end) << std::endl;
417+
std::cout << " => elapsed time = " << ((end - start).total_microseconds() / 1000.00) << " ms" << std::endl;
418+
#endif
419+
return ::grpc::Status::OK;
420+
}
421+
422+
401423
::grpc::Status IMapManager_grpcServer::grpcIMapManagerServiceImpl::saveToFile(::grpc::ServerContext* context, const ::grpcIMapManager::saveToFileRequest* request, ::grpcIMapManager::saveToFileResponse* response)
402424
{
403425
#ifndef DISABLE_GRPC_COMPRESSION

IMapManager_grpcServer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class IMapManager_grpcServer: public org::bcom::xpcf::ConfigurableBase, virtual
4040
::grpc::Status getCameraParameters_grpc1(::grpc::ServerContext* context, const ::grpcIMapManager::getCameraParameters_grpc1Request* request, ::grpcIMapManager::getCameraParameters_grpc1Response* response) override;
4141
::grpc::Status pointCloudPruning(::grpc::ServerContext* context, const ::grpcIMapManager::pointCloudPruningRequest* request, ::grpcIMapManager::pointCloudPruningResponse* response) override;
4242
::grpc::Status keyframePruning(::grpc::ServerContext* context, const ::grpcIMapManager::keyframePruningRequest* request, ::grpcIMapManager::keyframePruningResponse* response) override;
43+
::grpc::Status visibilityPruning(::grpc::ServerContext* context, const ::grpcIMapManager::visibilityPruningRequest* request, ::grpcIMapManager::visibilityPruningResponse* response) override;
4344
::grpc::Status saveToFile(::grpc::ServerContext* context, const ::grpcIMapManager::saveToFileRequest* request, ::grpcIMapManager::saveToFileResponse* response) override;
4445
::grpc::Status loadFromFile(::grpc::ServerContext* context, const ::grpcIMapManager::loadFromFileRequest* request, ::grpcIMapManager::loadFromFileResponse* response) override;
4546
::grpc::Status deleteFile(::grpc::ServerContext* context, const ::grpcIMapManager::deleteFileRequest* request, ::grpcIMapManager::deleteFileResponse* response) override;

IMapUpdatePipeline_grpcProxy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::proxy
5555
};
5656

5757

58-
#endif
58+
#endif

0 commit comments

Comments
 (0)