Apollo 11.0
自动驾驶开放平台
msg_exporter_main.cc 文件参考
#include <fstream>
#include <memory>
#include "absl/strings/str_split.h"
#include "cyber/common/log.h"
#include "cyber/cyber.h"
#include "modules/perception/tools/exporter/msg_exporter.h"
msg_exporter_main.cc 的引用(Include)关系图:

浏览源代码.

命名空间

namespace  apollo
 class register implement
 
namespace  apollo::perception
 apollo::perception
 
namespace  apollo::perception::msg
 

函数

bool apollo::perception::msg::config_parser (const std::string &config_file, std::vector< std::string > *channels, std::vector< std::string > *child_frame_ids)
 
int main (int argc, char **argv)
 

函数说明

◆ main()

int main ( int  argc,
char **  argv 
)

在文件 msg_exporter_main.cc 第 68 行定义.

68 {
69 if (argc < 2) {
70 std::cout << "export_msgs config_file" << std::endl;
71 return -1;
72 }
73 // apollo::cyber::Logger::Init(argv[0]);
74 apollo::cyber::Init(argv[0]); // cybertron init function
75 std::shared_ptr<apollo::cyber::Node> node(
76 apollo::cyber::CreateNode("export_node"));
77 if (!node) {
78 std::cout << "Failed to create export node." << std::endl;
79 return -1;
80 }
81 std::vector<std::string> channels;
82 std::vector<std::string> child_frame_ids;
83 std::cout << "start to load config file: " << argv[1] << std::endl;
84 if (!apollo::perception::msg::config_parser(argv[1], &channels,
85 &child_frame_ids)) {
86 std::cout << "Failed to read config file" << std::endl;
87 return -1;
88 }
89 apollo::perception::msg::MsgExporter msg_exporter(node, channels,
90 child_frame_ids);
91 while (apollo::cyber::OK()) {
92 sleep(1);
93 }
94 return 0;
95}
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
bool config_parser(const std::string &config_file, std::vector< std::string > *channels, std::vector< std::string > *child_frame_ids)