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

浏览源代码.

函数

 DEFINE_string (output_dir, "/tmp/", "output map directory")
 A map tool to generate a downsampled map to be displayed by dreamview frontend.
 
 DEFINE_double (angle_threshold, 1./180 *M_PI, "Points are sampled when the accumulated direction change " "exceeds the threshold")
 
 DEFINE_int32 (downsample_distance, 5, "downsample rate for a normal path")
 
 DEFINE_int32 (steep_turn_downsample_distance, 1, "downsample rate for a steep turn path")
 
int main (int32_t argc, char **argv)
 

函数说明

◆ DEFINE_double()

DEFINE_double ( angle_threshold  ,
1./180 *  M_PI,
"Points are sampled when the accumulated direction change " "exceeds the threshold"   
)

◆ DEFINE_int32() [1/2]

DEFINE_int32 ( downsample_distance  ,
5  ,
"downsample rate for a normal path"   
)

◆ DEFINE_int32() [2/2]

DEFINE_int32 ( steep_turn_downsample_distance  ,
1  ,
"downsample rate for a steep turn path"   
)

◆ DEFINE_string()

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

A map tool to generate a downsampled map to be displayed by dreamview frontend.

◆ main()

int main ( int32_t  argc,
char **  argv 
)

在文件 sim_map_generator.cc 第 107 行定义.

107 {
108 google::InitGoogleLogging(argv[0]);
109 FLAGS_alsologtostderr = true;
110 FLAGS_v = 3;
111
112 google::ParseCommandLineFlags(&argc, &argv, true);
113
114 Map map_pb;
115 const auto map_file = apollo::hdmap::BaseMapFile();
116 if (absl::EndsWith(map_file, ".xml")) {
117 ACHECK(OpendriveAdapter::LoadData(map_file, &map_pb));
118 } else {
119 ACHECK(GetProtoFromFile(map_file, &map_pb)) << "Fail to open: " << map_file;
120 }
121
122 DownsampleMap(&map_pb);
123 OutputMap(map_pb);
124 AINFO << "sim_map generated at:" << FLAGS_output_dir;
125
126 return 0;
127}
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
std::string BaseMapFile()
get base map file path from flags.
Definition hdmap_util.cc:47