Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "cartographer/common/ceres_solver_options.h"
00018
00019 namespace cartographer {
00020 namespace common {
00021
00022 proto::CeresSolverOptions CreateCeresSolverOptionsProto(
00023 common::LuaParameterDictionary* parameter_dictionary) {
00024 proto::CeresSolverOptions proto;
00025 proto.set_use_nonmonotonic_steps(
00026 parameter_dictionary->GetBool("use_nonmonotonic_steps"));
00027 proto.set_max_num_iterations(
00028 parameter_dictionary->GetNonNegativeInt("max_num_iterations"));
00029 proto.set_num_threads(parameter_dictionary->GetNonNegativeInt("num_threads"));
00030 CHECK_GT(proto.max_num_iterations(), 0);
00031 CHECK_GT(proto.num_threads(), 0);
00032 return proto;
00033 }
00034
00035 ceres::Solver::Options CreateCeresSolverOptions(
00036 const proto::CeresSolverOptions& proto) {
00037 ceres::Solver::Options options;
00038 options.use_nonmonotonic_steps = proto.use_nonmonotonic_steps();
00039 options.max_num_iterations = proto.max_num_iterations();
00040 options.num_threads = proto.num_threads();
00041 return options;
00042 }
00043
00044 }
00045 }