19 #include "async_grpc/rpc_handler.h" 22 #include "cartographer/cloud/proto/map_builder_service.pb.h" 26 #include "google/protobuf/empty.pb.h" 32 void AddFixedFramePoseDataHandler::OnRequest(
33 const proto::AddFixedFramePoseDataRequest &request) {
37 GetUnsynchronizedContext<MapBuilderContextInterface>()->EnqueueSensorData(
38 request.sensor_metadata().trajectory_id(),
40 request.sensor_metadata().sensor_id(),
46 if (GetUnsynchronizedContext<MapBuilderContextInterface>()
47 ->local_trajectory_uploader()) {
48 auto sensor_data = common::make_unique<proto::SensorData>();
49 *sensor_data->mutable_sensor_metadata() = request.sensor_metadata();
50 *sensor_data->mutable_fixed_frame_pose_data() =
51 request.fixed_frame_pose_data();
52 GetUnsynchronizedContext<MapBuilderContextInterface>()
53 ->local_trajectory_uploader()
54 ->EnqueueSensorData(std::move(sensor_data));
58 void AddFixedFramePoseDataHandler::OnReadsDone() {
59 Send(common::make_unique<google::protobuf::Empty>());
FixedFramePoseData FromProto(const proto::FixedFramePoseData &proto)
std::unique_ptr< Dispatchable< DataType > > MakeDispatchable(const std::string &sensor_id, const DataType &data)