Apollo 11.0
自动驾驶开放平台
poses_interpolator.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
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#include <boost/program_options.hpp>
18
19#include "cyber/common/log.h"
21
22int main(int argc, char **argv) {
23 boost::program_options::options_description boost_desc("Allowed options");
24 boost_desc.add_options()("help", "produce help message")(
25 "input_poses_path", boost::program_options::value<std::string>(),
26 "provide input poses path")("ref_timestamps_path",
27 boost::program_options::value<std::string>(),
28 "provide reference timestamp path")(
29 "extrinsic_path", boost::program_options::value<std::string>(),
30 "provide velodyne extrinsic path")(
31 "output_poses_path", boost::program_options::value<std::string>(),
32 "provide output poses path");
33
34 boost::program_options::variables_map boost_args;
35 boost::program_options::store(
36 boost::program_options::parse_command_line(argc, argv, boost_desc),
37 boost_args);
38 boost::program_options::notify(boost_args);
39
40 if (boost_args.count("help") || !boost_args.count("input_poses_path") ||
41 !boost_args.count("ref_timestamps_path") ||
42 !boost_args.count("extrinsic_path") ||
43 !boost_args.count("output_poses_path")) {
44 AERROR << boost_desc;
45 return 0;
46 }
47
48 std::string input_poses_path =
49 boost_args["input_poses_path"].as<std::string>();
50 std::string ref_timestamps_path =
51 boost_args["ref_timestamps_path"].as<std::string>();
52 std::string extrinsic_path = boost_args["extrinsic_path"].as<std::string>();
53 std::string out_poses_path =
54 boost_args["output_poses_path"].as<std::string>();
55
57 bool success = pose_interpolation.Init(input_poses_path, ref_timestamps_path,
58 out_poses_path, extrinsic_path);
59
60 if (success) {
61 pose_interpolation.DoInterpolation();
62 }
63
64 return 0;
65}
bool Init(const std::string &input_poses_path, const std::string &ref_timestamps_path, const std::string &out_poses_path, const std::string &extrinsic_path)
#define AERROR
Definition log.h:44
int main(int argc, char **argv)