@@ -19,7 +19,7 @@ I3DTransformFinderFrom2D2D_grpcProxy::I3DTransformFinderFrom2D2D_grpcProxy():xpc
19
19
declareInterface<SolAR::api::solver::pose::I3DTransformFinderFrom2D2D>(this );
20
20
declareProperty (" channelUrl" ,m_channelUrl);
21
21
declareProperty (" channelCredentials" ,m_channelCredentials);
22
- m_grpcProxyCompressionConfig.resize (4 );
22
+ m_grpcProxyCompressionConfig.resize (3 );
23
23
declarePropertySequence (" grpc_compress_proxy" , m_grpcProxyCompressionConfig);
24
24
}
25
25
@@ -42,32 +42,7 @@ XPCFErrorCode I3DTransformFinderFrom2D2D_grpcProxy::onConfigured()
42
42
}
43
43
44
44
45
- void I3DTransformFinderFrom2D2D_grpcProxy::setCameraParameters (SolAR::datastructure::CamCalibration const & intrinsicParams, SolAR::datastructure::CamDistortion const & distorsionParams)
46
- {
47
- ::grpc::ClientContext context;
48
- ::grpcI3DTransformFinderFrom2D2D::setCameraParametersRequest reqIn;
49
- ::google::protobuf::Empty respOut;
50
- reqIn.set_intrinsicparams (xpcf::serialize<SolAR::datastructure::CamCalibration>(intrinsicParams));
51
- reqIn.set_distorsionparams (xpcf::serialize<SolAR::datastructure::CamDistortion>(distorsionParams));
52
- #ifdef ENABLE_PROXY_TIMERS
53
- boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time ();
54
- std::cout << " ====> I3DTransformFinderFrom2D2D_grpcProxy::setCameraParameters request sent at " << to_simple_string (start) << std::endl;
55
- #endif
56
- ::grpc::Status grpcRemoteStatus = m_grpcStub->setCameraParameters (&context, reqIn, &respOut);
57
- #ifdef ENABLE_PROXY_TIMERS
58
- boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time ();
59
- std::cout << " ====> I3DTransformFinderFrom2D2D_grpcProxy::setCameraParameters response received at " << to_simple_string (end) << std::endl;
60
- std::cout << " => elapsed time = " << ((end - start).total_microseconds () / 1000.00 ) << " ms" << std::endl;
61
- #endif
62
- if (!grpcRemoteStatus.ok ()) {
63
- std::cout << " setCameraParameters rpc failed." << std::endl;
64
- throw xpcf::RemotingException (" grpcI3DTransformFinderFrom2D2DService" ," setCameraParameters" ,static_cast <uint32_t >(grpcRemoteStatus.error_code ()));
65
- }
66
-
67
- }
68
-
69
-
70
- SolAR::FrameworkReturnCode I3DTransformFinderFrom2D2D_grpcProxy::estimate (std::vector<SolAR::datastructure::Point2Df> const & pointsView1, std::vector<SolAR::datastructure::Point2Df> const & pointsView2, SolAR::datastructure::Transform3Df const & poseView1, SolAR::datastructure::Transform3Df& poseView2, std::vector<SolAR::datastructure::DescriptorMatch>& inlierMatches)
45
+ SolAR::FrameworkReturnCode I3DTransformFinderFrom2D2D_grpcProxy::estimate (std::vector<SolAR::datastructure::Point2Df> const & pointsView1, std::vector<SolAR::datastructure::Point2Df> const & pointsView2, SolAR::datastructure::CameraParameters const & camParams, SolAR::datastructure::Transform3Df const & poseView1, SolAR::datastructure::Transform3Df& poseView2, std::vector<SolAR::datastructure::DescriptorMatch>& inlierMatches)
71
46
{
72
47
::grpc::ClientContext context;
73
48
::grpcI3DTransformFinderFrom2D2D::estimate_grpc0Request reqIn;
@@ -79,6 +54,7 @@ SolAR::FrameworkReturnCode I3DTransformFinderFrom2D2D_grpcProxy::estimate(std::
79
54
#endif
80
55
reqIn.set_pointsview1 (xpcf::serialize<std::vector<SolAR::datastructure::Point2Df>>(pointsView1));
81
56
reqIn.set_pointsview2 (xpcf::serialize<std::vector<SolAR::datastructure::Point2Df>>(pointsView2));
57
+ reqIn.set_camparams (xpcf::serialize<SolAR::datastructure::CameraParameters>(camParams));
82
58
reqIn.set_poseview1 (xpcf::serialize<SolAR::datastructure::Transform3Df>(poseView1));
83
59
reqIn.set_poseview2 (xpcf::serialize<SolAR::datastructure::Transform3Df>(poseView2));
84
60
reqIn.set_inliermatches (xpcf::serialize<std::vector<SolAR::datastructure::DescriptorMatch>>(inlierMatches));
@@ -103,7 +79,7 @@ SolAR::FrameworkReturnCode I3DTransformFinderFrom2D2D_grpcProxy::estimate(std::
103
79
}
104
80
105
81
106
- SolAR::FrameworkReturnCode I3DTransformFinderFrom2D2D_grpcProxy::estimate (std::vector<SolAR::datastructure::Keypoint> const & pointsView1, std::vector<SolAR::datastructure::Keypoint> const & pointsView2, SolAR::datastructure::Transform3Df const & poseView1, SolAR::datastructure::Transform3Df& poseView2, std::vector<SolAR::datastructure::DescriptorMatch>& inlierMatches)
82
+ SolAR::FrameworkReturnCode I3DTransformFinderFrom2D2D_grpcProxy::estimate (std::vector<SolAR::datastructure::Keypoint> const & pointsView1, std::vector<SolAR::datastructure::Keypoint> const & pointsView2, SolAR::datastructure::CameraParameters const & camParams, SolAR::datastructure:: Transform3Df const & poseView1, SolAR::datastructure::Transform3Df& poseView2, std::vector<SolAR::datastructure::DescriptorMatch>& inlierMatches)
107
83
{
108
84
::grpc::ClientContext context;
109
85
::grpcI3DTransformFinderFrom2D2D::estimate_grpc1Request reqIn;
@@ -115,6 +91,7 @@ SolAR::FrameworkReturnCode I3DTransformFinderFrom2D2D_grpcProxy::estimate(std::
115
91
#endif
116
92
reqIn.set_pointsview1 (xpcf::serialize<std::vector<SolAR::datastructure::Keypoint>>(pointsView1));
117
93
reqIn.set_pointsview2 (xpcf::serialize<std::vector<SolAR::datastructure::Keypoint>>(pointsView2));
94
+ reqIn.set_camparams (xpcf::serialize<SolAR::datastructure::CameraParameters>(camParams));
118
95
reqIn.set_poseview1 (xpcf::serialize<SolAR::datastructure::Transform3Df>(poseView1));
119
96
reqIn.set_poseview2 (xpcf::serialize<SolAR::datastructure::Transform3Df>(poseView2));
120
97
reqIn.set_inliermatches (xpcf::serialize<std::vector<SolAR::datastructure::DescriptorMatch>>(inlierMatches));
0 commit comments