19 #include "async_grpc/rpc_handler.h" 21 #include "cartographer/cloud/proto/map_builder_service.pb.h" 24 #include "google/protobuf/empty.pb.h" 30 void GetTrajectoryNodePosesHandler::OnRequest(
31 const google::protobuf::Empty& request) {
32 auto node_poses = GetContext<MapBuilderContextInterface>()
35 ->GetTrajectoryNodePoses();
36 auto response = common::make_unique<proto::GetTrajectoryNodePosesResponse>();
37 for (
const auto& node_id_pose : node_poses) {
38 auto* node_pose = response->add_node_poses();
39 node_id_pose.id.ToProto(node_pose->mutable_node_id());
40 *node_pose->mutable_global_pose() =
42 if (node_id_pose.data.constant_pose_data.has_value()) {
43 node_pose->mutable_constant_pose_data()->set_timestamp(
45 node_id_pose.data.constant_pose_data.value().time));
46 *node_pose->mutable_constant_pose_data()->mutable_local_pose() =
48 node_id_pose.data.constant_pose_data.value().local_pose);
51 Send(std::move(response));
int64 ToUniversal(const Time time)