Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
86c14109
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,发现更多精彩内容 >>
提交
86c14109
编写于
11月 01, 2017
作者:
Q
Qi Luo
提交者:
Jiangtao Hu
11月 02, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Control: Add additional flags for test
上级
e351e14b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
18 deletion
+29
-18
modules/control/common/control_gflags.cc
modules/control/common/control_gflags.cc
+2
-0
modules/control/common/control_gflags.h
modules/control/common/control_gflags.h
+1
-1
modules/control/conf/control.conf
modules/control/conf/control.conf
+2
-0
modules/control/controller/lat_controller.cc
modules/control/controller/lat_controller.cc
+24
-17
未找到文件。
modules/control/common/control_gflags.cc
浏览文件 @
86c14109
...
...
@@ -49,3 +49,5 @@ DEFINE_bool(enable_gain_scheduler, false,
"Enable gain scheduler for higher vechile speed"
);
DEFINE_bool
(
set_steer_limit
,
false
,
"Set steer limit"
);
DEFINE_bool
(
use_relative_position
,
false
,
"Use relative position"
);
DEFINE_double
(
query_relative_time
,
0.5
,
"Temp flag to query target by relative time"
);
modules/control/common/control_gflags.h
浏览文件 @
86c14109
...
...
@@ -46,5 +46,5 @@ DECLARE_double(steer_angle_rate);
DECLARE_bool
(
enable_gain_scheduler
);
DECLARE_bool
(
set_steer_limit
);
DECLARE_bool
(
use_relative_position
);
DECLARE_double
(
query_relative_time
);
#endif // MODULES_CONTROL_COMMON_CONTROL_GFLAGS_H_
modules/control/conf/control.conf
浏览文件 @
86c14109
...
...
@@ -7,3 +7,5 @@
--
set_steer_limit
=
true
--
noenable_input_timestamp_check
--
use_relative_position
=
false
--
query_relative_time
=
0
.
5
--
use_ros_time
=
false
modules/control/controller/lat_controller.cc
浏览文件 @
86c14109
...
...
@@ -543,37 +543,44 @@ void LatController::ComputeLateralErrors(
const
double
x
,
const
double
y
,
const
double
theta
,
const
double
linear_v
,
const
double
angular_v
,
const
TrajectoryAnalyzer
&
trajectory_analyzer
,
SimpleLateralDebug
*
debug
)
const
{
auto
matched_point
=
trajectory_analyzer
.
QueryNearestPointByPosition
(
x
,
y
);
// TODO: (QiL) change this to conf.
::
apollo
::
common
::
TrajectoryPoint
target_point
;
if
(
FLAGS_use_relative_position
)
{
target_point
=
trajectory_analyzer
.
QueryNearestPointByRelativeTime
(
FLAGS_query_relative_time
);
}
else
{
target_point
=
trajectory_analyzer
.
QueryNearestPointByPosition
(
x
,
y
);
}
double
dx
=
x
-
matched
_point
.
path_point
().
x
();
double
dy
=
y
-
matched
_point
.
path_point
().
y
();
double
dx
=
x
-
target
_point
.
path_point
().
x
();
double
dy
=
y
-
target
_point
.
path_point
().
y
();
ADEBUG
<<
"x point: "
<<
x
<<
" y point: "
<<
y
;
ADEBUG
<<
"math point x: "
<<
matched
_point
.
path_point
().
x
()
<<
" y point: "
<<
matched
_point
.
path_point
().
y
();
ADEBUG
<<
"math point x: "
<<
target
_point
.
path_point
().
x
()
<<
" y point: "
<<
target
_point
.
path_point
().
y
();
double
cos_matched_theta
=
std
::
cos
(
matched
_point
.
path_point
().
theta
());
double
sin_matched_theta
=
std
::
sin
(
matched
_point
.
path_point
().
theta
());
double
cos_matched_theta
=
std
::
cos
(
target
_point
.
path_point
().
theta
());
double
sin_matched_theta
=
std
::
sin
(
target
_point
.
path_point
().
theta
());
// d_error = cos_matched_theta * dy - sin_matched_theta * dx;
debug
->
set_lateral_error
(
cos_matched_theta
*
dy
-
sin_matched_theta
*
dx
);
double
delta_theta
=
common
::
math
::
NormalizeAngle
(
theta
-
matched
_point
.
path_point
().
theta
());
common
::
math
::
NormalizeAngle
(
theta
-
target
_point
.
path_point
().
theta
());
double
sin_delta_theta
=
std
::
sin
(
delta_theta
);
// d_error_dot = linear_v * sin_delta_theta;
debug
->
set_lateral_error_rate
(
linear_v
*
sin_delta_theta
);
// theta_error = delta_theta;
debug
->
set_heading_error
(
delta_theta
);
// theta_error_dot = angular_v -
matched
_point.path_point().kappa() *
//
matched
_point.v();
debug
->
set_heading_error_rate
(
angular_v
-
matched
_point
.
path_point
().
kappa
()
*
matched
_point
.
v
());
// matched_theta =
matched
_point.path_point().theta();
debug
->
set_ref_heading
(
matched
_point
.
path_point
().
theta
());
// matched_kappa =
matched
_point.path_point().kappa();
debug
->
set_curvature
(
matched
_point
.
path_point
().
kappa
());
// theta_error_dot = angular_v -
target
_point.path_point().kappa() *
//
target
_point.v();
debug
->
set_heading_error_rate
(
angular_v
-
target
_point
.
path_point
().
kappa
()
*
target
_point
.
v
());
// matched_theta =
target
_point.path_point().theta();
debug
->
set_ref_heading
(
target
_point
.
path_point
().
theta
());
// matched_kappa =
target
_point.path_point().kappa();
debug
->
set_curvature
(
target
_point
.
path_point
().
kappa
());
}
}
// namespace control
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录