Apollo 10.0
自动驾驶开放平台
ultrasonic_radar_canbus.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/common/macros.h"
29
30#include "cyber/time/time.h"
38#include "modules/common_msgs/drivers_msgs/can_card_parameter.pb.h"
39#include "modules/drivers/canbus/proto/sensor_canbus_conf.pb.h"
41#include "modules/common_msgs/sensor_msgs/ultrasonic_radar.pb.h"
42#include "modules/drivers/radar/ultrasonic_radar/proto/ultrasonic_radar_conf.pb.h"
44
49namespace apollo {
50namespace drivers {
51namespace ultrasonic_radar {
52
69
71 public:
74
79 std::string Name() const;
80
86 const std::string& config_path,
87 const std::shared_ptr<::apollo::cyber::Writer<Ultrasonic>>& writer);
88
94
95 private:
96 Status OnError(const std::string& error_msg);
97 void RegisterCanClients();
98
99 UltrasonicRadarConf ultrasonic_radar_conf_;
100 std::shared_ptr<CanClient> can_client_;
101 CanReceiver<Ultrasonic> can_receiver_;
102 std::unique_ptr<UltrasonicRadarMessageManager> sensor_message_manager_;
103
104 int64_t last_timestamp_ = 0;
105 apollo::common::monitor::MonitorLogBuffer monitor_logger_buffer_;
106};
107
108} // namespace ultrasonic_radar
109} // namespace drivers
110} // 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
template of canbus-based sensor module main class (e.g., ultrasonic_radar).
apollo::common::Status Start()
module start function
apollo::common::Status Init(const std::string &config_path, const std::shared_ptr<::apollo::cyber::Writer< Ultrasonic > > &writer)
module initialization function
The class of MessageManager
The class of MonitorLogBuffer
class register implement
Definition arena_queue.h:37
The class of UltrasonicRadarMessageManager