Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
f3bf51ee
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,发现更多精彩内容 >>
提交
f3bf51ee
编写于
9月 17, 2018
作者:
C
Calvin Miao
提交者:
Jiangtao Hu
9月 17, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Control: use channel defined in adapter
上级
f62293f3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
27 deletion
+17
-27
modules/common/adapters/adapter_gflags.cc
modules/common/adapters/adapter_gflags.cc
+1
-1
modules/control/conf/control_conf.pb.txt
modules/control/conf/control_conf.pb.txt
+0
-5
modules/control/control_component.cc
modules/control/control_component.cc
+6
-8
modules/prediction/prediction_component.cc
modules/prediction/prediction_component.cc
+10
-13
未找到文件。
modules/common/adapters/adapter_gflags.cc
浏览文件 @
f3bf51ee
...
...
@@ -31,7 +31,7 @@ DEFINE_string(planning_trajectory_topic, "/apollo/planning",
"planning trajectory topic name"
);
DEFINE_string
(
planning_pad_topic
,
"/apollo/planning/pad"
,
"planning pad topic name"
);
DEFINE_string
(
monitor_topic
,
"/apollo/monitor"
,
"
ROS topic for m
onitor"
);
DEFINE_string
(
monitor_topic
,
"/apollo/monitor"
,
"
M
onitor"
);
DEFINE_string
(
pad_topic
,
"/apollo/control/pad"
,
"control pad message topic name"
);
DEFINE_string
(
control_command_topic
,
"/apollo/control"
,
...
...
modules/control/conf/control_conf.pb.txt
浏览文件 @
f3bf51ee
chassis_channel: "/apollo/canbus/chassis"
control_command_channel: "/apollo/control"
localization_channel: "/apollo/localization/LocalizationEstimate"
planning_channel: "/apollo/planning/ADCTrajectory"
pad_msg_channel: "/apollo/control/PadMessage"
control_test_duration: -1
enable_csv_debug: false
enable_speed_station_preview: false
...
...
modules/control/control_component.cc
浏览文件 @
f3bf51ee
...
...
@@ -64,15 +64,14 @@ bool ControlComponent::Init() {
}
chassis_reader_
=
node_
->
CreateReader
<
Chassis
>
(
control_conf_
.
chassis_channel
(),
[
this
](
const
std
::
shared_ptr
<
Chassis
>
&
chassis
)
{
FLAGS_chassis_topic
,
[
this
](
const
std
::
shared_ptr
<
Chassis
>
&
chassis
)
{
ADEBUG
<<
"Received chassis data: run chassis callback."
;
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
chassis_
.
CopyFrom
(
*
chassis
);
});
trajectory_reader_
=
node_
->
CreateReader
<
ADCTrajectory
>
(
control_conf_
.
planning_channel
()
,
FLAGS_planning_trajectory_topic
,
[
this
](
const
std
::
shared_ptr
<
ADCTrajectory
>
&
trajectory
)
{
ADEBUG
<<
"Received chassis data: run trajectory callback."
;
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
...
...
@@ -80,7 +79,7 @@ bool ControlComponent::Init() {
});
localization_reader_
=
node_
->
CreateReader
<
LocalizationEstimate
>
(
control_conf_
.
localization_channel
()
,
FLAGS_localization_topic
,
[
this
](
const
std
::
shared_ptr
<
LocalizationEstimate
>
&
localization
)
{
ADEBUG
<<
"Received control data: run localization message callback."
;
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
...
...
@@ -88,14 +87,13 @@ bool ControlComponent::Init() {
});
pad_msg_reader_
=
node_
->
CreateReader
<
PadMessage
>
(
control_conf_
.
pad_msg_channel
(),
[
this
](
const
std
::
shared_ptr
<
PadMessage
>
&
pad_msg
)
{
FLAGS_pad_topic
,
[
this
](
const
std
::
shared_ptr
<
PadMessage
>
&
pad_msg
)
{
ADEBUG
<<
"Received control data: run pad message callback."
;
OnPad
(
*
pad_msg
);
});
control_cmd_writer_
=
node_
->
CreateWriter
<
ControlCommand
>
(
control_conf_
.
control_command_channel
()
);
control_cmd_writer_
=
node_
->
CreateWriter
<
ControlCommand
>
(
FLAGS_control_command_topic
);
// set initial vehicle state by cmd
// need to sleep, because advertised channel is not ready immediately
...
...
modules/prediction/prediction_component.cc
浏览文件 @
f3bf51ee
...
...
@@ -32,13 +32,13 @@
#include "modules/prediction/common/prediction_gflags.h"
#include "modules/prediction/common/prediction_map.h"
#include "modules/prediction/common/validation_checker.h"
#include "modules/prediction/scenario/scenario_manager.h"
#include "modules/prediction/container/container_manager.h"
#include "modules/prediction/container/obstacles/obstacles_container.h"
#include "modules/prediction/container/pose/pose_container.h"
#include "modules/prediction/evaluator/evaluator_manager.h"
#include "modules/prediction/predictor/predictor_manager.h"
#include "modules/prediction/proto/prediction_obstacle.pb.h"
#include "modules/prediction/scenario/scenario_manager.h"
#include "modules/prediction/util/data_extraction.h"
namespace
apollo
{
...
...
@@ -57,9 +57,7 @@ using apollo::perception::PerceptionObstacle;
using
apollo
::
perception
::
PerceptionObstacles
;
using
apollo
::
planning
::
ADCTrajectory
;
PredictionComponent
::~
PredictionComponent
()
{
Stop
();
}
PredictionComponent
::~
PredictionComponent
()
{
Stop
();
}
std
::
string
PredictionComponent
::
Name
()
const
{
return
FLAGS_prediction_module_name
;
...
...
@@ -126,12 +124,12 @@ bool PredictionComponent::Init() {
}
planning_reader_
=
node_
->
CreateReader
<
ADCTrajectory
>
(
FLAGS_planning_trajectory_topic
,
[
this
](
const
std
::
shared_ptr
<
ADCTrajectory
>&
adc_trajectory
)
{
ADEBUG
<<
"Received planning data: run planning callback."
;
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
OnPlanning
(
*
adc_trajectory
);
});
FLAGS_planning_trajectory_topic
,
[
this
](
const
std
::
shared_ptr
<
ADCTrajectory
>&
adc_trajectory
)
{
ADEBUG
<<
"Received planning data: run planning callback."
;
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
OnPlanning
(
*
adc_trajectory
);
});
// Initialization of all managers
ContainerManager
::
Instance
()
->
Init
(
adapter_conf_
);
...
...
@@ -170,7 +168,6 @@ bool PredictionComponent::Init() {
}
Stop
();
// TODO(kechxu) accord to cybertron
// ros::shutdown();
}
return
true
;
}
...
...
@@ -209,8 +206,8 @@ bool PredictionComponent::Proc(
const
std
::
shared_ptr
<
PerceptionObstacles
>&
perception_obstacles
,
const
std
::
shared_ptr
<
LocalizationEstimate
>&
localization
)
{
if
(
FLAGS_prediction_test_mode
&&
(
Clock
::
NowInSeconds
()
-
component_start_time_
>
FLAGS_prediction_test_duration
))
{
(
Clock
::
NowInSeconds
()
-
component_start_time_
>
FLAGS_prediction_test_duration
))
{
ADEBUG
<<
"Prediction finished running in test mode"
;
// TODO(kechxu) accord to cybertron
// ros::shutdown();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录