Apollo 11.0
自动驾驶开放平台
semantic_decision.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#pragma once
17
18#include <string>
19#include <vector>
20
21#include "modules/perception/traffic_light_tracking/tracker/proto/semantic.pb.h"
22
23#include "cyber/common/macros.h"
26
27namespace apollo {
28namespace perception {
29namespace trafficlight {
30
35
37 double time_stamp = 0.0;
40 bool blink = false;
41 std::string semantic;
42 std::vector<int> light_ids;
45};
46
48 public:
58 ~SemanticReviser() = default;
66 bool Init(const TrafficLightTrackerInitOptions &options =
68
76 bool Track(camera::TrafficLightFrame *frame) override;
85 std::vector<base::TrafficLightPtr> *lights);
93 void ReviseByTimeSeries(double time_stamp, SemanticTable semantic_table,
94 std::vector<base::TrafficLightPtr> *lights);
103 std::vector<base::TrafficLightPtr> *lights,
104 std::vector<SemanticTable>::iterator *history);
112 void ReviseLights(std::vector<base::TrafficLightPtr> *lights,
113 const std::vector<int> &light_ids, base::TLColor dst_color);
114
115 private:
116 SemanticReviserConfig semantic_param_;
117
118 float revise_time_s_;
119 float blink_threshold_s_;
120 float non_blink_threshold_s_;
121 int hysteretic_threshold_;
122 std::vector<SemanticTable> history_semantic_;
123
125};
126
127} // namespace trafficlight
128} // namespace perception
129} // namespace apollo
~SemanticReviser()=default
Destroy the semantic reviser object.
bool Init(const TrafficLightTrackerInitOptions &options=TrafficLightTrackerInitOptions()) override
Initialize semantic reviser parameters.
void ReviseLights(std::vector< base::TrafficLightPtr > *lights, const std::vector< int > &light_ids, base::TLColor dst_color)
Revise and tracking traffic light.
void ReviseByTimeSeries(double time_stamp, SemanticTable semantic_table, std::vector< base::TrafficLightPtr > *lights)
Correction based on timeseries information.
void UpdateHistoryAndLights(const SemanticTable &cur, std::vector< base::TrafficLightPtr > *lights, std::vector< SemanticTable >::iterator *history)
Update the traffic light history information.
bool Track(camera::TrafficLightFrame *frame) override
Track detected traffic_light.
SemanticReviser()
Construct a new semantic reviser object.
base::TLColor ReviseBySemantic(SemanticTable semantic_table, std::vector< base::TrafficLightPtr > *lights)
Correction based on semantic information.
#define DISALLOW_COPY_AND_ASSIGN(classname)
Definition macros.h:48
class register implement
Definition arena_queue.h:37