Apollo 10.0
自动驾驶开放平台
racobit_radar_canbus_component.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
21#pragma once
22
23#include <memory>
24#include <string>
25#include <utility>
26#include <vector>
27
28#include "cyber/cyber.h"
29
30#include "cyber/time/time.h"
39#include "modules/common_msgs/drivers_msgs/can_card_parameter.pb.h"
40#include "modules/drivers/canbus/proto/sensor_canbus_conf.pb.h"
42#include "modules/common_msgs/sensor_msgs/racobit_radar.pb.h"
45
50namespace apollo {
51namespace drivers {
52namespace racobit_radar {
53
70
72 public:
73 // TODO(lizh): check whether we need a new msg item, say
74 // MonitorMessageItem::SENSORCANBUS
77
82 bool Init() override;
83
84 private:
85 void RegisterCanClients();
86 apollo::common::ErrorCode ConfigureRadar();
87 Status OnError(const std::string &error_msg);
88 std::shared_ptr<CanClient> can_client_;
89 CanReceiver<RacobitRadar> can_receiver_;
90 std::unique_ptr<RacobitRadarMessageManager> sensor_message_manager_;
91
92 int64_t last_timestamp_ = 0;
93 apollo::common::monitor::MonitorLogBuffer monitor_logger_buffer_;
94 bool start_success_ = false;
95 // cyber
96 RacobitRadarConf racobit_radar_conf_;
97 std::shared_ptr<cyber::Writer<RacobitRadar>> racobit_radar_writer_;
98};
99
101
102} // namespace racobit_radar
103} // namespace drivers
104} // namespace apollo
Defines the CanFrame struct and CanClient interface.
Defines the CanClientFactory class.
Defines CanReceiver class.
Defines SenderMessage class and CanSender class.
A general class to denote the return status of an API call.
Definition status.h:43
Cyber has builtin time type Time.
Definition time.h:31
CanClientFactory inherites apollo::common::util::Factory.
The class which defines the CAN client to send and receive message.
Definition can_client.h:92
This class defines the message to send.
Definition can_sender.h:56
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:656
The class of MessageManager
Some util functions.
The class of MonitorLogBuffer
class register implement
Definition arena_queue.h:37
The class of RacobitRadarMessageManager