Apollo 11.0
自动驾驶开放平台
navigation_dummy.cc 文件参考
#include "gflags/gflags.h"
#include "cyber/common/file.h"
#include "cyber/common/log.h"
#include "cyber/cyber.h"
#include "cyber/time/rate.h"
#include "modules/common/adapters/adapter_gflags.h"
#include "modules/common/util/message_util.h"
#include "modules/common_msgs/planning_msgs/navigation.pb.h"
navigation_dummy.cc 的引用(Include)关系图:

浏览源代码.

函数

 DEFINE_string (navigation_dummy_file, "modules/map/testdata/navigation_dummy/navigation_info.pb.txt", "Used for sending navigation result to relative_map node.")
 
int main (int argc, char **argv)
 

函数说明

◆ DEFINE_string()

DEFINE_string ( navigation_dummy_file  ,
"modules/map/testdata/navigation_dummy/navigation_info.pb.txt"  ,
"Used for sending navigation result to relative_map node."   
)

◆ main()

int main ( int  argc,
char **  argv 
)

在文件 navigation_dummy.cc 第 33 行定义.

33 {
34 google::ParseCommandLineFlags(&argc, &argv, true);
35 // Init the cyber framework
36 apollo::cyber::Init(argv[0]);
37 FLAGS_alsologtostderr = true;
38
40 if (!apollo::cyber::common::GetProtoFromFile(FLAGS_navigation_dummy_file,
41 &navigation_info)) {
42 AERROR << "failed to load file: " << FLAGS_navigation_dummy_file;
43 return -1;
44 }
45
46 std::shared_ptr<apollo::cyber::Node> node(
47 apollo::cyber::CreateNode("navigation_info"));
48 auto writer = node->CreateWriter<apollo::relative_map::NavigationInfo>(
49 FLAGS_navigation_topic);
50 Rate rate(0.3);
51
52 while (apollo::cyber::OK()) {
53 apollo::common::util::FillHeader(node->Name(), &navigation_info);
54 writer->Write(navigation_info);
55 ADEBUG << "Sending navigation info:" << navigation_info.DebugString();
56 rate.Sleep();
57 }
58
59 return 0;
60}
#define ADEBUG
Definition log.h:41
#define AERROR
Definition log.h:44
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 Init(const char *binary_name, const std::string &dag_info)
Definition init.cc:99
bool OK()
Definition state.h:44
std::unique_ptr< Node > CreateNode(const std::string &node_name, const std::string &name_space)
Definition cyber.cc:33