map_builder_server_options.cc
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 
18 
22 
23 namespace cartographer {
24 namespace cloud {
25 
26 proto::MapBuilderServerOptions CreateMapBuilderServerOptions(
27  common::LuaParameterDictionary* lua_parameter_dictionary) {
28  proto::MapBuilderServerOptions map_builder_server_options;
29  map_builder_server_options.set_server_address(
30  lua_parameter_dictionary->GetString("server_address"));
31  map_builder_server_options.set_num_grpc_threads(
32  lua_parameter_dictionary->GetInt("num_grpc_threads"));
33  map_builder_server_options.set_num_event_threads(
34  lua_parameter_dictionary->GetInt("num_event_threads"));
35  *map_builder_server_options.mutable_map_builder_options() =
37  lua_parameter_dictionary->GetDictionary("map_builder").get());
38  map_builder_server_options.set_uplink_server_address(
39  lua_parameter_dictionary->GetString("uplink_server_address"));
40  map_builder_server_options.set_upload_batch_size(
41  lua_parameter_dictionary->GetInt("upload_batch_size"));
42  map_builder_server_options.set_enable_ssl_encryption(
43  lua_parameter_dictionary->GetBool("enable_ssl_encryption"));
44  return map_builder_server_options;
45 }
46 
47 proto::MapBuilderServerOptions LoadMapBuilderServerOptions(
48  const std::string& configuration_directory,
49  const std::string& configuration_basename) {
50  auto file_resolver = common::make_unique<common::ConfigurationFileResolver>(
51  std::vector<std::string>{configuration_directory});
52  const std::string code =
53  file_resolver->GetFileContentOrDie(configuration_basename);
54  common::LuaParameterDictionary lua_parameter_dictionary(
55  code, std::move(file_resolver));
56  return CreateMapBuilderServerOptions(&lua_parameter_dictionary);
57 }
58 
59 } // namespace cloud
60 } // namespace cartographer
proto::MapBuilderOptions CreateMapBuilderOptions(common::LuaParameterDictionary *const parameter_dictionary)
Definition: map_builder.cc:57
proto::MapBuilderServerOptions LoadMapBuilderServerOptions(const std::string &configuration_directory, const std::string &configuration_basename)
proto::MapBuilderServerOptions CreateMapBuilderServerOptions(common::LuaParameterDictionary *lua_parameter_dictionary)
std::unique_ptr< LuaParameterDictionary > GetDictionary(const std::string &key)


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