19 #include "async_grpc/rpc_handler.h" 21 #include "cartographer/cloud/proto/map_builder_service.pb.h" 23 #include "google/protobuf/empty.pb.h" 29 void FinishTrajectoryHandler::OnRequest(
30 const proto::FinishTrajectoryRequest& request) {
31 GetContext<MapBuilderContextInterface>()->map_builder().FinishTrajectory(
32 request.trajectory_id());
33 GetUnsynchronizedContext<MapBuilderContextInterface>()
34 ->NotifyFinishTrajectory(request.trajectory_id());
35 if (GetUnsynchronizedContext<MapBuilderContextInterface>()
36 ->local_trajectory_uploader()) {
37 GetContext<MapBuilderContextInterface>()
38 ->local_trajectory_uploader()
39 ->FinishTrajectory(request.trajectory_id());
41 Send(common::make_unique<google::protobuf::Empty>());