46 ADEBUG <<
"Canbus_conf:" << racobit_radar_conf_.ShortDebugString();
47 racobit_radar_writer_ =
50 &racobit_radar_conf_)) {
55 ADEBUG <<
"Canbus_conf:" << racobit_radar_conf_.ShortDebugString();
57 auto can_factory = CanClientFactory::Instance();
58 can_factory->RegisterCanClients();
59 can_client_ = can_factory->CreateCANClient(
62 return OnError(
"Failed to create can client.").
ok();
64 AINFO <<
"Can client is successfully created.";
66 sensor_message_manager_ = std::unique_ptr<RacobitRadarMessageManager>(
68 if (sensor_message_manager_ ==
nullptr) {
69 return OnError(
"Failed to create message manager.").
ok();
71 sensor_message_manager_->set_radar_conf(racobit_radar_conf_.
radar_conf());
72 sensor_message_manager_->set_can_client(can_client_);
73 AINFO <<
"Sensor message manager is successfully created.";
75 if (can_receiver_.Init(
76 can_client_.get(), sensor_message_manager_.get(),
79 return OnError(
"Failed to init can receiver.").
ok();
81 AINFO <<
"The can receiver is successfully initialized.";
83 if (can_client_->Start() != ErrorCode::OK) {
84 return OnError(
"Failed to start can client").
ok();
87 AINFO <<
"Can client is started.";
88 if (ConfigureRadar() != ErrorCode::OK) {
89 return OnError(
"Failed to configure radar.").
ok();
91 AINFO <<
"The radar is successfully configured.";
93 if (can_receiver_.Start() != ErrorCode::OK) {
94 return OnError(
"Failed to start can receiver.").
ok();
96 AINFO <<
"Can receiver is started.";
97 monitor_logger_buffer_.INFO(
"Canbus is started.");
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,...