Apollo 10.0
自动驾驶开放平台
nano_radar_canbus_component.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2021 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 "modules/common_msgs/drivers_msgs/can_card_parameter.pb.h"
29#include "modules/common_msgs/sensor_msgs/nano_radar.pb.h"
30
31#include "cyber/cyber.h"
40
45namespace apollo {
46namespace drivers {
47namespace nano_radar {
48
56 public:
59 bool Init() override;
60
61 private:
62 bool OnError(const std::string& error_msg);
63 void RegisterCanClients();
64 apollo::common::ErrorCode ConfigureRadar();
65 apollo::common::ErrorCode ConfigureRadarRegion();
66 bool Start();
67 void Stop();
68
69 NanoRadarConf nano_radar_conf_;
70 std::shared_ptr<apollo::drivers::canbus::CanClient> can_client_;
72 std::unique_ptr<NanoRadarMessageManager> sensor_message_manager_;
73 std::shared_ptr<apollo::cyber::Writer<NanoRadar>> nano_radar_writer_;
74
75 bool start_success_ = false;
76 apollo::common::monitor::MonitorLogBuffer monitor_logger_buffer_;
77};
78
80
81} // namespace nano_radar
82} // namespace drivers
83} // namespace apollo
Defines the CanFrame struct and CanClient interface.
Defines CanReceiver class.
#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 NanoRadarMessageManager