Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
1c1f3714
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,发现更多精彩内容 >>
提交
1c1f3714
编写于
12月 24, 2017
作者:
Z
Zhang Liangliang
提交者:
Jiangtao Hu
12月 24, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: added initial implementation of poly_st_graph.
上级
ab2dd16f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
217 addition
and
1 deletion
+217
-1
modules/planning/tasks/poly_st_speed/BUILD
modules/planning/tasks/poly_st_speed/BUILD
+23
-0
modules/planning/tasks/poly_st_speed/poly_st_graph.cc
modules/planning/tasks/poly_st_speed/poly_st_graph.cc
+88
-0
modules/planning/tasks/poly_st_speed/poly_st_graph.h
modules/planning/tasks/poly_st_speed/poly_st_graph.h
+96
-0
modules/planning/tasks/poly_st_speed/poly_st_speed_optimizer.cc
...s/planning/tasks/poly_st_speed/poly_st_speed_optimizer.cc
+10
-1
未找到文件。
modules/planning/tasks/poly_st_speed/BUILD
浏览文件 @
1c1f3714
...
...
@@ -2,6 +2,28 @@ load("//tools:cpplint.bzl", "cpplint")
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
name
=
"poly_st_graph"
,
srcs
=
[
"poly_st_graph.cc"
,
],
hdrs
=
[
"poly_st_graph.h"
,
],
deps
=
[
"//modules/common:log"
,
"//modules/common/configs:vehicle_config_helper"
,
"//modules/common/configs/proto:vehicle_config_proto"
,
"//modules/common/proto:pnc_point_proto"
,
"//modules/localization/proto:pose_proto"
,
"//modules/map/hdmap"
,
"//modules/planning/proto:planning_config_proto"
,
"//modules/planning/proto:poly_st_speed_config_proto"
,
"//modules/planning/tasks:speed_optimizer"
,
"//modules/planning/tasks/st_graph:st_boundary_mapper"
,
],
)
cc_library
(
name
=
"poly_st_speed_optimizer"
,
srcs
=
[
...
...
@@ -11,6 +33,7 @@ cc_library(
"poly_st_speed_optimizer.h"
,
],
deps
=
[
":poly_st_graph"
,
"//modules/common:log"
,
"//modules/common/configs:vehicle_config_helper"
,
"//modules/common/configs/proto:vehicle_config_proto"
,
...
...
modules/planning/tasks/poly_st_speed/poly_st_graph.cc
0 → 100644
浏览文件 @
1c1f3714
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
/**
* @file
**/
#include "modules/planning/tasks/poly_st_speed/poly_st_graph.h"
#include <algorithm>
#include <unordered_map>
#include "modules/common/proto/error_code.pb.h"
#include "modules/common/proto/pnc_point.pb.h"
#include "modules/planning/proto/planning_internal.pb.h"
#include "modules/common/configs/vehicle_config_helper.h"
#include "modules/common/log.h"
#include "modules/common/util/util.h"
#include "modules/planning/common/planning_gflags.h"
#include "modules/planning/math/curve1d/quintic_polynomial_curve1d.h"
namespace
apollo
{
namespace
planning
{
using
apollo
::
common
::
ErrorCode
;
using
apollo
::
common
::
Status
;
PolyStGraph
::
PolyStGraph
(
const
PolyStSpeedConfig
&
config
,
const
ReferenceLineInfo
*
reference_line_info
)
:
config_
(
config
),
reference_line_info_
(
reference_line_info
),
reference_line_
(
reference_line_info
->
reference_line
())
{}
bool
PolyStGraph
::
FindStTunnel
(
const
common
::
TrajectoryPoint
&
init_point
,
const
std
::
vector
<
const
PathObstacle
*>
&
obstacles
,
SpeedData
*
const
speed_data
)
{
CHECK_NOTNULL
(
speed_data
);
init_point_
=
init_point
;
std
::
vector
<
PolyStGraphNode
>
min_cost_path
;
if
(
!
GenerateMinCostSpeedProfile
(
obstacles
,
&
min_cost_path
))
{
AERROR
<<
"Fail to generate graph!"
;
return
false
;
}
// TODO(All): implement this function
return
true
;
}
bool
PolyStGraph
::
GenerateMinCostSpeedProfile
(
const
std
::
vector
<
const
PathObstacle
*>
&
obstacles
,
std
::
vector
<
PolyStGraphNode
>
*
min_cost_path
)
{
CHECK
(
min_cost_path
!=
nullptr
);
// TODO(All): implement this function
return
true
;
}
bool
PolyStGraph
::
SampleStPoints
(
std
::
vector
<
std
::
vector
<
STPoint
>>
*
const
points
)
{
CHECK_NOTNULL
(
points
);
constexpr
double
start_t
=
5.0
;
constexpr
double
start_s
=
0.0
;
for
(
double
t
=
start_t
;
t
<
planning_time_
;
t
+=
unit_t_
)
{
std
::
vector
<
STPoint
>
level_points
;
for
(
double
s
=
start_s
;
s
<
planning_distance_
;
s
+=
unit_s_
)
{
level_points
.
emplace_back
(
t
,
s
);
}
points
->
push_back
(
std
::
move
(
level_points
));
}
return
true
;
}
}
// namespace planning
}
// namespace apollo
modules/planning/tasks/poly_st_speed/poly_st_graph.h
0 → 100644
浏览文件 @
1c1f3714
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
/**
* @file
**/
#ifndef MODULES_PLANNING_TASKS_POLY_ST_SPEED_POLY_ST_GRAPH_H_
#define MODULES_PLANNING_TASKS_POLY_ST_SPEED_POLY_ST_GRAPH_H_
#include <limits>
#include <string>
#include <utility>
#include <vector>
#include "modules/common/proto/pnc_point.pb.h"
#include "modules/planning/proto/poly_st_speed_config.pb.h"
#include "modules/common/status/status.h"
#include "modules/planning/common/path/path_data.h"
#include "modules/planning/common/path_decision.h"
#include "modules/planning/common/path_obstacle.h"
#include "modules/planning/common/reference_line_info.h"
#include "modules/planning/common/speed/speed_data.h"
#include "modules/planning/common/trajectory/discretized_trajectory.h"
#include "modules/planning/math/curve1d/quintic_polynomial_curve1d.h"
#include "modules/planning/reference_line/reference_point.h"
namespace
apollo
{
namespace
planning
{
class
PolyStGraph
{
public:
explicit
PolyStGraph
(
const
PolyStSpeedConfig
&
config
,
const
ReferenceLineInfo
*
reference_line_info
);
~
PolyStGraph
()
=
default
;
bool
FindStTunnel
(
const
common
::
TrajectoryPoint
&
init_point
,
const
std
::
vector
<
const
PathObstacle
*>
&
obstacles
,
SpeedData
*
const
speed_data
);
private:
/**
* an private inner struct for the poly st graph
*/
struct
PolyStGraphNode
{
public:
PolyStGraphNode
()
=
default
;
PolyStGraphNode
(
const
STPoint
point_st
,
const
double
speed
,
const
double
accel
)
:
st_point
(
point_st
),
speed
(
speed
),
accel
(
accel
)
{}
STPoint
st_point
;
double
speed
=
0.0
;
double
accel
=
0.0
;
QuinticPolynomialCurve1d
speed_profile
;
};
bool
GenerateMinCostSpeedProfile
(
const
std
::
vector
<
const
PathObstacle
*>
&
obstacles
,
std
::
vector
<
PolyStGraphNode
>
*
min_cost_path
);
bool
SampleStPoints
(
std
::
vector
<
std
::
vector
<
STPoint
>>
*
const
points
);
private:
PolyStSpeedConfig
config_
;
common
::
TrajectoryPoint
init_point_
;
const
ReferenceLineInfo
*
reference_line_info_
=
nullptr
;
const
ReferenceLine
&
reference_line_
;
SpeedData
speed_data_
;
double
unit_t_
=
1.0
;
double
unit_s_
=
5.0
;
double
planning_distance_
=
100.0
;
double
planning_time_
=
6.0
;
};
}
// namespace planning
}
// namespace apollo
#endif // MODULES_PLANNING_TASKS_POLY_ST_SPEED_POLY_ST_GRAPH_H_
modules/planning/tasks/poly_st_speed/poly_st_speed_optimizer.cc
浏览文件 @
1c1f3714
...
...
@@ -31,6 +31,7 @@
#include "modules/common/util/file.h"
#include "modules/common/vehicle_state/vehicle_state_provider.h"
#include "modules/planning/common/planning_gflags.h"
#include "modules/planning/tasks/poly_st_speed/poly_st_graph.h"
#include "modules/planning/tasks/st_graph/st_graph_data.h"
namespace
apollo
{
...
...
@@ -109,7 +110,15 @@ Status PolyStSpeedOptimizer::Process(const SLBoundary& adc_sl_boundary,
// step 2 perform graph search
// make a poly_st_graph and perform search here.
PolyStGraph
poly_st_graph
(
poly_st_speed_config_
,
reference_line_info_
);
auto
ret
=
poly_st_graph
.
FindStTunnel
(
init_point
,
reference_line_info_
->
path_decision
()
->
path_obstacles
().
Items
(),
speed_data
);
if
(
!
ret
)
{
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
"Fail to find st tunnel in PolyStGraph."
);
}
return
Status
::
OK
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录