map_builder_stub.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2017 The Cartographer Authors
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef CARTOGRAPHER_CLOUD_CLIENT_MAP_BUILDER_STUB_H_
00018 #define CARTOGRAPHER_CLOUD_CLIENT_MAP_BUILDER_STUB_H_
00019 
00020 #include <memory>
00021 
00022 #include "cartographer/mapping/map_builder_interface.h"
00023 #include "cartographer/mapping/pose_graph_interface.h"
00024 #include "cartographer/mapping/trajectory_builder_interface.h"
00025 #include "grpc++/grpc++.h"
00026 
00027 namespace cartographer {
00028 namespace cloud {
00029 
00030 class MapBuilderStub : public mapping::MapBuilderInterface {
00031  public:
00032   MapBuilderStub(const std::string& server_address,
00033                  const std::string& client_id);
00034 
00035   MapBuilderStub(const MapBuilderStub&) = delete;
00036   MapBuilderStub& operator=(const MapBuilderStub&) = delete;
00037 
00038   int AddTrajectoryBuilder(
00039       const std::set<SensorId>& expected_sensor_ids,
00040       const mapping::proto::TrajectoryBuilderOptions& trajectory_options,
00041       LocalSlamResultCallback local_slam_result_callback) override;
00042   int AddTrajectoryForDeserialization(
00043       const mapping::proto::TrajectoryBuilderOptionsWithSensorIds&
00044           options_with_sensor_ids_proto) override;
00045   mapping::TrajectoryBuilderInterface* GetTrajectoryBuilder(
00046       int trajectory_id) const override;
00047   void FinishTrajectory(int trajectory_id) override;
00048   std::string SubmapToProto(
00049       const mapping::SubmapId& submap_id,
00050       mapping::proto::SubmapQuery::Response* response) override;
00051   void SerializeState(bool include_unfinished_submaps,
00052                       io::ProtoStreamWriterInterface* writer) override;
00053   bool SerializeStateToFile(bool include_unfinished_submaps,
00054                             const std::string& filename) override;
00055   std::map<int, int> LoadState(io::ProtoStreamReaderInterface* reader,
00056                                bool load_frozen_state) override;
00057   std::map<int, int> LoadStateFromFile(const std::string& filename,
00058                                        bool load_frozen_state) override;
00059   int num_trajectory_builders() const override;
00060   mapping::PoseGraphInterface* pose_graph() override;
00061   const std::vector<mapping::proto::TrajectoryBuilderOptionsWithSensorIds>&
00062   GetAllTrajectoryBuilderOptions() const override;
00063 
00064  private:
00065   std::shared_ptr<::grpc::Channel> client_channel_;
00066   std::unique_ptr<mapping::PoseGraphInterface> pose_graph_stub_;
00067   std::map<int, std::unique_ptr<mapping::TrajectoryBuilderInterface>>
00068       trajectory_builder_stubs_;
00069   const std::string client_id_;
00070 };
00071 
00072 }  // namespace cloud
00073 }  // namespace cartographer
00074 
00075 #endif  // CARTOGRAPHER_CLOUD_CLIENT_MAP_BUILDER_STUB_H_


cartographer
Author(s): The Cartographer Authors
autogenerated on Thu May 9 2019 02:27:35