Apollo  6.0
Open source self driving car software
base_tl_preprocessor.h
Go to the documentation of this file.
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 #pragma once
17 
18 #include <map>
19 #include <string>
20 #include <vector>
21 
22 #include "cyber/common/macros.h"
27 
28 namespace apollo {
29 namespace perception {
30 namespace camera {
31 
33  int gpu_id = 0;
35  std::vector<std::string> camera_names;
36 };
37 
39  std::map<std::string, int>* image_borders_size = nullptr;
40 };
41 
43  public:
44  BaseTLPreprocessor() = default;
45  virtual ~BaseTLPreprocessor() = default;
46 
47  virtual bool Init(const TrafficLightPreprocessorInitOptions& options) = 0;
48 
49  virtual std::string Name() const = 0;
50 
51  virtual bool UpdateCameraSelection(const CarPose& pose,
52  const TLPreprocessorOption& option,
53  std::vector<base::TrafficLightPtr>* lights) = 0;
54 
55  virtual bool SyncInformation(const double ts,
56  const std::string& camera_name) = 0;
57 
58  virtual bool UpdateLightsProjection(const CarPose& pose,
59  const TLPreprocessorOption& option,
60  const std::string& camera_name,
61  std::vector<base::TrafficLightPtr>* lights) = 0;
62 
63  virtual bool SetCameraWorkingFlag(const std::string& camera_name,
64  bool is_working) = 0;
65 
66  virtual bool GetCameraWorkingFlag(const std::string& camera_name,
67  bool* is_working) const = 0;
68 
69  virtual const std::vector<std::string>&
70  GetCameraNamesByDescendingFocalLen() const = 0;
71 
72  private:
74 };
75 
77 #define PERCEPTION_REGISTER_TLPREPROCESSOR(name) \
78  PERCEPTION_REGISTER_CLASS(BaseTLPreprocessor, name)
79 
80 } // namespace camera
81 } // namespace perception
82 } // namespace apollo
PERCEPTION_REGISTER_REGISTERER(BaseCalibrationService)
Definition: base_init_options.h:24
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: base_tl_preprocessor.h:42
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition: macros.h:48
float sync_interval_seconds
Definition: base_tl_preprocessor.h:34
Definition: base_tl_preprocessor.h:38
bool Init(const char *binary_name)
std::vector< std::string > camera_names
Definition: base_tl_preprocessor.h:35