Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
f22761bf
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,发现更多精彩内容 >>
提交
f22761bf
编写于
8月 02, 2017
作者:
Y
Yajia Zhang
提交者:
lianglia-apollo
8月 02, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed the trajecotry publish timestamp
上级
76a178a0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
12 deletion
+22
-12
modules/planning/planning.cc
modules/planning/planning.cc
+14
-7
modules/planning/planning.h
modules/planning/planning.h
+2
-1
modules/planning/trajectory_stitcher/trajectory_stitcher.cc
modules/planning/trajectory_stitcher/trajectory_stitcher.cc
+4
-3
modules/planning/trajectory_stitcher/trajectory_stitcher.h
modules/planning/trajectory_stitcher/trajectory_stitcher.h
+2
-1
未找到文件。
modules/planning/planning.cc
浏览文件 @
f22761bf
...
...
@@ -201,12 +201,15 @@ void Planning::RunOnce() {
common
::
VehicleState
::
instance
()
->
Update
(
localization
,
chassis
);
double
planning_cycle_time
=
1.0
/
FLAGS_planning_loop_rate
;
const
double
planning_cycle_time
=
1.0
/
FLAGS_planning_loop_rate
;
/**
// the execution_start_time is the estimated time when the planned trajectory
// will be executed by the controller.
double execution_start_time =
apollo::common::time::ToSecond(apollo::common::time::Clock::Now()) +
planning_cycle_time;
**/
ADCTrajectory
trajectory_pb
;
RecordInput
(
&
trajectory_pb
);
...
...
@@ -218,7 +221,8 @@ void Planning::RunOnce() {
}
bool
is_auto_mode
=
chassis
.
driving_mode
()
==
chassis
.
COMPLETE_AUTO_DRIVE
;
bool
res_planning
=
Plan
(
is_auto_mode
,
execution_start_time
,
&
trajectory_pb
);
bool
res_planning
=
Plan
(
is_auto_mode
,
start_timestamp
,
planning_cycle_time
,
&
trajectory_pb
);
const
double
end_timestamp
=
apollo
::
common
::
time
::
ToSecond
(
Clock
::
Now
());
const
double
time_diff_ms
=
(
end_timestamp
-
start_timestamp
)
*
1000
;
...
...
@@ -227,7 +231,7 @@ void Planning::RunOnce() {
if
(
res_planning
)
{
AdapterManager
::
FillPlanningHeader
(
"planning"
,
&
trajectory_pb
);
trajectory_pb
.
mutable_header
()
->
set_timestamp_sec
(
execution_start_time
);
trajectory_pb
.
mutable_header
()
->
set_timestamp_sec
(
start_timestamp
);
AdapterManager
::
PublishPlanning
(
trajectory_pb
);
ADEBUG
<<
"Planning succeeded:"
<<
trajectory_pb
.
header
().
DebugString
();
}
else
{
...
...
@@ -237,12 +241,15 @@ void Planning::RunOnce() {
void
Planning
::
Stop
()
{}
bool
Planning
::
Plan
(
const
bool
is_on_auto_mode
,
const
double
publish_time
,
bool
Planning
::
Plan
(
const
bool
is_on_auto_mode
,
const
double
current_time_stamp
,
const
double
planning_cycle_time
,
ADCTrajectory
*
trajectory_pb
)
{
double
vehicle_state_time
=
VehicleState
::
instance
()
->
timestamp
();
const
auto
&
stitching_trajectory
=
TrajectoryStitcher
::
compute_stitching_trajectory
(
is_on_auto_mode
,
vehicle_state_time
,
last_publishable_trajectory_
);
is_on_auto_mode
,
current_time_stamp
,
planning_cycle_time
,
last_publishable_trajectory_
);
frame_
->
SetPlanningStartPoint
(
stitching_trajectory
.
back
());
...
...
@@ -309,7 +316,7 @@ bool Planning::Plan(const bool is_on_auto_mode, const double publish_time,
publishable_trajectory
.
prepend_trajectory_points
(
stitching_trajectory
.
begin
(),
stitching_trajectory
.
end
()
-
1
);
publishable_trajectory
.
set_header_time
(
vehicle_state_time
);
publishable_trajectory
.
set_header_time
(
current_time_stamp
);
publishable_trajectory
.
populate_trajectory_protobuf
(
trajectory_pb
);
...
...
modules/planning/planning.h
浏览文件 @
f22761bf
...
...
@@ -77,7 +77,8 @@ class Planning : public apollo::common::ApolloApp {
* @param trajectory_pb the computed planning trajectory
*/
bool
Plan
(
const
bool
is_on_auto_mode
,
const
double
publish_time
,
const
double
current_time_stamp
,
const
double
planning_cycle_time
,
ADCTrajectory
*
trajectory_pb
);
const
Frame
*
GetFrame
()
const
;
...
...
modules/planning/trajectory_stitcher/trajectory_stitcher.cc
浏览文件 @
f22761bf
...
...
@@ -51,7 +51,8 @@ std::vector<TrajectoryPoint> compute_reinit_stitching_trajectory() {
// 3. the position deviation from actual and target is too high
std
::
vector
<
TrajectoryPoint
>
TrajectoryStitcher
::
compute_stitching_trajectory
(
const
bool
is_on_auto_mode
,
const
double
vehicle_state_time
,
const
double
current_timestamp
,
const
double
planning_cycle_time
,
const
PublishableTrajectory
&
prev_trajectory
)
{
if
(
!
is_on_auto_mode
)
{
...
...
@@ -68,7 +69,7 @@ std::vector<TrajectoryPoint> TrajectoryStitcher::compute_stitching_trajectory(
}
const
double
veh_rel_time
=
vehicle_state_time
-
prev_trajectory
.
header_time
();
current_timestamp
-
prev_trajectory
.
header_time
();
std
::
size_t
matched_index
=
prev_trajectory
.
query_nearest_point
(
veh_rel_time
);
...
...
@@ -96,7 +97,7 @@ std::vector<TrajectoryPoint> TrajectoryStitcher::compute_stitching_trajectory(
return
compute_reinit_stitching_trajectory
();
}
double
forward_rel_time
=
veh_rel_time
+
FLAGS_forward_predict
_time
;
double
forward_rel_time
=
veh_rel_time
+
planning_cycle
_time
;
std
::
size_t
forward_index
=
prev_trajectory
.
query_nearest_point
(
forward_rel_time
);
...
...
modules/planning/trajectory_stitcher/trajectory_stitcher.h
浏览文件 @
f22761bf
...
...
@@ -38,7 +38,8 @@ class TrajectoryStitcher {
static
std
::
vector
<
TrajectoryPoint
>
compute_stitching_trajectory
(
const
bool
is_on_auto_mode
,
const
double
vehicle_state_time
,
const
double
current_timestamp
,
const
double
planning_cycle_time
,
const
PublishableTrajectory
&
prev_trajectory
);
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录