Apollo 10.0
自动驾驶开放平台
traffic_light.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 <memory>
19#include <string>
20#include <vector>
21
23
24namespace apollo {
25namespace perception {
26namespace base {
27
28enum class TLColor {
30 TL_RED = 1,
31 TL_YELLOW = 2,
32 TL_GREEN = 3,
33 TL_BLACK = 4,
35};
36
43
44// @brief Light Region in the Image
46 // roi is marked by map & projection, it may be too large or not accuracy.
49 bool outside_image = false;
50
51 std::vector<Rect<int>> debug_roi;
52 std::vector<float> debug_roi_detect_scores;
53
55 bool is_detected = false;
56 bool is_selected = false;
58
59 // 3d polygon
60 std::vector<base::PointXYZID> points;
61
62 // output score by detection
63 float detect_score = 0.0f;
64};
65
66// @brief Light Status
68 // Traffic light color status.
70 // How confidence about the detected results, between 0 and 1.
71 double confidence = 0.0;
72 // Duration of the traffic light since detected.
73 double tracking_time = 0.0;
74 // blink status
75 bool blink = false;
76};
77
78// @brief A Traffic Light.
80 TrafficLight() = default;
81
82 std::string id;
83 int semantic = 0;
84 LightRegion region; // Light region.
85 LightStatus status; // Light Status.
86};
87
88typedef std::shared_ptr<TrafficLight> TrafficLightPtr;
89typedef std::vector<TrafficLightPtr> TrafficLightPtrs;
90
91} // namespace base
92} // namespace perception
93} // namespace apollo
std::shared_ptr< TrafficLight > TrafficLightPtr
std::vector< TrafficLightPtr > TrafficLightPtrs
class register implement
Definition arena_queue.h:37
std::vector< Rect< int > > debug_roi
std::vector< base::PointXYZID > points
std::vector< float > debug_roi_detect_scores