Apollo  6.0
Open source self driving car software
recognition_component.h
Go to the documentation of this file.
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 #pragma once
17 
18 #include <memory>
19 #include <string>
20 
21 #include "cyber/cyber.h"
22 
27 #include "modules/perception/onboard/proto/lidar_component_config.pb.h"
28 
29 namespace apollo {
30 namespace perception {
31 namespace onboard {
32 
33 class RecognitionComponent : public cyber::Component<LidarFrameMessage> {
34  public:
35  RecognitionComponent() : tracker_(nullptr) {}
36  ~RecognitionComponent() = default;
37 
38  bool Init() override;
39  bool Proc(const std::shared_ptr<LidarFrameMessage>& message) override;
40 
41  private:
42  bool InitAlgorithmPlugin();
43  bool InternalProc(const std::shared_ptr<const LidarFrameMessage>& in_message,
44  const std::shared_ptr<SensorFrameMessage>& out_message);
45  std::unique_ptr<lidar::LidarObstacleTracking> tracker_;
46  base::SensorInfo sensor_info_;
47  std::string main_sensor_name_;
48  std::string output_channel_name_;
49  std::shared_ptr<apollo::cyber::Writer<SensorFrameMessage>> writer_;
50 };
51 
53 
54 } // namespace onboard
55 } // namespace perception
56 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
bool Proc(const std::shared_ptr< LidarFrameMessage > &message) override
RecognitionComponent()
Definition: recognition_component.h:35
Definition: sensor_meta.h:57
The Component can process up to four channels of messages. The message type is specified when the com...
Definition: component.h:58
CYBER_REGISTER_COMPONENT(CameraObstacleDetectionComponent)
Definition: recognition_component.h:33