Apollo 11.0
自动驾驶开放平台
proto_map_generator.cc 文件参考
#include "gflags/gflags.h"
#include "cyber/common/file.h"
#include "cyber/common/log.h"
#include "modules/map/hdmap/adapter/opendrive_adapter.h"
#include "modules/map/hdmap/hdmap_util.h"
#include "modules/common_msgs/map_msgs/map.pb.h"
proto_map_generator.cc 的引用(Include)关系图:

浏览源代码.

函数

 DEFINE_string (output_dir, "/tmp", "output map directory")
 A map tool to transform opendrive map to pb map
 
int main (int argc, char **argv)
 

函数说明

◆ DEFINE_string()

DEFINE_string ( output_dir  ,
"/tmp"  ,
"output map directory"   
)

A map tool to transform opendrive map to pb map

◆ main()

int main ( int  argc,
char **  argv 
)

在文件 proto_map_generator.cc 第 30 行定义.

30 {
31 google::InitGoogleLogging(argv[0]);
32 FLAGS_alsologtostderr = true;
33
34 google::ParseCommandLineFlags(&argc, &argv, true);
35
36 const auto map_filename = FLAGS_map_dir + "/base_map.xml";
37 apollo::hdmap::Map pb_map;
38 ACHECK(
40 << "fail to load data from : " << map_filename;
41
42 const std::string output_ascii_file = FLAGS_output_dir + "/base_map.txt";
43 ACHECK(apollo::cyber::common::SetProtoToASCIIFile(pb_map, output_ascii_file))
44 << "failed to output ASCII format base map";
45
46 const std::string output_bin_file = FLAGS_output_dir + "/base_map.bin";
48 << "failed to output binary format base map";
49
50 pb_map.Clear();
51 ACHECK(apollo::cyber::common::GetProtoFromFile(output_bin_file, &pb_map))
52 << "failed to load map";
53
54 AINFO << "load map success";
55
56 return 0;
57}
static bool LoadData(const std::string &filename, apollo::hdmap::Map *pb_map)
#define ACHECK(cond)
Definition log.h:80
#define AINFO
Definition log.h:42
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...
Definition file.cc:132
bool SetProtoToBinaryFile(const google::protobuf::Message &message, const std::string &file_name)
Sets the content of the file specified by the file_name to be the binary representation of the input ...
Definition file.cc:111
bool SetProtoToASCIIFile(const google::protobuf::Message &message, int file_descriptor)
Definition file.cc:43