Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
4012f34f
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4012f34f
编写于
12月 25, 2017
作者:
D
Dong Li
提交者:
Jiangtao Hu
12月 25, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: extend reference line to dotted white lane boundary
上级
0d018319
变更
25
展开全部
隐藏空白更改
内联
并排
Showing
25 changed file
with
11741 addition
and
11600 deletion
+11741
-11600
modules/map/hdmap/hdmap_common.h
modules/map/hdmap/hdmap_common.h
+5
-4
modules/map/pnc_map/BUILD
modules/map/pnc_map/BUILD
+1
-0
modules/map/pnc_map/path.cc
modules/map/pnc_map/path.cc
+89
-0
modules/map/pnc_map/path.h
modules/map/pnc_map/path.h
+23
-0
modules/planning/common/planning_gflags.cc
modules/planning/common/planning_gflags.cc
+3
-0
modules/planning/common/planning_gflags.h
modules/planning/common/planning_gflags.h
+1
-0
modules/planning/reference_line/reference_line_provider.cc
modules/planning/reference_line/reference_line_provider.cc
+62
-15
modules/planning/reference_line/reference_line_provider.h
modules/planning/reference_line/reference_line_provider.h
+3
-0
modules/planning/testdata/garage_test/result_follow_0.pb.txt
modules/planning/testdata/garage_test/result_follow_0.pb.txt
+738
-738
modules/planning/testdata/garage_test/result_out_of_map_0.pb.txt
.../planning/testdata/garage_test/result_out_of_map_0.pb.txt
+853
-852
modules/planning/testdata/garage_test/result_stop_dest_0.pb.txt
...s/planning/testdata/garage_test/result_stop_dest_0.pb.txt
+853
-852
modules/planning/testdata/garage_test/result_stop_obstacle_0.pb.txt
...anning/testdata/garage_test/result_stop_obstacle_0.pb.txt
+851
-852
modules/planning/testdata/garage_test/result_stop_over_line_0.pb.txt
...nning/testdata/garage_test/result_stop_over_line_0.pb.txt
+219
-219
modules/planning/testdata/sunnyvale_loop_test/result_avoid_change_left_0.pb.txt
...ata/sunnyvale_loop_test/result_avoid_change_left_0.pb.txt
+439
-439
modules/planning/testdata/sunnyvale_loop_test/result_change_lane_0.pb.txt
.../testdata/sunnyvale_loop_test/result_change_lane_0.pb.txt
+483
-483
modules/planning/testdata/sunnyvale_loop_test/result_cruise_0.pb.txt
...nning/testdata/sunnyvale_loop_test/result_cruise_0.pb.txt
+593
-593
modules/planning/testdata/sunnyvale_loop_test/result_follow_01_0.pb.txt
...ng/testdata/sunnyvale_loop_test/result_follow_01_0.pb.txt
+848
-848
modules/planning/testdata/sunnyvale_loop_test/result_follow_02_0.pb.txt
...ng/testdata/sunnyvale_loop_test/result_follow_02_0.pb.txt
+359
-359
modules/planning/testdata/sunnyvale_loop_test/result_follow_03_0.pb.txt
...ng/testdata/sunnyvale_loop_test/result_follow_03_0.pb.txt
+854
-854
modules/planning/testdata/sunnyvale_loop_test/result_mission_complete_0.pb.txt
...data/sunnyvale_loop_test/result_mission_complete_0.pb.txt
+851
-851
modules/planning/testdata/sunnyvale_loop_test/result_qp_path_failure_0.pb.txt
...tdata/sunnyvale_loop_test/result_qp_path_failure_0.pb.txt
+733
-733
modules/planning/testdata/sunnyvale_loop_test/result_rightturn_01_0.pb.txt
...testdata/sunnyvale_loop_test/result_rightturn_01_0.pb.txt
+821
-835
modules/planning/testdata/sunnyvale_loop_test/result_rightturn_with_red_light_0.pb.txt
...nyvale_loop_test/result_rightturn_with_red_light_0.pb.txt
+835
-849
modules/planning/testdata/sunnyvale_loop_test/result_slowdown_01_0.pb.txt
.../testdata/sunnyvale_loop_test/result_slowdown_01_0.pb.txt
+852
-852
modules/planning/testdata/sunnyvale_loop_test/result_stop_0.pb.txt
...lanning/testdata/sunnyvale_loop_test/result_stop_0.pb.txt
+372
-372
未找到文件。
modules/map/hdmap/hdmap_common.h
浏览文件 @
4012f34f
...
...
@@ -26,6 +26,7 @@ limitations under the License.
#include "modules/common/math/math_utils.h"
#include "modules/common/math/polygon2d.h"
#include "modules/common/math/vec2d.h"
#include "modules/map/proto/map_clear_area.pb.h"
#include "modules/map/proto/map_crosswalk.pb.h"
#include "modules/map/proto/map_id.pb.h"
#include "modules/map/proto/map_junction.pb.h"
...
...
@@ -33,10 +34,9 @@ limitations under the License.
#include "modules/map/proto/map_overlap.pb.h"
#include "modules/map/proto/map_road.pb.h"
#include "modules/map/proto/map_signal.pb.h"
#include "modules/map/proto/map_speed_bump.pb.h"
#include "modules/map/proto/map_stop_sign.pb.h"
#include "modules/map/proto/map_yield_sign.pb.h"
#include "modules/map/proto/map_clear_area.pb.h"
#include "modules/map/proto/map_speed_bump.pb.h"
/**
* @namespace apollo::hdmap
...
...
@@ -162,8 +162,8 @@ class LaneInfo {
void
Init
();
void
PostProcess
(
const
HDMapImpl
&
map_instance
);
void
UpdateOverlaps
(
const
HDMapImpl
&
map_instance
);
double
GetWidthFromSample
(
const
std
::
vector
<
LaneInfo
::
SampledWidth
>
&
samples
,
const
double
s
)
const
;
double
GetWidthFromSample
(
const
std
::
vector
<
LaneInfo
::
SampledWidth
>
&
samples
,
const
double
s
)
const
;
void
CreateKDTree
();
void
set_road_id
(
const
Id
&
road_id
)
{
road_id_
=
road_id
;
}
void
set_section_id
(
const
Id
&
section_id
)
{
section_id_
=
section_id
;
}
...
...
@@ -332,6 +332,7 @@ class SpeedBumpInfo {
const
std
::
vector
<
apollo
::
common
::
math
::
LineSegment2d
>
&
segments
()
const
{
return
segments_
;
}
private:
void
Init
();
...
...
modules/map/pnc_map/BUILD
浏览文件 @
4012f34f
...
...
@@ -13,6 +13,7 @@ cc_library(
deps
=
[
"//modules/common/math"
,
"//modules/map/hdmap"
,
"//modules/map/hdmap:hdmap_util"
,
"//modules/map/proto:map_proto"
,
"//modules/routing/proto:routing_proto"
,
],
...
...
modules/map/pnc_map/path.cc
浏览文件 @
4012f34f
...
...
@@ -64,6 +64,95 @@ std::string LaneWaypoint::DebugString() const {
return
common
::
util
::
StrCat
(
"id = "
,
lane
->
id
().
id
(),
" s = "
,
s
);
}
LaneBoundaryType
::
Type
LeftBoundaryType
(
const
LaneWaypoint
&
waypoint
)
{
if
(
!
waypoint
.
lane
)
{
return
LaneBoundaryType
::
UNKNOWN
;
}
for
(
const
auto
&
type
:
waypoint
.
lane
->
lane
().
left_boundary
().
boundary_type
())
{
if
(
type
.
s
()
<=
waypoint
.
s
)
{
if
(
type
.
types_size
()
>
0
)
{
return
type
.
types
(
0
);
}
else
{
return
LaneBoundaryType
::
UNKNOWN
;
}
}
}
return
LaneBoundaryType
::
UNKNOWN
;
}
LaneBoundaryType
::
Type
RightBoundaryType
(
const
LaneWaypoint
&
waypoint
)
{
if
(
!
waypoint
.
lane
)
{
return
LaneBoundaryType
::
UNKNOWN
;
}
for
(
const
auto
&
type
:
waypoint
.
lane
->
lane
().
right_boundary
().
boundary_type
())
{
if
(
type
.
s
()
<=
waypoint
.
s
)
{
if
(
type
.
types_size
()
>
0
)
{
return
type
.
types
(
0
);
}
else
{
return
LaneBoundaryType
::
UNKNOWN
;
}
}
}
return
LaneBoundaryType
::
UNKNOWN
;
}
LaneWaypoint
LeftNeighborWaypoint
(
const
LaneWaypoint
&
waypoint
)
{
LaneWaypoint
neighbor
;
if
(
!
waypoint
.
lane
)
{
return
neighbor
;
}
auto
point
=
waypoint
.
lane
->
GetSmoothPoint
(
waypoint
.
s
);
auto
map_ptr
=
HDMapUtil
::
BaseMapPtr
();
for
(
const
auto
&
lane_id
:
waypoint
.
lane
->
lane
().
left_neighbor_forward_lane_id
())
{
auto
lane
=
map_ptr
->
GetLaneById
(
lane_id
);
if
(
!
lane
)
{
return
neighbor
;
}
double
s
=
0.0
;
double
l
=
0.0
;
if
(
!
lane
->
GetProjection
({
point
.
x
(),
point
.
y
()},
&
s
,
&
l
))
{
continue
;
}
if
(
s
<
-
kSampleDistance
||
s
>
lane
->
total_length
()
+
kSampleDistance
)
{
continue
;
}
else
{
return
LaneWaypoint
(
lane
,
s
);
}
}
return
neighbor
;
}
LaneWaypoint
RightNeighborWaypoint
(
const
LaneWaypoint
&
waypoint
)
{
LaneWaypoint
neighbor
;
if
(
!
waypoint
.
lane
)
{
return
neighbor
;
}
auto
point
=
waypoint
.
lane
->
GetSmoothPoint
(
waypoint
.
s
);
auto
map_ptr
=
HDMapUtil
::
BaseMapPtr
();
for
(
const
auto
&
lane_id
:
waypoint
.
lane
->
lane
().
right_neighbor_forward_lane_id
())
{
auto
lane
=
map_ptr
->
GetLaneById
(
lane_id
);
if
(
!
lane
)
{
return
neighbor
;
}
double
s
=
0.0
;
double
l
=
0.0
;
if
(
!
lane
->
GetProjection
({
point
.
x
(),
point
.
y
()},
&
s
,
&
l
))
{
continue
;
}
if
(
s
<
-
kSampleDistance
||
s
>
lane
->
total_length
()
+
kSampleDistance
)
{
continue
;
}
else
{
return
LaneWaypoint
(
lane
,
s
);
}
}
return
neighbor
;
}
std
::
string
LaneSegment
::
DebugString
()
const
{
if
(
lane
==
nullptr
)
{
return
"(lane is null)"
;
...
...
modules/map/pnc_map/path.h
浏览文件 @
4012f34f
...
...
@@ -33,6 +33,7 @@
#include "modules/common/math/vec2d.h"
#include "modules/map/hdmap/hdmap.h"
#include "modules/map/hdmap/hdmap_common.h"
#include "modules/map/hdmap/hdmap_util.h"
namespace
apollo
{
namespace
hdmap
{
...
...
@@ -53,6 +54,28 @@ struct LaneWaypoint {
std
::
string
DebugString
()
const
;
};
/**
* @brief get left boundary type at a waypoint.
*/
LaneBoundaryType
::
Type
LeftBoundaryType
(
const
LaneWaypoint
&
waypoint
);
/**
* @brief get left boundary type at a waypoint.
*/
LaneBoundaryType
::
Type
RightBoundaryType
(
const
LaneWaypoint
&
waypoint
);
/**
* @brief get left neighbor lane waypoint. If not exist, the Waypoint.lane will
* be null.
*/
LaneWaypoint
LeftNeighborWaypoint
(
const
LaneWaypoint
&
waypoint
);
/**
* @brief get left neighbor lane waypoint. If not exist, the Waypoint.lane will
* be null.
*/
LaneWaypoint
RightNeighborWaypoint
(
const
LaneWaypoint
&
waypoint
);
struct
LaneSegment
{
LaneSegment
()
=
default
;
LaneSegment
(
LaneInfoConstPtr
lane
,
const
double
start_s
,
const
double
end_s
)
...
...
modules/planning/common/planning_gflags.cc
浏览文件 @
4012f34f
...
...
@@ -61,6 +61,9 @@ DEFINE_double(reference_line_stitch_overlap_distance, 20,
DEFINE_double
(
reference_line_lateral_buffer
,
0.5
,
"When creating reference line, the minimum distance with road "
"curb for a vehicle driving on this line."
);
DEFINE_double
(
reference_line_lateral_extension
,
0.5
,
"When creating reference line, the minimum distance with road "
"curb for a vehicle driving on this line."
);
DEFINE_double
(
prepare_rerouting_time
,
2.0
,
"If there are this amount of seconds left to finish driving on "
"current route, and there is no routing, do rerouting"
);
...
...
modules/planning/common/planning_gflags.h
浏览文件 @
4012f34f
...
...
@@ -35,6 +35,7 @@ DECLARE_bool(enable_reference_line_stitching);
DECLARE_double
(
look_forward_extend_distance
);
DECLARE_double
(
reference_line_stitch_overlap_distance
);
DECLARE_double
(
reference_line_lateral_buffer
);
DECLARE_double
(
reference_line_lateral_extension
);
DECLARE_double
(
prepare_rerouting_time
);
DECLARE_double
(
rerouting_cooldown_time
);
...
...
modules/planning/reference_line/reference_line_provider.cc
浏览文件 @
4012f34f
...
...
@@ -499,12 +499,71 @@ bool ReferenceLineProvider::IsReferenceLineSmoothValid(
return
true
;
}
AnchorPoint
ReferenceLineProvider
::
GetAnchorPoint
(
const
ReferenceLine
&
reference_line
,
double
s
)
const
{
AnchorPoint
anchor
;
anchor
.
longitudinal_bound
=
smoother_config_
.
longitudinal_boundary_bound
();
const
auto
half_width
=
VehicleConfigHelper
::
GetConfig
().
vehicle_param
().
width
()
/
2.0
;
auto
ref_point
=
reference_line
.
GetReferencePoint
(
s
);
if
(
FLAGS_reference_line_lateral_extension
>
1e-6
&&
ref_point
.
lane_waypoints
().
empty
())
{
double
left_width
=
0.0
;
double
right_width
=
0.0
;
reference_line
.
GetLaneWidth
(
s
,
&
left_width
,
&
right_width
);
auto
shift
=
(
left_width
-
right_width
)
/
2.0
*
Vec2d
::
CreateUnitVec2d
(
ref_point
.
heading
()
+
M_PI
/
2.0
);
ref_point
+=
shift
;
anchor
.
path_point
=
ref_point
.
ToPathPoint
(
s
);
double
effective_width
=
(
left_width
+
right_width
)
/
2.0
;
anchor
.
lateral_bound
=
std
::
max
(
smoother_config_
.
lateral_boundary_bound
(),
effective_width
-
half_width
-
FLAGS_reference_line_lateral_buffer
);
}
else
{
const
auto
&
waypoint
=
ref_point
.
lane_waypoints
().
front
();
auto
left_boundary_type
=
LeftBoundaryType
(
waypoint
);
double
left_extend
=
0.0
;
if
(
left_boundary_type
==
hdmap
::
LaneBoundaryType
::
DOTTED_WHITE
)
{
auto
neighbor
=
LeftNeighborWaypoint
(
waypoint
);
if
(
neighbor
.
lane
&&
(
neighbor
.
lane
->
lane
().
type
()
==
hdmap
::
Lane
::
BIKING
||
neighbor
.
lane
->
lane
().
type
()
==
hdmap
::
Lane
::
CITY_DRIVING
||
neighbor
.
lane
->
lane
().
type
()
==
hdmap
::
Lane
::
PARKING
))
{
left_extend
=
FLAGS_reference_line_lateral_extension
;
}
}
auto
right_boundary_type
=
RightBoundaryType
(
waypoint
);
double
right_extend
=
0.0
;
if
(
right_boundary_type
==
hdmap
::
LaneBoundaryType
::
DOTTED_WHITE
)
{
auto
neighbor
=
RightNeighborWaypoint
(
waypoint
);
if
(
neighbor
.
lane
&&
(
neighbor
.
lane
->
lane
().
type
()
==
hdmap
::
Lane
::
BIKING
||
neighbor
.
lane
->
lane
().
type
()
==
hdmap
::
Lane
::
CITY_DRIVING
||
neighbor
.
lane
->
lane
().
type
()
==
hdmap
::
Lane
::
PARKING
))
{
right_extend
=
FLAGS_reference_line_lateral_extension
;
}
}
double
left_width
=
0.0
;
double
right_width
=
0.0
;
reference_line
.
GetLaneWidth
(
s
,
&
left_width
,
&
right_width
);
left_width
+=
left_extend
;
right_width
+=
right_extend
;
auto
shift
=
(
left_width
-
right_width
)
/
2.0
*
Vec2d
::
CreateUnitVec2d
(
ref_point
.
heading
()
+
M_PI
/
2.0
);
ref_point
+=
shift
;
anchor
.
path_point
=
ref_point
.
ToPathPoint
(
s
);
double
effective_width
=
(
left_width
+
right_width
)
/
2.0
;
anchor
.
lateral_bound
=
std
::
max
(
smoother_config_
.
lateral_boundary_bound
(),
effective_width
-
half_width
-
FLAGS_reference_line_lateral_buffer
);
}
return
anchor
;
}
void
ReferenceLineProvider
::
GetAnchorPoints
(
const
ReferenceLine
&
reference_line
,
std
::
vector
<
AnchorPoint
>
*
anchor_points
)
const
{
CHECK_NOTNULL
(
anchor_points
);
const
auto
half_width
=
VehicleConfigHelper
::
GetConfig
().
vehicle_param
().
width
()
/
2.0
;
const
double
interval
=
smoother_config_
.
max_constraint_interval
();
int
num_of_anchors
=
std
::
max
(
2
,
static_cast
<
int
>
(
reference_line
.
Length
()
/
interval
+
0.5
));
...
...
@@ -512,19 +571,7 @@ void ReferenceLineProvider::GetAnchorPoints(
common
::
util
::
uniform_slice
(
0.0
,
reference_line
.
Length
(),
num_of_anchors
-
1
,
&
anchor_s
);
for
(
const
double
s
:
anchor_s
)
{
anchor_points
->
emplace_back
();
auto
&
last_anchor
=
anchor_points
->
back
();
auto
ref_point
=
reference_line
.
GetReferencePoint
(
s
);
last_anchor
.
path_point
=
ref_point
.
ToPathPoint
(
s
);
last_anchor
.
longitudinal_bound
=
smoother_config_
.
longitudinal_boundary_bound
();
double
left_width
=
0.0
;
double
right_width
=
0.0
;
reference_line
.
GetLaneWidth
(
s
,
&
left_width
,
&
right_width
);
last_anchor
.
lateral_bound
=
std
::
max
(
smoother_config_
.
lateral_boundary_bound
(),
std
::
min
(
left_width
,
right_width
)
-
half_width
-
FLAGS_reference_line_lateral_buffer
);
anchor_points
->
emplace_back
(
GetAnchorPoint
(
reference_line
,
s
));
}
anchor_points
->
front
().
longitudinal_bound
=
1e-6
;
anchor_points
->
front
().
lateral_bound
=
1e-6
;
...
...
modules/planning/reference_line/reference_line_provider.h
浏览文件 @
4012f34f
...
...
@@ -133,6 +133,9 @@ class ReferenceLineProvider {
hdmap
::
RouteSegments
*
segments
,
ReferenceLine
*
reference_line
);
AnchorPoint
GetAnchorPoint
(
const
ReferenceLine
&
reference_line
,
double
s
)
const
;
private:
DECLARE_SINGLETON
(
ReferenceLineProvider
);
...
...
modules/planning/testdata/garage_test/result_follow_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/garage_test/result_out_of_map_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/garage_test/result_stop_dest_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/garage_test/result_stop_obstacle_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/garage_test/result_stop_over_line_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_avoid_change_left_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_change_lane_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_cruise_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_follow_01_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_follow_02_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_follow_03_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_mission_complete_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_qp_path_failure_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_rightturn_01_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_rightturn_with_red_light_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_slowdown_01_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
modules/planning/testdata/sunnyvale_loop_test/result_stop_0.pb.txt
浏览文件 @
4012f34f
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录