trajectory_builder_stub.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CARTOGRAPHER_CLOUD_INTERNAL_CLIENT_TRAJECTORY_BUILDER_STUB_H_
18 #define CARTOGRAPHER_CLOUD_INTERNAL_CLIENT_TRAJECTORY_BUILDER_STUB_H_
19 
20 #include <thread>
21 
22 #include "async_grpc/client.h"
31 #include "grpc++/grpc++.h"
32 #include "pose_graph_stub.h"
34 
35 namespace cartographer {
36 namespace cloud {
37 
39  public:
40  TrajectoryBuilderStub(std::shared_ptr<::grpc::Channel> client_channel,
41  const int trajectory_id,
42  LocalSlamResultCallback local_slam_result_callback);
43  ~TrajectoryBuilderStub() override;
46 
47  void AddSensorData(
48  const std::string& sensor_id,
49  const sensor::TimedPointCloudData& timed_point_cloud_data) override;
50  void AddSensorData(const std::string& sensor_id,
51  const sensor::ImuData& imu_data) override;
52  void AddSensorData(const std::string& sensor_id,
53  const sensor::OdometryData& odometry_data) override;
54  void AddSensorData(
55  const std::string& sensor_id,
56  const sensor::FixedFramePoseData& fixed_frame_pose) override;
57  void AddSensorData(const std::string& sensor_id,
58  const sensor::LandmarkData& landmark_data) override;
59  void AddLocalSlamResultData(std::unique_ptr<mapping::LocalSlamResultData>
60  local_slam_result_data) override;
61 
62  private:
63  static void RunLocalSlamResultsReader(
64  async_grpc::Client<handlers::ReceiveLocalSlamResultsSignature>*
65  client_reader,
66  LocalSlamResultCallback local_slam_result_callback);
67 
68  std::shared_ptr<::grpc::Channel> client_channel_;
69  const int trajectory_id_;
70  std::unique_ptr<async_grpc::Client<handlers::AddRangefinderDataSignature>>
72  std::unique_ptr<async_grpc::Client<handlers::AddImuDataSignature>>
74  std::unique_ptr<async_grpc::Client<handlers::AddOdometryDataSignature>>
76  std::unique_ptr<async_grpc::Client<handlers::AddFixedFramePoseDataSignature>>
78  std::unique_ptr<async_grpc::Client<handlers::AddLandmarkDataSignature>>
80  async_grpc::Client<handlers::ReceiveLocalSlamResultsSignature>
82  std::unique_ptr<std::thread> receive_local_slam_results_thread_;
83 };
84 
85 } // namespace cloud
86 } // namespace cartographer
87 
88 #endif // CARTOGRAPHER_CLOUD_INTERNAL_CLIENT_TRAJECTORY_BUILDER_STUB_H_
std::unique_ptr< async_grpc::Client< handlers::AddFixedFramePoseDataSignature > > add_fixed_frame_pose_client_
std::unique_ptr< async_grpc::Client< handlers::AddImuDataSignature > > add_imu_client_
void AddSensorData(const std::string &sensor_id, const sensor::TimedPointCloudData &timed_point_cloud_data) override
TrajectoryBuilderStub & operator=(const TrajectoryBuilderStub &)=delete
std::unique_ptr< async_grpc::Client< handlers::AddLandmarkDataSignature > > add_landmark_client_
std::shared_ptr<::grpc::Channel > client_channel_
void AddLocalSlamResultData(std::unique_ptr< mapping::LocalSlamResultData > local_slam_result_data) override
static void RunLocalSlamResultsReader(async_grpc::Client< handlers::ReceiveLocalSlamResultsSignature > *client_reader, LocalSlamResultCallback local_slam_result_callback)
async_grpc::Client< handlers::ReceiveLocalSlamResultsSignature > receive_local_slam_results_client_
std::unique_ptr< async_grpc::Client< handlers::AddRangefinderDataSignature > > add_rangefinder_client_
std::unique_ptr< async_grpc::Client< handlers::AddOdometryDataSignature > > add_odometry_client_
std::unique_ptr< std::thread > receive_local_slam_results_thread_
TrajectoryBuilderStub(std::shared_ptr<::grpc::Channel > client_channel, const int trajectory_id, LocalSlamResultCallback local_slam_result_callback)
std::function< void(int, common::Time, transform::Rigid3d, sensor::RangeData, std::unique_ptr< const InsertionResult >)> LocalSlamResultCallback


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:58