Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
e887041e
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,发现更多精彩内容 >>
提交
e887041e
编写于
9月 06, 2017
作者:
Z
Zhang Liangliang
提交者:
Dong Li
9月 06, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: used list in reference line provider.
上级
62906254
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
24 deletion
+34
-24
modules/canbus/vehicle/lincoln/lincoln_controller.cc
modules/canbus/vehicle/lincoln/lincoln_controller.cc
+21
-20
modules/planning/reference_line/reference_line_provider.cc
modules/planning/reference_line/reference_line_provider.cc
+11
-3
modules/planning/reference_line/reference_line_provider.h
modules/planning/reference_line/reference_line_provider.h
+2
-1
未找到文件。
modules/canbus/vehicle/lincoln/lincoln_controller.cc
浏览文件 @
e887041e
...
...
@@ -16,6 +16,8 @@
#include "modules/canbus/vehicle/lincoln/lincoln_controller.h"
#include "modules/common/proto/vehicle_signal.pb.h"
#include "modules/canbus/can_comm/can_sender.h"
#include "modules/canbus/vehicle/lincoln/lincoln_message_manager.h"
#include "modules/canbus/vehicle/lincoln/protocol/brake_60.h"
...
...
@@ -25,7 +27,6 @@
#include "modules/canbus/vehicle/lincoln/protocol/turnsignal_68.h"
#include "modules/canbus/vehicle/vehicle_controller.h"
#include "modules/common/log.h"
#include "modules/common/proto/vehicle_signal.pb.h"
#include "modules/common/time/time.h"
namespace
apollo
{
...
...
@@ -498,7 +499,7 @@ bool LincolnController::CheckChassisError() {
int32_t
chassis_error_mask
=
0
;
if
(
!
chassis_detail
.
has_eps
())
{
AERROR_EVERY
(
100
)
<<
"ChassisDetail has NO eps."
<<
chassis_detail
.
DebugString
();
<<
chassis_detail
.
DebugString
();
return
false
;
}
bool
steer_fault
=
chassis_detail
.
eps
().
watchdog_fault
()
|
...
...
@@ -520,7 +521,7 @@ bool LincolnController::CheckChassisError() {
if
(
!
chassis_detail
.
has_brake
())
{
AERROR_EVERY
(
100
)
<<
"ChassisDetail has NO brake."
<<
chassis_detail
.
DebugString
();
<<
chassis_detail
.
DebugString
();
return
false
;
}
// brake fault
...
...
@@ -542,7 +543,7 @@ bool LincolnController::CheckChassisError() {
if
(
!
chassis_detail
.
has_gas
())
{
AERROR_EVERY
(
100
)
<<
"ChassisDetail has NO gas."
<<
chassis_detail
.
DebugString
();
<<
chassis_detail
.
DebugString
();
return
false
;
}
// throttle fault
...
...
@@ -562,7 +563,7 @@ bool LincolnController::CheckChassisError() {
if
(
!
chassis_detail
.
has_gear
())
{
AERROR_EVERY
(
100
)
<<
"ChassisDetail has NO gear."
<<
chassis_detail
.
DebugString
();
<<
chassis_detail
.
DebugString
();
return
false
;
}
// gear fault
...
...
@@ -575,33 +576,33 @@ bool LincolnController::CheckChassisError() {
if
(
steer_fault
)
{
AERROR_EVERY
(
100
)
<<
"Steering fault detected: "
<<
chassis_detail
.
eps
().
watchdog_fault
()
<<
", "
<<
chassis_detail
.
eps
().
channel_1_fault
()
<<
", "
<<
chassis_detail
.
eps
().
channel_2_fault
()
<<
", "
<<
chassis_detail
.
eps
().
calibration_fault
()
<<
", "
<<
chassis_detail
.
eps
().
connector_fault
();
<<
chassis_detail
.
eps
().
watchdog_fault
()
<<
", "
<<
chassis_detail
.
eps
().
channel_1_fault
()
<<
", "
<<
chassis_detail
.
eps
().
channel_2_fault
()
<<
", "
<<
chassis_detail
.
eps
().
calibration_fault
()
<<
", "
<<
chassis_detail
.
eps
().
connector_fault
();
}
if
(
brake_fault
)
{
AERROR_EVERY
(
100
)
<<
"Brake fault detected: "
<<
chassis_detail
.
brake
().
watchdog_fault
()
<<
", "
<<
chassis_detail
.
brake
().
channel_1_fault
()
<<
", "
<<
chassis_detail
.
brake
().
channel_2_fault
()
<<
", "
<<
chassis_detail
.
brake
().
boo_fault
()
<<
", "
<<
chassis_detail
.
brake
().
connector_fault
();
<<
chassis_detail
.
brake
().
watchdog_fault
()
<<
", "
<<
chassis_detail
.
brake
().
channel_1_fault
()
<<
", "
<<
chassis_detail
.
brake
().
channel_2_fault
()
<<
", "
<<
chassis_detail
.
brake
().
boo_fault
()
<<
", "
<<
chassis_detail
.
brake
().
connector_fault
();
}
if
(
throttle_fault
)
{
AERROR_EVERY
(
100
)
<<
"Throttle fault detected: "
<<
chassis_detail
.
gas
().
watchdog_fault
()
<<
", "
<<
chassis_detail
.
gas
().
channel_1_fault
()
<<
", "
<<
chassis_detail
.
gas
().
channel_2_fault
()
<<
", "
<<
chassis_detail
.
gas
().
connector_fault
();
<<
chassis_detail
.
gas
().
watchdog_fault
()
<<
", "
<<
chassis_detail
.
gas
().
channel_1_fault
()
<<
", "
<<
chassis_detail
.
gas
().
channel_2_fault
()
<<
", "
<<
chassis_detail
.
gas
().
connector_fault
();
}
if
(
gear_fault
)
{
AERROR_EVERY
(
100
)
<<
"Gear fault detected: "
<<
chassis_detail
.
gear
().
canbus_fault
();
<<
chassis_detail
.
gear
().
canbus_fault
();
}
if
(
steer_fault
||
brake_fault
||
throttle_fault
)
{
...
...
modules/planning/reference_line/reference_line_provider.cc
浏览文件 @
e887041e
...
...
@@ -44,7 +44,7 @@ void ReferenceLineProvider::Init(
bool
ReferenceLineProvider
::
Start
()
{
if
(
!
is_initialized_
)
{
AERROR
<<
"
LincolnControll
er has NOT been initiated."
;
AERROR
<<
"
ReferenceLineProvid
er has NOT been initiated."
;
return
false
;
}
const
auto
&
func
=
[
this
]
{
Generate
();
};
...
...
@@ -71,18 +71,19 @@ std::vector<ReferenceLine> ReferenceLineProvider::GetReferenceLines() {
// can cover thoroughly the current adc position so that planning can be make
// with a minimum planning distance of 100 meters ahead and 10 meters
// backward.
while
(
reference_line_groups_
.
empty
())
{
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
duration
<
double
,
std
::
milli
>
(
20
));
}
std
::
lock_guard
<
std
::
mutex
>
lock
(
reference_line_groups_mutex_
);
return
reference_line_groups_
.
back
();
}
bool
ReferenceLineProvider
::
CreateReferenceLineFromRouting
(
const
common
::
PointENU
&
position
,
const
routing
::
RoutingResponse
&
routing
)
{
std
::
vector
<
ReferenceLine
>
reference_lines
;
std
::
vector
<
std
::
vector
<
hdmap
::
LaneSegment
>>
route_segments
;
const
double
kBackwardDistance
=
20
;
const
double
kForwardDistance
=
100
;
if
(
!
pnc_map_
->
GetLaneSegmentsFromRouting
(
routing
,
position
,
kBackwardDistance
,
kForwardDistance
,
&
route_segments
))
{
...
...
@@ -93,6 +94,8 @@ bool ReferenceLineProvider::CreateReferenceLineFromRouting(
ReferenceLineSmoother
smoother
;
smoother
.
Init
(
smoother_config_
);
std
::
vector
<
ReferenceLine
>
reference_lines
;
// TODO: Added code to enable partially smoothed reference line here.
for
(
const
auto
&
segments
:
route_segments
)
{
hdmap
::
Path
hdmap_path
;
pnc_map_
->
CreatePathFromLaneSegments
(
segments
,
&
hdmap_path
);
...
...
@@ -115,6 +118,11 @@ bool ReferenceLineProvider::CreateReferenceLineFromRouting(
std
::
lock_guard
<
std
::
mutex
>
lock
(
reference_line_groups_mutex_
);
reference_line_groups_
.
push_back
(
reference_lines
);
const
size_t
kMaxStoredReferenceLineGroups
=
3
;
while
(
reference_line_groups_
.
size
()
>
kMaxStoredReferenceLineGroups
)
{
reference_line_groups_
.
pop_front
();
}
return
true
;
}
...
...
modules/planning/reference_line/reference_line_provider.h
浏览文件 @
e887041e
...
...
@@ -21,6 +21,7 @@
#ifndef MODULES_PLANNING_REFERENCE_LINE_REFERENCE_LINE_PROVIDER_H_
#define MODULES_PLANNING_REFERENCE_LINE_REFERENCE_LINE_PROVIDER_H_
#include <list>
#include <memory>
#include <mutex>
#include <thread>
...
...
@@ -76,7 +77,7 @@ class ReferenceLineProvider {
ReferenceLineSmootherConfig
smoother_config_
;
std
::
mutex
reference_line_groups_mutex_
;
std
::
vector
<
std
::
vector
<
ReferenceLine
>>
reference_line_groups_
;
std
::
list
<
std
::
vector
<
ReferenceLine
>>
reference_line_groups_
;
};
}
// namespace planning
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录