Minimal API functionality with unit tests, could be used for integration tests with Unity server. For internal testing used RPC_server implementation
39 lines
912 B
C++
39 lines
912 B
C++
#include "cloud_point_rpc/service.hpp"
|
|
|
|
namespace cloud_point_rpc {
|
|
|
|
Service::Service(const TestData& data) : data_(data) {}
|
|
|
|
std::vector<double> Service::get_intrinsic_params() const {
|
|
if (data_.intrinsic_params.empty()) {
|
|
// Fallback if no config loaded
|
|
return {1.0, 0.0, 0.0,
|
|
0.0, 1.0, 0.0,
|
|
0.0, 0.0, 1.0};
|
|
}
|
|
return data_.intrinsic_params;
|
|
}
|
|
|
|
std::vector<double> Service::get_extrinsic_params() const {
|
|
if (data_.extrinsic_params.empty()) {
|
|
return {1.0, 0.0, 0.0, 0.0,
|
|
0.0, 1.0, 0.0, 0.0,
|
|
0.0, 0.0, 1.0, 0.0,
|
|
0.0, 0.0, 0.0, 1.0};
|
|
}
|
|
return data_.extrinsic_params;
|
|
}
|
|
|
|
std::vector<std::vector<double>> Service::get_cloud_point() const {
|
|
if (data_.cloud_point.empty()) {
|
|
return {
|
|
{0.1, 0.2, 0.3},
|
|
{1.1, 1.2, 1.3},
|
|
{2.1, 2.2, 2.3}
|
|
};
|
|
}
|
|
return data_.cloud_point;
|
|
}
|
|
|
|
} // namespace cloud_point_rpc
|