25#include "modules/drivers/gnss/proto/config.pb.h"
40 std::ios::sync_with_stdio(
false);
41 std::ifstream
f(filename, std::ifstream::binary);
45 std::string msg(
reinterpret_cast<const char*
>(b),
f.gcount());
54 if (message.
channel_name ==
"/apollo/sensor/gnss/raw_data") {
56 msg.ParseFromString(message.
content);
59 std::this_thread::sleep_for(std::chrono::milliseconds(2));
63void Parse(
const char* filename,
const char* file_type,
64 const std::shared_ptr<::apollo::cyber::Node>& node) {
65 std::string type = std::string(file_type);
68 std::string(
"modules/drivers/gnss/conf/gnss_conf.pb.txt"),
70 std::cout <<
"Unable to load gnss conf file";
76 }
else if (type ==
"record") {
79 std::cout <<
"unknown file type";
88int main(
int argc,
char** argv) {
90 std::cout <<
"Usage: " << argv[0] <<
" filename [record|bin]" << std::endl;
94 std::shared_ptr<::apollo::cyber::Node> parser_node(
bool ReadMessage(RecordMessage *message, uint64_t begin_time=0, uint64_t end_time=std::numeric_limits< uint64_t >::max())
Read one message from reader.
void ParseRawData(const std::string &msg)
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,...
bool Init(const char *binary_name, const std::string &dag_info)
std::unique_ptr< Node > CreateNode(const std::string &node_name, const std::string &name_space)
constexpr size_t BUFFER_SIZE
void ParseRecord(const char *filename, DataParser *parser)
void Parse(const char *filename, const char *file_type, const std::shared_ptr<::apollo::cyber::Node > &node)
void ParseBin(const char *filename, DataParser *parser)
int main(int argc, char **argv)
Basic data struct of record message.
std::string content
The content of the message.
std::string channel_name
The channel name of the message.