Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
0826b78a
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,发现更多精彩内容 >>
提交
0826b78a
编写于
8月 02, 2017
作者:
Z
Zhang Liangliang
提交者:
Jiangtao Hu
8月 02, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added get speed limit functions on reference line.
上级
862a428c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
52 addition
and
35 deletion
+52
-35
modules/planning/optimizer/st_graph/st_boundary_mapper_impl.cc
...es/planning/optimizer/st_graph/st_boundary_mapper_impl.cc
+14
-14
modules/planning/optimizer/st_graph/st_boundary_mapper_impl.h
...les/planning/optimizer/st_graph/st_boundary_mapper_impl.h
+4
-4
modules/planning/reference_line/reference_line.cc
modules/planning/reference_line/reference_line.cc
+32
-13
modules/planning/reference_line/reference_line.h
modules/planning/reference_line/reference_line.h
+2
-4
未找到文件。
modules/planning/optimizer/st_graph/st_boundary_mapper_impl.cc
浏览文件 @
0826b78a
...
...
@@ -80,15 +80,15 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
const
auto
&
main_decision
=
decision_data
.
Decision
().
main_decision
();
if
(
main_decision
.
has_stop
())
{
ret
=
map_main_decision_s
top
(
main_decision
.
stop
(),
reference_line
,
planning_distance
,
planning_time
,
st_graph_boundaries
);
ret
=
MapMainDecisionS
top
(
main_decision
.
stop
(),
reference_line
,
planning_distance
,
planning_time
,
st_graph_boundaries
);
if
(
!
ret
.
ok
()
&&
ret
.
code
()
!=
ErrorCode
::
PLANNING_SKIP
)
{
return
Status
(
ErrorCode
::
PLANNING_ERROR
);
}
}
else
if
(
main_decision
.
has_mission_complete
())
{
ret
=
map_mission_c
omplete
(
reference_line
,
planning_distance
,
planning_time
,
st_graph_boundaries
);
ret
=
MapMissionC
omplete
(
reference_line
,
planning_distance
,
planning_time
,
st_graph_boundaries
);
if
(
!
ret
.
ok
()
&&
ret
.
code
()
!=
ErrorCode
::
PLANNING_SKIP
)
{
return
Status
(
ErrorCode
::
PLANNING_ERROR
);
}
...
...
@@ -101,7 +101,7 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
if (obs == nullptr) {
continue;
}
ret =
map_obstacle_without_prediction_t
rajectory(
ret =
MapObstacleWithoutPredictionT
rajectory(
initial_planning_point, *obs, path_data, planning_distance,
planning_time, st_graph_boundaries);
if (!ret.ok()) {
...
...
@@ -118,7 +118,7 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
}
for
(
auto
&
obj_decision
:
obs
->
Decisions
())
{
if
(
obj_decision
.
has_follow
())
{
ret
=
map_obstacle_without_prediction_t
rajectory
(
ret
=
MapObstacleWithoutPredictionT
rajectory
(
initial_planning_point
,
*
obs
,
obj_decision
,
path_data
,
reference_line
,
planning_distance
,
planning_time
,
st_graph_boundaries
);
...
...
@@ -129,7 +129,7 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
"Fail to map follow dynamic obstacle"
);
}
}
else
if
(
obj_decision
.
has_overtake
()
||
obj_decision
.
has_yield
())
{
ret
=
map_obstacle_with_prediction_t
rajectory
(
ret
=
MapObstacleWithPredictionT
rajectory
(
initial_planning_point
,
*
obs
,
obj_decision
,
path_data
,
planning_distance
,
planning_time
,
st_graph_boundaries
);
if
(
!
ret
.
ok
())
{
...
...
@@ -143,7 +143,7 @@ Status StBoundaryMapperImpl::GetGraphBoundary(
return
Status
::
OK
();
}
Status
StBoundaryMapperImpl
::
map_main_decision_s
top
(
Status
StBoundaryMapperImpl
::
MapMainDecisionS
top
(
const
MainStop
&
main_stop
,
const
ReferenceLine
&
reference_line
,
const
double
planning_distance
,
const
double
planning_time
,
std
::
vector
<
StGraphBoundary
>*
const
boundary
)
const
{
...
...
@@ -155,7 +155,7 @@ Status StBoundaryMapperImpl::map_main_decision_stop(
SLPoint
sl_point
;
if
(
!
reference_line
.
get_point_in_frenet_frame
(
Vec2d
(
map_point
.
x
(),
map_point
.
y
()),
&
sl_point
))
{
AERROR
<<
"Fail to
map_main_decision_s
top since get_point_in_frenet_frame "
AERROR
<<
"Fail to
MapMainDecisionS
top since get_point_in_frenet_frame "
"failed."
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
);
}
...
...
@@ -171,7 +171,7 @@ Status StBoundaryMapperImpl::map_main_decision_stop(
if
(
stop_rear_center_s
>=
reference_line
.
length
()
-
FLAGS_backward_routing_distance
)
{
AWARN
<<
common
::
util
::
StrCat
(
"Skip to
map_main_decision_s
top since stop_rear_center_s["
,
"Skip to
MapMainDecisionS
top since stop_rear_center_s["
,
stop_rear_center_s
,
"] > path length["
,
reference_line
.
length
(),
"]."
);
return
Status
(
ErrorCode
::
PLANNING_SKIP
);
...
...
@@ -199,7 +199,7 @@ Status StBoundaryMapperImpl::map_main_decision_stop(
return
Status
::
OK
();
}
Status
StBoundaryMapperImpl
::
map_mission_c
omplete
(
Status
StBoundaryMapperImpl
::
MapMissionC
omplete
(
const
ReferenceLine
&
reference_line
,
const
double
planning_distance
,
const
double
planning_time
,
std
::
vector
<
StGraphBoundary
>*
const
boundary
)
const
{
...
...
@@ -226,7 +226,7 @@ Status StBoundaryMapperImpl::map_mission_complete(
return
Status
::
OK
();
}
Status
StBoundaryMapperImpl
::
map_obstacle_with_prediction_t
rajectory
(
Status
StBoundaryMapperImpl
::
MapObstacleWithPredictionT
rajectory
(
const
common
::
TrajectoryPoint
&
initial_planning_point
,
const
Obstacle
&
obstacle
,
const
ObjectDecisionType
obj_decision
,
const
PathData
&
path_data
,
const
double
planning_distance
,
...
...
@@ -366,7 +366,7 @@ Status StBoundaryMapperImpl::map_obstacle_with_prediction_trajectory(
:
Status
::
OK
();
}
Status
StBoundaryMapperImpl
::
map_obstacle_without_prediction_t
rajectory
(
Status
StBoundaryMapperImpl
::
MapObstacleWithoutPredictionT
rajectory
(
const
common
::
TrajectoryPoint
&
initial_planning_point
,
const
Obstacle
&
obstacle
,
const
ObjectDecisionType
obj_decision
,
const
PathData
&
path_data
,
const
ReferenceLine
&
reference_line
,
...
...
modules/planning/optimizer/st_graph/st_boundary_mapper_impl.h
浏览文件 @
0826b78a
...
...
@@ -43,24 +43,24 @@ class StBoundaryMapperImpl : public StBoundaryMapper {
std
::
vector
<
StGraphBoundary
>*
const
boundary
)
const
override
;
private:
apollo
::
common
::
Status
map_main_decision_s
top
(
apollo
::
common
::
Status
MapMainDecisionS
top
(
const
MainStop
&
main_stop
,
const
ReferenceLine
&
reference_line
,
const
double
planning_distance
,
const
double
planning_time
,
std
::
vector
<
StGraphBoundary
>*
const
boundary
)
const
;
apollo
::
common
::
Status
map_mission_c
omplete
(
apollo
::
common
::
Status
MapMissionC
omplete
(
const
ReferenceLine
&
reference_line
,
const
double
planning_distance
,
const
double
planning_time
,
std
::
vector
<
StGraphBoundary
>*
const
boundary
)
const
;
apollo
::
common
::
Status
map_obstacle_with_prediction_t
rajectory
(
apollo
::
common
::
Status
MapObstacleWithPredictionT
rajectory
(
const
common
::
TrajectoryPoint
&
initial_planning_point
,
const
Obstacle
&
obstacle
,
const
ObjectDecisionType
obj_decision
,
const
PathData
&
path_data
,
const
double
planning_distance
,
const
double
planning_time
,
std
::
vector
<
StGraphBoundary
>*
const
boundary
)
const
;
apollo
::
common
::
Status
map_obstacle_without_prediction_t
rajectory
(
apollo
::
common
::
Status
MapObstacleWithoutPredictionT
rajectory
(
const
common
::
TrajectoryPoint
&
initial_planning_point
,
const
Obstacle
&
obstacle
,
const
ObjectDecisionType
obj_decision
,
const
PathData
&
path_data
,
const
ReferenceLine
&
reference_line
,
...
...
modules/planning/reference_line/reference_line.cc
浏览文件 @
0826b78a
...
...
@@ -38,6 +38,7 @@ namespace apollo {
namespace
planning
{
using
MapPath
=
hdmap
::
Path
;
using
SLPoint
=
apollo
::
common
::
SLPoint
;
ReferenceLine
::
ReferenceLine
(
const
std
::
vector
<
ReferencePoint
>&
reference_points
)
...
...
@@ -50,10 +51,9 @@ ReferenceLine::ReferenceLine(
const
std
::
vector
<
hdmap
::
LaneSegment
>&
lane_segments
,
const
double
max_approximation_error
)
:
reference_points_
(
reference_points
),
map_path_
(
MapPath
(
std
::
vector
<
hdmap
::
MapPathPoint
>
(
reference_points
.
begin
(),
reference_points
.
end
()),
lane_segments
,
max_approximation_error
))
{}
map_path_
(
MapPath
(
std
::
vector
<
hdmap
::
MapPathPoint
>
(
reference_points
.
begin
(),
reference_points
.
end
()),
lane_segments
,
max_approximation_error
))
{}
ReferencePoint
ReferenceLine
::
get_reference_point
(
const
double
s
)
const
{
const
auto
&
accumulated_s
=
map_path_
.
accumulated_s
();
...
...
@@ -61,8 +61,7 @@ ReferencePoint ReferenceLine::get_reference_point(const double s) const {
AWARN
<<
"The requested s is nearer than the start point of the reference "
"line; reference line starts at "
<<
accumulated_s
.
back
()
<<
", requested "
<<
s
<<
"."
;
ReferencePoint
ref_point
(
map_path_
.
get_smooth_point
(
s
),
0.0
,
0.0
,
0.0
,
0.0
);
ReferencePoint
ref_point
(
map_path_
.
get_smooth_point
(
s
),
0.0
,
0.0
,
0.0
,
0.0
);
if
(
ref_point
.
lane_waypoints
().
empty
())
{
ref_point
.
add_lane_waypoints
(
reference_points_
.
front
().
lane_waypoints
());
}
...
...
@@ -72,8 +71,7 @@ ReferencePoint ReferenceLine::get_reference_point(const double s) const {
AWARN
<<
"The requested s exceeds the reference line; reference line "
"ends at "
<<
accumulated_s
.
back
()
<<
"requested "
<<
s
<<
" ."
;
ReferencePoint
ref_point
(
map_path_
.
get_smooth_point
(
s
),
0.0
,
0.0
,
0.0
,
0.0
);
ReferencePoint
ref_point
(
map_path_
.
get_smooth_point
(
s
),
0.0
,
0.0
,
0.0
,
0.0
);
if
(
ref_point
.
lane_waypoints
().
empty
())
{
ref_point
.
add_lane_waypoints
(
reference_points_
.
back
().
lane_waypoints
());
}
...
...
@@ -183,8 +181,8 @@ bool ReferenceLine::get_point_in_frenet_frame(
if
(
s
>
map_path_
.
accumulated_s
().
back
())
{
AERROR
<<
"The s of point is bigger than the length of current path. s: "
<<
s
<<
", curr path length: "
<<
map_path_
.
accumulated_s
().
back
()
<<
"."
;
<<
s
<<
", curr path length: "
<<
map_path_
.
accumulated_s
().
back
()
<<
"."
;
return
false
;
}
sl_point
->
set_s
(
s
);
...
...
@@ -211,9 +209,7 @@ const std::vector<ReferencePoint>& ReferenceLine::reference_points() const {
return
reference_points_
;
}
const
MapPath
&
ReferenceLine
::
reference_map_line
()
const
{
return
map_path_
;
}
const
MapPath
&
ReferenceLine
::
reference_map_line
()
const
{
return
map_path_
;
}
double
ReferenceLine
::
get_lane_width
(
const
double
s
)
const
{
// TODO(startcode) : need implement;
...
...
@@ -273,5 +269,28 @@ void ReferenceLine::get_s_range_from_box2d(
}
}
double
ReferenceLine
::
GetSpeedLimitFromS
(
const
double
s
)
const
{
const
auto
&
map_path_point
=
get_reference_point
(
s
);
double
speed_limit
=
std
::
numeric_limits
<
double
>::
max
();
for
(
const
auto
&
lane_waypoint
:
map_path_point
.
lane_waypoints
())
{
if
(
lane_waypoint
.
lane
==
nullptr
)
{
AWARN
<<
"lane_waypoint.lane is nullptr"
;
continue
;
}
speed_limit
=
std
::
fmin
(
lane_waypoint
.
lane
->
lane
().
speed_limit
(),
speed_limit
);
}
return
speed_limit
;
}
double
ReferenceLine
::
GetSpeedLimitFromPoint
(
const
common
::
math
::
Vec2d
&
point
)
const
{
SLPoint
sl
;
if
(
!
get_point_in_frenet_frame
(
point
,
&
sl
))
{
return
false
;
}
return
GetSpeedLimitFromS
(
sl
.
s
());
}
}
// namespace planning
}
// namespace apollo
modules/planning/reference_line/reference_line.h
浏览文件 @
0826b78a
...
...
@@ -66,10 +66,8 @@ class ReferenceLine {
void
get_s_range_from_box2d
(
const
::
apollo
::
common
::
math
::
Box2d
&
box2d
,
double
*
max_s
,
double
*
min_s
)
const
;
double
GetSpeedLimitFromS
(
const
double
s
)
const
{
return
10.0
;
};
double
GetSpeedLimitFromPoint
(
const
common
::
math
::
Vec2d
&
point
)
const
{
return
10.0
;
};
double
GetSpeedLimitFromS
(
const
double
s
)
const
;
double
GetSpeedLimitFromPoint
(
const
common
::
math
::
Vec2d
&
point
)
const
;
private:
static
ReferencePoint
interpolate
(
const
ReferencePoint
&
p0
,
const
double
s0
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录