Apollo  6.0
Open source self driving car software
lane_object.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2019 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 
17 #pragma once
18 
19 #include <limits>
20 #include <vector>
21 
22 #include "Eigen/Eigen"
23 
24 namespace apollo {
25 namespace perception {
26 
27 constexpr float kMaxFloat = std::numeric_limits<float>::max();
28 constexpr float kLowestFloat = -std::numeric_limits<float>::max();
29 constexpr float kMinAngle = kLowestFloat / 180.0f;
30 constexpr float kFloatEpsilon = 0.000001f; // should be changed
31 
32 constexpr float k45DegreeInRadian = static_cast<float>(45.0f * M_PI) / 180.0f;
33 
34 // required number of points for lane line to determine the CIPV
35 constexpr uint32_t kMinLaneLineLengthForCIPV = 2;
36 // Average width of lane
37 constexpr float kAverageLaneWidthInMeter = 3.7f;
38 // Maximum vehicle width
39 constexpr float kMaxVehicleWidthInMeter = 1.87f;
40 // Margin from a virtual car lane to actual lane
41 constexpr float kMarginVehicleToLane =
42  (kAverageLaneWidthInMeter - kMaxVehicleWidthInMeter) / 2.0f;
43 // The width of virtual egolane when there is only one lane line
45  kMaxVehicleWidthInMeter + kMarginVehicleToLane; // 3.1f
46 
47 // The width of virtual egolane when there is only one lane line
48 constexpr float kHalfVehicleWidthInMeter = kMaxVehicleWidthInMeter / 2.0f;
49 
50 typedef Eigen::Vector2i Point2Di;
53 
54 // This should be from lane detector
56  LaneLineSimple() { line_point.reserve(100); }
57  int type; // solid, broken, double, zigzag, boundary, implicit
58  int color; // yellow, white
59  // eastl::fixed_vector<Point2Df, MAX_LANE_LINE_POINT> line_point;
60  std::vector<Point2Df> line_point;
61 };
62 
63 // Line segment by two points
65  Point2Df start_point;
66  Point2Df end_point;
67 };
68 
70  Point2Df vanishing_point;
72 };
73 
74 // two lane lines used for camera calibration
75 struct EgoLane {
78 };
79 
80 } // namespace perception
81 } // namespace apollo
constexpr float kMinAngle
Definition: lane_object.h:29
Definition: lane_object.h:75
constexpr float kHalfVehicleWidthInMeter
Definition: lane_object.h:48
LaneLineSimple right_line
Definition: lane_object.h:77
Definition: lane_object.h:69
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Eigen::Vector2d Vector2d
Definition: base_map_fwd.h:36
constexpr float kLowestFloat
Definition: lane_object.h:28
int type
Definition: lane_object.h:57
constexpr uint32_t kMinLaneLineLengthForCIPV
Definition: lane_object.h:35
constexpr float kSingleVirtualEgolaneWidthInMeter
Definition: lane_object.h:44
Eigen::Vector2f Point2Df
Definition: lane_object.h:51
LaneLineSimple left_line
Definition: lane_object.h:76
int color
Definition: lane_object.h:58
std::vector< Point2Df > line_point
Definition: lane_object.h:60
Point2Df vanishing_point
Definition: lane_object.h:70
constexpr float kMaxFloat
Definition: lane_object.h:27
constexpr float kFloatEpsilon
Definition: lane_object.h:30
float distance_traveled
Definition: lane_object.h:71
Point2Df end_point
Definition: lane_object.h:66
constexpr float kAverageLaneWidthInMeter
Definition: lane_object.h:37
LaneLineSimple()
Definition: lane_object.h:56
Eigen::Vector2f Vector2f
Definition: base_map_fwd.h:30
Definition: lane_object.h:64
Definition: lane_object.h:55
Eigen::Vector2d Point2Dd
Definition: lane_object.h:52
Point2Df start_point
Definition: lane_object.h:65
Eigen::Vector2i Point2Di
Definition: lane_object.h:50
constexpr float kMaxVehicleWidthInMeter
Definition: lane_object.h:39
constexpr float kMarginVehicleToLane
Definition: lane_object.h:41
constexpr float k45DegreeInRadian
Definition: lane_object.h:32