18 #include "async_grpc/client.h" 30 #include "glog/logging.h" 39 google::protobuf::Empty request;
40 async_grpc::Client<handlers::RunFinalOptimizationSignature> client(
42 CHECK(client.Write(request));
47 LOG(FATAL) <<
"Not implemented";
52 google::protobuf::Empty request;
53 async_grpc::Client<handlers::GetAllSubmapPosesSignature> client(
55 CHECK(client.Write(request));
58 for (
const auto& submap_pose : client.response().submap_poses()) {
61 submap_pose.submap_id().submap_index()},
63 submap_pose.submap_version(),
70 int trajectory_id)
const {
71 proto::GetLocalToGlobalTransformRequest request;
72 request.set_trajectory_id(trajectory_id);
73 async_grpc::Client<handlers::GetLocalToGlobalTransformSignature> client(
75 CHECK(client.Write(request));
81 LOG(FATAL) <<
"Not implemented";
86 google::protobuf::Empty request;
87 async_grpc::Client<handlers::GetTrajectoryNodePosesSignature> client(
89 CHECK(client.Write(request));
91 for (
const auto& node_pose : client.response().node_poses()) {
94 if (node_pose.has_constant_pose_data()) {
101 node_pose.node_id().node_index()},
110 google::protobuf::Empty request;
111 async_grpc::Client<handlers::GetLandmarkPosesSignature> client(
113 CHECK(client.Write(request));
114 std::map<std::string, transform::Rigid3d> landmark_poses;
115 for (
const auto& landmark_pose : client.response().landmark_poses()) {
116 landmark_poses[landmark_pose.landmark_id()] =
119 return landmark_poses;
124 proto::SetLandmarkPoseRequest request;
125 request.mutable_landmark_pose()->set_landmark_id(landmark_id);
126 *request.mutable_landmark_pose()->mutable_global_pose() =
128 async_grpc::Client<handlers::SetLandmarkPoseSignature> client(
130 CHECK(client.Write(request));
134 proto::IsTrajectoryFinishedRequest request;
135 request.set_trajectory_id(trajectory_id);
136 async_grpc::Client<handlers::IsTrajectoryFinishedSignature> client(
138 CHECK(client.Write(request));
139 return client.response().is_finished();
143 proto::IsTrajectoryFrozenRequest request;
144 request.set_trajectory_id(trajectory_id);
145 async_grpc::Client<handlers::IsTrajectoryFrozenSignature> client(
147 CHECK(client.Write(request));
148 return client.response().is_frozen();
151 std::map<int, mapping::PoseGraphInterface::TrajectoryData>
153 LOG(FATAL) <<
"Not implemented";
156 std::vector<mapping::PoseGraphInterface::Constraint>
158 google::protobuf::Empty request;
159 async_grpc::Client<handlers::GetConstraintsSignature> client(
client_channel_);
160 CHECK(client.Write(request));
165 LOG(FATAL) <<
"Not implemented";
170 LOG(FATAL) <<
"Not implemented";
PoseGraph::Constraint::Tag FromProto(const proto::PoseGraph::Constraint::Tag &proto)
transform::Rigid3d GetLocalToGlobalTransform(int trajectory_id) const override
bool IsTrajectoryFrozen(int trajectory_id) const override
std::vector< Constraint > constraints() const override
void SetGlobalSlamOptimizationCallback(GlobalSlamOptimizationCallback callback) override
void RunFinalOptimization() override
std::function< void(const std::map< int, SubmapId > &, const std::map< int, NodeId > &)> GlobalSlamOptimizationCallback
void Insert(const IdType &id, const DataType &data)
std::map< std::string, transform::Rigid3d > GetLandmarkPoses() const override
std::map< int, mapping::PoseGraphInterface::TrajectoryData > GetTrajectoryData() const override
Time FromUniversal(const int64 ticks)
bool IsTrajectoryFinished(int trajectory_id) const override
mapping::MapById< mapping::NodeId, mapping::TrajectoryNodePose > GetTrajectoryNodePoses() const override
mapping::MapById< mapping::SubmapId, SubmapData > GetAllSubmapData() const override
PoseGraphStub(std::shared_ptr<::grpc::Channel > client_channel)
void SetLandmarkPose(const std::string &landmark_id, const transform::Rigid3d &global_pose) override
mapping::MapById< mapping::SubmapId, SubmapPose > GetAllSubmapPoses() const override
std::shared_ptr<::grpc::Channel > client_channel_
mapping::MapById< mapping::NodeId, mapping::TrajectoryNode > GetTrajectoryNodes() const override
mapping::proto::PoseGraph ToProto() const override
std::shared_ptr<::grpc::Channel > client_channel_