Apollo  6.0
Open source self driving car software
conti_radar_canbus_component.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2017 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 
35 #include "modules/drivers/canbus/proto/can_card_parameter.pb.h"
36 #include "modules/drivers/proto/conti_radar.pb.h"
41 #include "modules/localization/proto/localization.pb.h"
42 
47 namespace apollo {
48 namespace drivers {
49 namespace conti_radar {
50 
58  public:
61  bool Init() override;
62 
63  private:
64  bool OnError(const std::string& error_msg);
65  void RegisterCanClients();
66  apollo::common::ErrorCode ConfigureRadar();
67  bool Start();
68  void Stop();
69 
70  ContiRadarConf conti_radar_conf_;
71  std::shared_ptr<apollo::drivers::canbus::CanClient> can_client_;
73  std::unique_ptr<ContiRadarMessageManager> sensor_message_manager_;
74  std::shared_ptr<apollo::cyber::Writer<ContiRadar>> conti_radar_writer_;
75  std::shared_ptr<
77  pose_reader_;
78  void PoseCallback(
79  const std::shared_ptr<apollo::localization::LocalizationEstimate>& pose);
80  uint64_t last_nsec_ = 0;
81 
82  int64_t last_timestamp_ = 0;
83  bool start_success_ = false;
84  apollo::common::monitor::MonitorLogBuffer monitor_logger_buffer_;
85 };
86 
88 
89 } // namespace conti_radar
90 } // namespace drivers
91 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Defines the CanFrame struct and CanClient interface.
The class of MessageManager.
The class of ContiRadarMessageManager.
Reader subscribes a channel, it has two main functions:
Definition: reader.h:68
Defines CanReceiver class.
The class of MonitorLogBuffer.
#define CYBER_REGISTER_COMPONENT(name)
Definition: component.h:551
This class help collect MonitorMessage pb to monitor topic. The messages can be published automatical...
Definition: monitor_log_buffer.h:60
Some util functions.
Definition: conti_radar_canbus_component.h:57
The Component can process up to four channels of messages. The message type is specified when the com...
Definition: component.h:58