Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
4c5cabca
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,发现更多精彩内容 >>
提交
4c5cabca
编写于
8月 08, 2017
作者:
T
Tao Jiaming
提交者:
Dong Li
8月 08, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Create a 'virtual' obstacle for destination
上级
5f5ad6e1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
64 addition
and
0 deletion
+64
-0
modules/planning/common/frame.cc
modules/planning/common/frame.cc
+44
-0
modules/planning/common/frame.h
modules/planning/common/frame.h
+7
-0
modules/planning/common/planning_gflags.cc
modules/planning/common/planning_gflags.cc
+7
-0
modules/planning/common/planning_gflags.h
modules/planning/common/planning_gflags.h
+6
-0
未找到文件。
modules/planning/common/frame.cc
浏览文件 @
4c5cabca
...
...
@@ -24,6 +24,7 @@
#include "modules/common/adapters/adapter_manager.h"
#include "modules/common/log.h"
#include "modules/common/math/vec2d.h"
#include "modules/map/pnc_map/pnc_map.h"
#include "modules/planning/common/planning_gflags.h"
#include "modules/planning/reference_line/reference_line_smoother.h"
...
...
@@ -84,6 +85,49 @@ void Frame::CreatePredictionObstacles(
}
}
bool
Frame
::
CreateDestinationObstacle
()
{
// set destination point
common
::
math
::
Vec2d
destination
;
destination
.
set_x
(
routing_response_
.
routing_request
().
end
().
pose
().
x
());
destination
.
set_y
(
routing_response_
.
routing_request
().
end
().
pose
().
y
());
// check if destination point is in planning range
common
::
SLPoint
destination_sl
;
reference_line_
.
get_point_in_frenet_frame
(
destination
,
&
destination_sl
);
double
destination_s
=
destination_sl
.
s
();
if
(
destination_s
<
0
||
destination_s
>
reference_line_
.
length
())
{
AINFO
<<
"destination(s[:"
<<
destination_sl
.
s
()
<<
"]) out of planning range. Skip"
;
return
true
;
}
// create a "virtual" perception_obstacle
perception
::
PerceptionObstacle
perception_obstacle
;
perception_obstacle
.
mutable_position
()
->
set_x
(
destination
.
x
());
perception_obstacle
.
mutable_position
()
->
set_y
(
destination
.
y
());
auto
dest_ref_point
=
reference_line_
.
get_reference_point
(
destination
.
x
(),
destination
.
y
());
perception_obstacle
.
set_theta
(
dest_ref_point
.
heading
());
perception_obstacle
.
mutable_velocity
()
->
set_x
(
0
);
perception_obstacle
.
mutable_velocity
()
->
set_y
(
0
);
perception_obstacle
.
set_length
(
FLAGS_virtual_stop_wall_length
);
perception_obstacle
.
set_width
(
FLAGS_virtual_stop_wall_width
);
perception_obstacle
.
set_height
(
FLAGS_virtual_stop_wall_height
);
perception_obstacle
.
set_type
(
perception
::
PerceptionObstacle
::
UNKNOWN_UNMOVABLE
);
perception_obstacle
.
set_tracking_time
(
1.0
);
std
::
unique_ptr
<
Obstacle
>
obstacle_ptr
(
new
Obstacle
(
FLAGS_destination_obstacle_id
,
perception_obstacle
));
auto
id
(
FLAGS_destination_obstacle_id
);
obstacles_
.
Add
(
id
,
std
::
move
(
obstacle_ptr
));
return
true
;
}
const
ADCTrajectory
&
Frame
::
GetADCTrajectory
()
const
{
return
trajectory_pb_
;
}
ADCTrajectory
*
Frame
::
MutableADCTrajectory
()
{
return
&
trajectory_pb_
;
}
...
...
modules/planning/common/frame.h
浏览文件 @
4c5cabca
...
...
@@ -79,6 +79,7 @@ class Frame {
void
AlignPredictionTime
(
const
double
trajectory_header_time
);
private:
/**
* @brief This is the function that can create one reference lines
...
...
@@ -108,6 +109,12 @@ class Frame {
void
CreatePredictionObstacles
(
const
prediction
::
PredictionObstacles
&
prediction
);
/**
* @brief create destination obstacle based on routing end point
* @param
*/
bool
CreateDestinationObstacle
();
/**
* @brief Create traffic obstacles in this function.
* The created obstacles is added to obstacles_, and the decision is added to
...
...
modules/planning/common/planning_gflags.cc
浏览文件 @
4c5cabca
...
...
@@ -352,3 +352,10 @@ DEFINE_double(decision_valid_stop_range, 0.5,
DEFINE_bool
(
enable_record_debug
,
true
,
"True to enable record debug into debug protobuf."
);
DEFINE_bool
(
enable_prediction
,
true
,
"True to enable prediction input."
);
DEFINE_string
(
destination_obstacle_id
,
"DEST"
,
"obstacle id for converting destination to an obstacle"
);
DEFINE_double
(
virtual_stop_wall_length
,
0.1
,
"virtual stop wall length (meters)"
);
DEFINE_double
(
virtual_stop_wall_width
,
3.7
,
"virtual stop wall width (meters)"
);
DEFINE_double
(
virtual_stop_wall_height
,
2.0
,
"virtual stop wall height (meters)"
);
modules/planning/common/planning_gflags.h
浏览文件 @
4c5cabca
...
...
@@ -229,4 +229,10 @@ DECLARE_double(decision_valid_stop_range);
DECLARE_bool
(
enable_record_debug
);
DECLARE_bool
(
enable_prediction
);
DECLARE_string
(
destination_obstacle_id
);
DECLARE_double
(
virtual_stop_wall_length
);
DECLARE_double
(
virtual_stop_wall_width
);
DECLARE_double
(
virtual_stop_wall_height
);
#endif // MODULES_PLANNING_COMMON_PLANNING_GFLAGS_H_
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录