Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
77d2d73c
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,发现更多精彩内容 >>
提交
77d2d73c
编写于
5月 13, 2019
作者:
J
JasonZhou404
提交者:
HongyiSun
5月 14, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: disable jacobian ad for testing
上级
42655dc1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
48 addition
and
38 deletion
+48
-38
modules/planning/conf/planning_config.pb.txt
modules/planning/conf/planning_config.pb.txt
+1
-0
modules/planning/open_space/trajectory_smoother/distance_approach_ipopt_interface.cc
.../trajectory_smoother/distance_approach_ipopt_interface.cc
+44
-37
modules/planning/open_space/trajectory_smoother/distance_approach_ipopt_interface.h
...e/trajectory_smoother/distance_approach_ipopt_interface.h
+2
-1
modules/planning/proto/planner_open_space_config.proto
modules/planning/proto/planner_open_space_config.proto
+1
-0
未找到文件。
modules/planning/conf/planning_config.pb.txt
浏览文件 @
77d2d73c
...
...
@@ -182,6 +182,7 @@ default_task_config: {
}
enable_constraint_check: false
enable_initial_final_check: false
enable_jacobian_ad: false
}
delta_t: 0.5
max_position_error_to_end_point: 0.05
...
...
modules/planning/open_space/trajectory_smoother/distance_approach_ipopt_interface.cc
浏览文件 @
77d2d73c
...
...
@@ -67,9 +67,8 @@ DistanceApproachIPOPTInterface::DistanceApproachIPOPTInterface(
l_start_index_
=
time_start_index_
+
(
horizon_
+
1
);
n_start_index_
=
l_start_index_
+
obstacles_edges_sum_
*
(
horizon_
+
1
);
planner_open_space_config_
.
CopyFrom
(
planner_open_space_config
);
distance_approach_config_
=
planner_open_space_config
_
.
distance_approach_config
();
planner_open_space_config
.
distance_approach_config
();
weight_state_x_
=
distance_approach_config_
.
weight_x
();
weight_state_y_
=
distance_approach_config_
.
weight_y
();
weight_state_phi_
=
distance_approach_config_
.
weight_phi
();
...
...
@@ -103,6 +102,7 @@ DistanceApproachIPOPTInterface::DistanceApproachIPOPTInterface(
wheelbase_
=
vehicle_param_
.
wheel_base
();
enable_constraint_check_
=
distance_approach_config_
.
enable_constraint_check
();
enable_jacobian_ad_
=
distance_approach_config_
.
enable_jacobian_ad
();
}
bool
DistanceApproachIPOPTInterface
::
get_nlp_info
(
int
&
n
,
int
&
m
,
...
...
@@ -147,17 +147,18 @@ bool DistanceApproachIPOPTInterface::get_nlp_info(int& n, int& m,
ADEBUG
<<
"num_of_constraints_ "
<<
num_of_constraints_
;
generate_tapes
(
n
,
m
,
&
nnz_jac_g
,
&
nnz_h_lag
);
// TODO(Jinyun): evaluate original problem formulation
// number of nonzero in Jacobian.
// int tmp = 0;
// for (int i = 0; i < horizon_ + 1; ++i) {
// for (int j = 0; j < obstacles_num_; ++j) {
// int current_edges_num = obstacles_edges_num_(j, 0);
// tmp += current_edges_num * 4 + 9 + 4;
// }
// }
// nnz_jac_g = 24 * horizon_ + 3 * horizon_ + 2 * horizon_ + tmp - 1 +
// (num_of_variables_ - (horizon_ + 1) + 2);
if
(
!
enable_jacobian_ad_
)
{
int
tmp
=
0
;
for
(
int
i
=
0
;
i
<
horizon_
+
1
;
++
i
)
{
for
(
int
j
=
0
;
j
<
obstacles_num_
;
++
j
)
{
int
current_edges_num
=
obstacles_edges_num_
(
j
,
0
);
tmp
+=
current_edges_num
*
4
+
9
+
4
;
}
}
nnz_jac_g
=
24
*
horizon_
+
3
*
horizon_
+
2
*
horizon_
+
tmp
-
1
+
(
num_of_variables_
-
(
horizon_
+
1
)
+
2
);
}
index_style
=
IndexStyleEnum
::
C_STYLE
;
return
true
;
...
...
@@ -453,22 +454,25 @@ bool DistanceApproachIPOPTInterface::eval_jac_g(int n, const double* x,
bool
new_x
,
int
m
,
int
nele_jac
,
int
*
iRow
,
int
*
jCol
,
double
*
values
)
{
if
(
values
==
nullptr
)
{
// return the structure of the jacobian
for
(
int
idx
=
0
;
idx
<
nnz_jac
;
idx
++
)
{
iRow
[
idx
]
=
rind_g
[
idx
];
jCol
[
idx
]
=
cind_g
[
idx
];
if
(
enable_jacobian_ad_
)
{
if
(
values
==
nullptr
)
{
// return the structure of the jacobian
for
(
int
idx
=
0
;
idx
<
nnz_jac
;
idx
++
)
{
iRow
[
idx
]
=
rind_g
[
idx
];
jCol
[
idx
]
=
cind_g
[
idx
];
}
}
else
{
// return the values of the jacobian of the constraints
sparse_jac
(
tag_g
,
m
,
n
,
1
,
x
,
&
nnz_jac
,
&
rind_g
,
&
cind_g
,
&
jacval
,
options_g
);
for
(
int
idx
=
0
;
idx
<
nnz_jac
;
idx
++
)
{
values
[
idx
]
=
jacval
[
idx
];
}
}
return
true
;
}
else
{
// return the values of the jacobian of the constraints
sparse_jac
(
tag_g
,
m
,
n
,
1
,
x
,
&
nnz_jac
,
&
rind_g
,
&
cind_g
,
&
jacval
,
options_g
);
for
(
int
idx
=
0
;
idx
<
nnz_jac
;
idx
++
)
{
values
[
idx
]
=
jacval
[
idx
];
}
return
eval_jac_g_ser
(
n
,
x
,
new_x
,
m
,
nele_jac
,
iRow
,
jCol
,
values
);
}
return
true
;
// return eval_jac_g_ser(n, x, new_x, m, nele_jac, iRow, jCol, values);
}
bool
DistanceApproachIPOPTInterface
::
eval_jac_g_ser
(
int
n
,
const
double
*
x
,
...
...
@@ -1928,23 +1932,26 @@ void DistanceApproachIPOPTInterface::generate_tapes(int n, int m,
trace_off
();
rind_g
=
nullptr
;
cind_g
=
nullptr
;
if
(
enable_jacobian_ad_
)
{
rind_g
=
nullptr
;
cind_g
=
nullptr
;
jacval
=
nullptr
;
options_g
[
0
]
=
0
;
/* sparsity pattern by index domains (default) */
options_g
[
1
]
=
0
;
/* safe mode (default) */
options_g
[
2
]
=
0
;
options_g
[
3
]
=
0
;
/* column compression (default) */
sparse_jac
(
tag_g
,
m
,
n
,
0
,
&
xp
[
0
],
&
nnz_jac
,
&
rind_g
,
&
cind_g
,
&
jacval
,
options_g
);
*
nnz_jac_g
=
nnz_jac
;
}
rind_L
=
nullptr
;
cind_L
=
nullptr
;
jacval
=
nullptr
;
hessval
=
nullptr
;
options_g
[
0
]
=
0
;
/* sparsity pattern by index domains (default) */
options_g
[
1
]
=
0
;
/* safe mode (default) */
options_g
[
2
]
=
0
;
options_g
[
3
]
=
0
;
/* column compression (default) */
sparse_jac
(
tag_g
,
m
,
n
,
0
,
&
xp
[
0
],
&
nnz_jac
,
&
rind_g
,
&
cind_g
,
&
jacval
,
options_g
);
*
nnz_jac_g
=
nnz_jac
;
options_L
[
0
]
=
0
;
options_L
[
1
]
=
1
;
sparse_hess
(
tag_L
,
n
,
0
,
&
xp
[
0
],
&
nnz_L
,
&
rind_L
,
&
cind_L
,
&
hessval
,
options_L
);
*
nnz_h_lag
=
nnz_L
;
...
...
modules/planning/open_space/trajectory_smoother/distance_approach_ipopt_interface.h
浏览文件 @
77d2d73c
...
...
@@ -234,9 +234,10 @@ class DistanceApproachIPOPTInterface : public DistanceApproachInterface {
double
max_miu_
=
0.0
;
bool
enable_jacobian_ad_
=
false
;
private:
DistanceApproachConfig
distance_approach_config_
;
PlannerOpenSpaceConfig
planner_open_space_config_
;
const
common
::
VehicleParam
vehicle_param_
=
common
::
VehicleConfigHelper
::
GetConfig
().
vehicle_param
();
...
...
modules/planning/proto/planner_open_space_config.proto
浏览文件 @
77d2d73c
...
...
@@ -98,6 +98,7 @@ message DistanceApproachConfig {
// True to enable derivative check inside open space planner
optional
bool
enable_initial_final_check
=
25
[
default
=
false
];
optional
DistanceApproachMode
distance_approach_mode
=
26
;
optional
bool
enable_jacobian_ad
=
27
;
}
message
IpoptConfig
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录