28 config_ = std::make_shared<OculiiRadarConf>();
33 AINFO <<
"OculiiRadarComponent config: " << config_->DebugString();
35 if (!parser_->Init(config_->port())) {
36 AERROR <<
"Init parser of oculii radar failed";
40 frame_drop_interval_ =
static_cast<float>(0.9 / config_->frame_rate());
41 last_process_time_ = 0;
42 async_result_ = cyber::Async(&OculiiRadarComponent::run,
this);
46void OculiiRadarComponent::run() {
47 running_.exchange(
true);
52 auto output_time = process_time.
ToSecond();
54 pb_output.mutable_header()->set_frame_id(config_->frame_id());
55 common::util::FillHeader(
node_->Name(), &pb_output);
56 pb_output.set_frame_id(config_->frame_id());
57 pb_output.set_is_dense(
true);
58 pb_output.set_measurement_time(output_time);
60 if (parser_->Parse(pb_output) != 0) {
61 AERROR <<
"parse oculii udp packet failed";
64 writer_->Write(pb_output);
69 if (running_.load()) {
70 running_.exchange(
false);
std::shared_ptr< Node > node_
std::string config_file_path_
Cyber has builtin time type Time.
static Time Now()
get the current time.
double ToSecond() const
convert time to second.
bool Init() override
initialize OculiiRadarComponent
Some string util functions.
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,...