Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
10333917
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,体验更适合开发者的 AI 搜索 >>
提交
10333917
编写于
10月 18, 2019
作者:
K
kechxu
提交者:
Kecheng Xu
10月 18, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: initialize scenario submodule
上级
72f9e5c3
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
191 addition
and
9 deletion
+191
-9
modules/prediction/container/obstacles/BUILD
modules/prediction/container/obstacles/BUILD
+1
-0
modules/prediction/container/obstacles/obstacles_container.cc
...les/prediction/container/obstacles/obstacles_container.cc
+4
-4
modules/prediction/container/obstacles/obstacles_container.h
modules/prediction/container/obstacles/obstacles_container.h
+2
-1
modules/prediction/proto/BUILD
modules/prediction/proto/BUILD
+23
-0
modules/prediction/proto/submodule_messages.proto
modules/prediction/proto/submodule_messages.proto
+20
-0
modules/prediction/submodules/BUILD
modules/prediction/submodules/BUILD
+30
-0
modules/prediction/submodules/container_submodule.cc
modules/prediction/submodules/container_submodule.cc
+8
-3
modules/prediction/submodules/container_submodule.h
modules/prediction/submodules/container_submodule.h
+2
-1
modules/prediction/submodules/scenario_submodule.cc
modules/prediction/submodules/scenario_submodule.cc
+34
-0
modules/prediction/submodules/scenario_submodule.h
modules/prediction/submodules/scenario_submodule.h
+67
-0
未找到文件。
modules/prediction/container/obstacles/BUILD
浏览文件 @
10333917
...
...
@@ -16,6 +16,7 @@ cc_library(
"//modules/prediction/container"
,
"//modules/prediction/container/obstacles:obstacle"
,
"//modules/prediction/proto:prediction_proto"
,
"//modules/prediction/proto:submodule_messages_proto"
,
],
)
...
...
modules/prediction/container/obstacles/obstacles_container.cc
浏览文件 @
10333917
...
...
@@ -438,8 +438,8 @@ bool ObstaclesContainer::IsMovable(
double
ObstaclesContainer
::
timestamp
()
const
{
return
timestamp_
;
}
Prediction
Obstacles
ObstaclesContainer
::
GetPredictionObstacles
()
{
Prediction
Obstacles
prediction_obstacles
;
Prediction
ContainerMessage
ObstaclesContainer
::
GetContainerMessage
()
{
Prediction
ContainerMessage
container_message
;
for
(
const
auto
&
id_pair
:
curr_frame_id_mapping_
)
{
int
id
=
id_pair
.
second
;
Obstacle
*
obstacle_ptr
=
GetObstacle
(
id
);
...
...
@@ -449,11 +449,11 @@ PredictionObstacles ObstaclesContainer::GetPredictionObstacles() {
}
PredictionObstacle
prediction_obstacle
=
obstacle_ptr
->
GeneratePredictionObstacle
();
prediction_obstacles
.
add_prediction_obstacle
()
->
CopyFrom
(
container_message
.
add_prediction_obstacle
()
->
CopyFrom
(
prediction_obstacle
);
}
// TODO(kechxu) add other info into prediction_obstacles if needed
return
prediction_obstacles
;
return
container_message
;
}
}
// namespace prediction
...
...
modules/prediction/container/obstacles/obstacles_container.h
浏览文件 @
10333917
...
...
@@ -30,6 +30,7 @@
#include "modules/prediction/container/container.h"
#include "modules/prediction/container/obstacles/obstacle.h"
#include "modules/prediction/proto/prediction_obstacle.pb.h"
#include "modules/prediction/proto/submodule_messages.pb.h"
namespace
apollo
{
namespace
prediction
{
...
...
@@ -133,7 +134,7 @@ class ObstaclesContainer : public Container {
double
timestamp
()
const
;
Prediction
Obstacles
GetPredictionObstacles
();
Prediction
ContainerMessage
GetContainerMessage
();
private:
Obstacle
*
GetObstacleWithLRUUpdate
(
const
int
obstacle_id
);
...
...
modules/prediction/proto/BUILD
浏览文件 @
10333917
...
...
@@ -212,3 +212,26 @@ proto_library(
"//modules/common/proto:geometry_proto_lib"
,
],
)
cc_proto_library
(
name
=
"submodule_messages_proto"
,
deps
=
[
":submodule_messages_proto_lib"
,
],
)
proto_library
(
name
=
"submodule_messages_proto_lib"
,
srcs
=
[
"submodule_messages.proto"
,
],
deps
=
[
"//modules/common/proto:error_code_proto_lib"
,
"//modules/common/proto:header_proto_lib"
,
"//modules/common/proto:pnc_point_proto_lib"
,
"//modules/perception/proto:perception_proto_lib"
,
"//modules/prediction/proto:feature_proto_lib"
,
"//modules/prediction/proto:scenario_proto_lib"
,
"//modules/prediction/proto:prediction_proto_lib"
,
],
)
modules/prediction/proto/submodule_messages.proto
0 → 100644
浏览文件 @
10333917
syntax
=
"proto2"
;
package
apollo
.
prediction
;
import
"modules/common/proto/header.proto"
;
import
"modules/prediction/proto/prediction_obstacle.proto"
;
message
PredictionContainerMessage
{
// timestamp is included in header
optional
apollo.common.Header
header
=
1
;
// make prediction for multiple obstacles
repeated
PredictionObstacle
prediction_obstacle
=
2
;
// start timestamp
optional
double
start_timestamp
=
3
;
// end timestamp
optional
double
end_timestamp
=
4
;
}
modules/prediction/submodules/BUILD
浏览文件 @
10333917
...
...
@@ -21,6 +21,7 @@ cc_library(
"//modules/prediction/common:prediction_gflags"
,
"//modules/prediction/container:container_manager"
,
"//modules/prediction/container/obstacles:obstacles_container"
,
"//modules/prediction/proto:submodule_messages_proto"
,
],
)
...
...
@@ -31,4 +32,33 @@ cc_binary(
deps
=
[
":container_submodule_lib"
],
)
cc_library
(
name
=
"scenario_submodule_lib"
,
srcs
=
[
"scenario_submodule.cc"
],
hdrs
=
[
"scenario_submodule.h"
,
],
copts
=
[
"-DMODULE_NAME=
\\\"
scenario_submodule
\\\"
"
,
],
deps
=
[
"//cyber"
,
"//modules/common/adapters:adapter_gflags"
,
"//modules/common/adapters/proto:adapter_config_proto"
,
"//modules/common/time"
,
"//modules/perception/proto:perception_proto"
,
"//modules/prediction/common:message_process"
,
"//modules/prediction/common:prediction_gflags"
,
"//modules/prediction/scenario:scenario_manager"
,
"//modules/prediction/proto:submodule_messages_proto"
,
],
)
cc_binary
(
name
=
"scenario_submodule.so"
,
linkshared
=
True
,
linkstatic
=
False
,
deps
=
[
":scenario_submodule_lib"
],
)
cpplint
()
modules/prediction/submodules/container_submodule.cc
浏览文件 @
10333917
...
...
@@ -53,8 +53,8 @@ bool ContainerSubmodule::Init() {
FLAGS_localization_topic
,
nullptr
);
// TODO(kechxu) change topic name when finalized
prediction
_writer_
=
node_
->
CreateWriter
<
Prediction
Obstacles
>
(
FLAGS_prediction_topic
);
container
_writer_
=
node_
->
CreateWriter
<
Prediction
ContainerMessage
>
(
FLAGS_prediction_topic
);
return
true
;
}
...
...
@@ -66,7 +66,12 @@ bool ContainerSubmodule::Proc(
ContainerManager
::
Instance
()
->
GetContainer
<
ObstaclesContainer
>
(
AdapterConfig
::
PERCEPTION_OBSTACLES
);
CHECK_NOTNULL
(
obstacles_container_ptr
);
// TODO(kechxu): implement the writer
PredictionContainerMessage
container_message
=
obstacles_container_ptr
->
GetContainerMessage
();
container_writer_
->
Write
(
std
::
make_shared
<
PredictionContainerMessage
>
(
container_message
));
return
true
;
}
...
...
modules/prediction/submodules/container_submodule.h
浏览文件 @
10333917
...
...
@@ -29,6 +29,7 @@
#include "modules/perception/proto/perception_obstacle.pb.h"
#include "modules/planning/proto/planning.pb.h"
#include "modules/prediction/proto/prediction_obstacle.pb.h"
#include "modules/prediction/proto/submodule_messages.pb.h"
/**
* @namespace apollo::prediction
...
...
@@ -73,7 +74,7 @@ class ContainerSubmodule
std
::
shared_ptr
<
cyber
::
Reader
<
localization
::
LocalizationEstimate
>>
localization_reader_
;
std
::
shared_ptr
<
cyber
::
Writer
<
Prediction
Obstacles
>>
prediction
_writer_
;
std
::
shared_ptr
<
cyber
::
Writer
<
Prediction
ContainerMessage
>>
container
_writer_
;
};
CYBER_REGISTER_COMPONENT
(
ContainerSubmodule
)
...
...
modules/prediction/submodules/scenario_submodule.cc
0 → 100644
浏览文件 @
10333917
/******************************************************************************
* Copyright 2019 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.
*****************************************************************************/
#include "modules/prediction/submodules/scenario_submodule.h"
namespace
apollo
{
namespace
prediction
{
bool
ScenarioSubmodule
::
Init
()
{
// TODO(kechxu) implement
return
true
;
}
bool
ScenarioSubmodule
::
Proc
(
const
std
::
shared_ptr
<
PredictionContainerMessage
>&
container_message
)
{
// TODO(kechxu) implement
return
true
;
}
}
// namespace prediction
}
// namespace apollo
modules/prediction/submodules/scenario_submodule.h
0 → 100644
浏览文件 @
10333917
/******************************************************************************
* Copyright 2019 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
* @brief Use scenario submodule to deal with scenario-related tasks
*/
#pragma once
#include <memory>
#include <string>
#include "cyber/component/component.h"
#include "modules/prediction/proto/submodule_messages.pb.h"
namespace
apollo
{
namespace
prediction
{
class
ScenarioSubmodule
:
public
cyber
::
Component
<
PredictionContainerMessage
>
{
public:
/**
* @brief Destructor
*/
~
ScenarioSubmodule
();
/**
* @brief Get name of the node
* @return Name of the node
*/
std
::
string
Name
()
const
;
/**
* @brief Initialize the node
* @return If initialized
*/
bool
Init
()
override
;
/**
* @brief Data callback upon receiving a prediction container message.
* @param Prediction container message.
*/
bool
Proc
(
const
std
::
shared_ptr
<
PredictionContainerMessage
>&
)
override
;
private:
// TODO(kechxu) define storytelling reader
// TODO(kechxu) define writer
};
CYBER_REGISTER_COMPONENT
(
ScenarioSubmodule
)
}
// namespace prediction
}
// namespace apollo
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录