map_builder_context_impl.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 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_INTERNAL_CLOUD_MAP_BUILDER_CONTEXT_IMPL_H
18 #define CARTOGRAPHER_INTERNAL_CLOUD_MAP_BUILDER_CONTEXT_IMPL_H
19 
20 namespace cartographer {
21 namespace cloud {
22 
23 template <class SubmapType>
25  MapBuilderServer* map_builder_server)
26  : map_builder_server_(map_builder_server) {}
27 
28 template <class SubmapType>
31 }
32 
33 template <class SubmapType>
37 }
38 
39 template <class SubmapType>
42  MapBuilderServer* map_builder_server = map_builder_server_;
43  return [map_builder_server](
44  int trajectory_id, common::Time time,
45  transform::Rigid3d local_pose, sensor::RangeData range_data,
46  std::unique_ptr<
48  insertion_result) {
49  map_builder_server->OnLocalSlamResult(trajectory_id, time, local_pose,
50  std::move(range_data),
51  std::move(insertion_result));
52  };
53 }
54 
55 template <class SubmapType>
57  const Data& sensor_data) {
58  sensor_data.data->AddToTrajectoryBuilder(
59  map_builder_server_->map_builder_->GetTrajectoryBuilder(
60  sensor_data.trajectory_id));
61 }
62 
63 template <class SubmapType>
66  int trajectory_id, LocalSlamSubscriptionCallback callback) {
67  return map_builder_server_->SubscribeLocalSlamResults(trajectory_id,
68  callback);
69 }
70 
71 template <class SubmapType>
73  const LocalSlamSubscriptionId& subscription_id) {
75 }
76 
77 template <class SubmapType>
81 }
82 
83 template <class SubmapType>
85  int subscription_index) {
87 }
88 
89 template <class SubmapType>
92 }
93 
94 template <class SubmapType>
98 }
99 
100 template <class SubmapType>
102  int trajectory_id, std::unique_ptr<sensor::Data> data) {
104  common::make_unique<Data>(Data{trajectory_id, std::move(data)}));
105 }
106 
107 template <>
109  int trajectory_id, const std::string& sensor_id,
110  const mapping::proto::LocalSlamResultData& local_slam_result_data);
111 template <>
113  int trajectory_id, const std::string& sensor_id,
114  const mapping::proto::LocalSlamResultData& local_slam_result_data);
115 
116 } // namespace cloud
117 } // namespace cartographer
118 
119 #endif // CARTOGRAPHER_INTERNAL_CLOUD_MAP_BUILDER_CONTEXT_IMPL_H
mapping::TrajectoryBuilderInterface::LocalSlamResultCallback GetLocalSlamResultCallbackForSubscriptions() override
void AddSensorDataToTrajectory(const Data &sensor_data) override
std::unique_ptr< mapping::MapBuilderInterface > map_builder_
void UnsubscribeGlobalSlamOptimizations(int subscription_index) override
MapBuilderContextInterface::LocalSlamSubscriptionId SubscribeLocalSlamResults(int trajectory_id, MapBuilderContextInterface::LocalSlamSubscriptionCallback callback)
void NotifyFinishTrajectory(int trajectory_id) override
std::function< bool(std::unique_ptr< LocalSlamResult >)> LocalSlamSubscriptionCallback
void NotifyFinishTrajectory(int trajectory_id)
std::function< bool(const std::map< int, mapping::SubmapId > &, const std::map< int, mapping::NodeId > &)> GlobalSlamOptimizationCallback
MapBuilderContextInterface::LocalSlamSubscriptionId SubscribeLocalSlamResults(int trajectory_id, LocalSlamSubscriptionCallback callback) override
UniversalTimeScaleClock::time_point Time
Definition: time.h:44
void OnLocalSlamResult(int trajectory_id, common::Time time, transform::Rigid3d local_pose, sensor::RangeData range_data, std::unique_ptr< const mapping::TrajectoryBuilderInterface::InsertionResult > insertion_result)
static time_point time
std::unique_ptr< LocalTrajectoryUploaderInterface > local_trajectory_uploader_
mapping::MapBuilderInterface & map_builder() override
MapBuilderContext(MapBuilderServer *map_builder_server)
int SubscribeGlobalSlamOptimizations(MapBuilderContextInterface::GlobalSlamOptimizationCallback callback)
common::BlockingQueue< std::unique_ptr< MapBuilderContextInterface::Data > > & sensor_data_queue() override
LocalTrajectoryUploaderInterface * local_trajectory_uploader() override
void EnqueueSensorData(int trajectory_id, std::unique_ptr< sensor::Data > data) override
void UnsubscribeLocalSlamResults(const LocalSlamSubscriptionId &subscription_id) override
void UnsubscribeLocalSlamResults(const MapBuilderContextInterface::LocalSlamSubscriptionId &subscription_id)
common::BlockingQueue< std::unique_ptr< MapBuilderContextInterface::Data > > incoming_data_queue_
int SubscribeGlobalSlamOptimizations(GlobalSlamOptimizationCallback callback) override
void UnsubscribeGlobalSlamOptimizations(int subscription_index)
void EnqueueLocalSlamResultData(int trajectory_id, const std::string &sensor_id, const mapping::proto::LocalSlamResultData &local_slam_result_data) override
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