Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
191f3b72
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,发现更多精彩内容 >>
提交
191f3b72
编写于
7月 17, 2017
作者:
D
Dong Li
提交者:
GitHub
7月 17, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14 from jinghaomiao/jinghao_dev
Added lint support for prediction module.
上级
8420ea97
0edf54f0
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
104 addition
and
67 deletion
+104
-67
modules/prediction/BUILD
modules/prediction/BUILD
+4
-0
modules/prediction/common/BUILD
modules/prediction/common/BUILD
+4
-0
modules/prediction/common/prediction_gflags.cc
modules/prediction/common/prediction_gflags.cc
+3
-2
modules/prediction/container/BUILD
modules/prediction/container/BUILD
+5
-1
modules/prediction/container/container.h
modules/prediction/container/container.h
+3
-3
modules/prediction/container/container_manager.cc
modules/prediction/container/container_manager.cc
+2
-2
modules/prediction/container/container_manager.h
modules/prediction/container/container_manager.h
+4
-3
modules/prediction/container/obstacles/BUILD
modules/prediction/container/obstacles/BUILD
+4
-0
modules/prediction/container/obstacles/obstacle.cc
modules/prediction/container/obstacles/obstacle.cc
+6
-5
modules/prediction/container/obstacles/obstacle.h
modules/prediction/container/obstacles/obstacle.h
+2
-2
modules/prediction/container/obstacles/obstacles_container.h
modules/prediction/container/obstacles/obstacles_container.h
+5
-5
modules/prediction/container/pose/BUILD
modules/prediction/container/pose/BUILD
+5
-1
modules/prediction/container/pose/pose_container.h
modules/prediction/container/pose/pose_container.h
+5
-5
modules/prediction/evaluator/BUILD
modules/prediction/evaluator/BUILD
+5
-1
modules/prediction/evaluator/evaluator.h
modules/prediction/evaluator/evaluator.h
+4
-3
modules/prediction/evaluator/evaluator_factory.cc
modules/prediction/evaluator/evaluator_factory.cc
+2
-2
modules/prediction/evaluator/evaluator_factory.h
modules/prediction/evaluator/evaluator_factory.h
+3
-3
modules/prediction/evaluator/evaluator_manager.cc
modules/prediction/evaluator/evaluator_manager.cc
+2
-2
modules/prediction/evaluator/evaluator_manager.h
modules/prediction/evaluator/evaluator_manager.h
+5
-4
modules/prediction/prediction.cc
modules/prediction/prediction.cc
+2
-3
modules/prediction/prediction.h
modules/prediction/prediction.h
+7
-5
modules/prediction/predictor/BUILD
modules/prediction/predictor/BUILD
+5
-1
modules/prediction/predictor/predictor.h
modules/prediction/predictor/predictor.h
+3
-3
modules/prediction/predictor/predictor_factory.cc
modules/prediction/predictor/predictor_factory.cc
+2
-2
modules/prediction/predictor/predictor_factory.h
modules/prediction/predictor/predictor_factory.h
+3
-3
modules/prediction/predictor/predictor_manager.cc
modules/prediction/predictor/predictor_manager.cc
+3
-2
modules/prediction/predictor/predictor_manager.h
modules/prediction/predictor/predictor_manager.h
+6
-4
未找到文件。
modules/prediction/BUILD
浏览文件 @
191f3b72
load
(
"//tools:cpplint.bzl"
,
"cpplint"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
...
...
@@ -28,3 +30,5 @@ cc_binary(
"//external:gflags"
,
],
)
cpplint
()
modules/prediction/common/BUILD
浏览文件 @
191f3b72
load
(
"//tools:cpplint.bzl"
,
"cpplint"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
...
...
@@ -9,3 +11,5 @@ cc_library(
"//modules/prediction/proto:prediction_proto"
,
],
)
cpplint
()
modules/prediction/common/prediction_gflags.cc
浏览文件 @
191f3b72
...
...
@@ -19,7 +19,8 @@
// System gflags
DEFINE_string
(
prediction_module_name
,
"prediction"
,
"Default prediciton module name"
);
DEFINE_string
(
prediction_conf_file
,
"modules/prediction/conf/prediction_conf.pb.txt"
,
DEFINE_string
(
prediction_conf_file
,
"modules/prediction/conf/prediction_conf.pb.txt"
,
"Default conf file for prediction"
);
// Features
...
...
@@ -32,4 +33,4 @@ DEFINE_double(p_var, 0.1, "Error covariance");
DEFINE_double
(
go_approach_rate
,
0.995
,
"The rate to approach to the reference line of going straight"
);
DEFINE_double
(
cutin_approach_rate
,
0.9
,
"The rate to approach to the reference line of lane change"
);
\ No newline at end of file
"The rate to approach to the reference line of lane change"
);
modules/prediction/container/BUILD
浏览文件 @
191f3b72
load
(
"//tools:cpplint.bzl"
,
"cpplint"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
...
...
@@ -18,4 +20,6 @@ cc_library(
deps
=
[
"@com_github_google_protobuf//:protobuf"
]
)
\ No newline at end of file
)
cpplint
()
\ No newline at end of file
modules/prediction/container/container.h
浏览文件 @
191f3b72
...
...
@@ -50,7 +50,7 @@ class Container {
virtual
void
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
=
0
;
};
}
// namespace prediction
}
// namespace apollo
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_CONTAINER_CONTAINER_H_
#endif
// MODULES_PREDICTION_CONTAINER_CONTAINER_H_
modules/prediction/container/container_manager.cc
浏览文件 @
191f3b72
...
...
@@ -56,5 +56,5 @@ void ContainerManager::RegisterContainer(const std::string& name) {
containers_
[
name
]
=
CreateContainer
(
name
);
}
}
}
}
// namespace prediction
}
// namespace apollo
modules/prediction/container/container_manager.h
浏览文件 @
191f3b72
...
...
@@ -24,6 +24,7 @@
#include <unordered_map>
#include <string>
#include <memory>
#include "modules/prediction/container/container.h"
#include "modules/common/macro.h"
...
...
@@ -65,7 +66,7 @@ class ContainerManager {
DECLARE_SINGLETON
(
ContainerManager
)
};
}
// namespace prediction
}
// namespace apollo
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_CONTAINER_CONTAINER_MANAGER_H_
#endif
// MODULES_PREDICTION_CONTAINER_CONTAINER_MANAGER_H_
modules/prediction/container/obstacles/BUILD
浏览文件 @
191f3b72
load
(
"//tools:cpplint.bzl"
,
"cpplint"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
...
...
@@ -23,3 +25,5 @@ cc_library(
"//modules/prediction/common:prediction_common"
,
],
)
cpplint
()
modules/prediction/container/obstacles/obstacle.cc
浏览文件 @
191f3b72
...
...
@@ -19,6 +19,7 @@
#include <iomanip>
#include <cmath>
#include <unordered_set>
#include <utility>
#include "modules/common/log.h"
#include "modules/common/math/math_utils.h"
...
...
@@ -42,7 +43,7 @@ double Damp(const double x, const double sigma) {
}
// namespace
Obstacle
::
Obstacle
()
:
Obstacle
::
Obstacle
()
:
id_
(
-
1
),
type_
(
PerceptionObstacle
::
UNKNOWN_MOVABLE
),
feature_history_
(
0
),
...
...
@@ -88,14 +89,14 @@ Feature* Obstacle::mutable_feature(size_t i) {
const
Feature
&
Obstacle
::
latest_feature
()
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
CHECK
(
feature_history_
.
size
()
>
0
);
CHECK
_GT
(
feature_history_
.
size
(),
0
);
return
feature_history_
.
front
();
}
Feature
*
Obstacle
::
mutable_latest_feature
()
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
CHECK
(
feature_history_
.
size
()
>
0
);
CHECK
_GT
(
feature_history_
.
size
(),
0
);
return
&
(
feature_history_
.
front
());
}
...
...
@@ -381,8 +382,8 @@ void Obstacle::InitKFMotionTracker(Feature* feature) {
kf_motion_tracker_enabled_
=
true
;
}
void
Obstacle
::
UpdateKFMotionTracker
(
Feature
*
feature
)
{
double
delta_ts
=
0.0
;
void
Obstacle
::
UpdateKFMotionTracker
(
Feature
*
feature
)
{
double
delta_ts
=
0.0
;
if
(
feature_history_
.
size
()
>
0
)
{
delta_ts
=
feature
->
timestamp
()
-
feature_history_
.
front
().
timestamp
();
}
...
...
modules/prediction/container/obstacles/obstacle.h
浏览文件 @
191f3b72
...
...
@@ -39,7 +39,7 @@ namespace prediction {
class
Obstacle
{
public:
explicit
Obstacle
();
Obstacle
();
virtual
~
Obstacle
();
...
...
@@ -138,4 +138,4 @@ class Obstacle {
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_CONTAINER_OBSTACLES_OBSTACLE_H_
#endif // MODULES_PREDICTION_CONTAINER_OBSTACLES_OBSTACLE_H_
modules/prediction/container/obstacles/obstacles_container.h
浏览文件 @
191f3b72
...
...
@@ -32,7 +32,7 @@ class ObstaclesContainer : public Container {
/**
* @brief Constructor
*/
explicit
ObstaclesContainer
()
=
default
;
ObstaclesContainer
()
=
default
;
/**
* @brief Destructor
...
...
@@ -43,10 +43,10 @@ class ObstaclesContainer : public Container {
* @brief Insert a data message into the container
* @param Data message to be inserted in protobuf
*/
v
irtual
v
oid
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
override
;
void
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
override
;
};
}
// namespace prediction
}
// namespace apollo
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_CONTAINER_OBSTACLES_OBSTACLES_H_
#endif
// MODULES_PREDICTION_CONTAINER_OBSTACLES_OBSTACLES_H_
modules/prediction/container/pose/BUILD
浏览文件 @
191f3b72
load
(
"//tools:cpplint.bzl"
,
"cpplint"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
...
...
@@ -7,4 +9,6 @@ cc_library(
deps
=
[
"//modules/prediction/container:container"
,
]
)
\ No newline at end of file
)
cpplint
()
\ No newline at end of file
modules/prediction/container/pose/pose_container.h
浏览文件 @
191f3b72
...
...
@@ -32,7 +32,7 @@ class PoseContainer : public Container {
/**
* @brief Constructor
*/
explicit
PoseContainer
()
=
default
;
PoseContainer
()
=
default
;
/**
* @brief Destructor
...
...
@@ -43,10 +43,10 @@ class PoseContainer : public Container {
* @brief Insert a data message into the container
* @param Data message to be inserted in protobuf
*/
v
irtual
v
oid
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
override
;
void
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
override
;
};
}
// namespace prediction
}
// namespace apollo
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_CONTAINER_POSE_OBSTACLES_H_
#endif
// MODULES_PREDICTION_CONTAINER_POSE_OBSTACLES_H_
modules/prediction/evaluator/BUILD
浏览文件 @
191f3b72
load
(
"//tools:cpplint.bzl"
,
"cpplint"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
...
...
@@ -31,4 +33,6 @@ cc_library(
deps
=
[
]
)
\ No newline at end of file
)
cpplint
()
\ No newline at end of file
modules/prediction/evaluator/evaluator.h
浏览文件 @
191f3b72
...
...
@@ -44,7 +44,8 @@ class Evaluator {
virtual
~
Evaluator
()
=
default
;
};
}
// namespace prediction
}
// namespace apollo
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_EVALUATOR_EVALUATOR_H_
#endif // MODULES_PREDICTION_EVALUATOR_EVALUATOR_H_
modules/prediction/evaluator/evaluator_factory.cc
浏览文件 @
191f3b72
...
...
@@ -39,5 +39,5 @@ std::unique_ptr<Evaluator> EvaluatorFactory::CreateEvaluator(
return
evaluator
;
}
}
}
\ No newline at end of file
}
// namespace prediction
}
// namespace apollo
modules/prediction/evaluator/evaluator_factory.h
浏览文件 @
191f3b72
...
...
@@ -57,7 +57,7 @@ class EvaluatorFactory
DECLARE_SINGLETON
(
EvaluatorFactory
);
};
}
// namespace prediction
}
// namespace apollo
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_EVALUATOR_EVALUATOR_FACTORY_H_
\ No newline at end of file
#endif // MODULES_PREDICTION_EVALUATOR_EVALUATOR_FACTORY_H_
modules/prediction/evaluator/evaluator_manager.cc
浏览文件 @
191f3b72
...
...
@@ -28,5 +28,5 @@ const Evaluator* EvaluatorManager::GetEvaluator() {
void
EvaluatorManager
::
Run
(
const
::
apollo
::
perception
::
PerceptionObstacles
&
perception_obstacles
)
{}
}
}
}
// namespace prediction
}
// namespace apollo
modules/prediction/evaluator/evaluator_manager.h
浏览文件 @
191f3b72
...
...
@@ -48,12 +48,13 @@ class EvaluatorManager {
*/
const
Evaluator
*
GetEvaluator
();
void
Run
(
const
::
apollo
::
perception
::
PerceptionObstacles
&
perception_obstacles
);
void
Run
(
const
::
apollo
::
perception
::
PerceptionObstacles
&
perception_obstacles
);
DECLARE_SINGLETON
(
EvaluatorManager
)
};
}
// namespace prediction
}
// namespace apollo
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_EVALUATOR_EVALUATOR_MANAGER_H_
#endif
// MODULES_PREDICTION_EVALUATOR_EVALUATOR_MANAGER_H_
modules/prediction/prediction.cc
浏览文件 @
191f3b72
...
...
@@ -16,13 +16,13 @@
#include "modules/prediction/prediction.h"
#include "modules/prediction/proto/prediction_obstacle.pb.h"
#include "modules/common/adapters/adapter_manager.h"
#include "modules/prediction/container/container_manager.h"
#include "modules/prediction/evaluator/evaluator_manager.h"
#include "modules/prediction/predictor/predictor_manager.h"
#include "modules/prediction/common/prediction_gflags.h"
#include "modules/prediction/proto/prediction_obstacle.pb.h"
#include "modules/common/util/file.h"
namespace
apollo
{
...
...
@@ -81,7 +81,6 @@ void Prediction::OnPerception(const PerceptionObstacles &perception_obstacles) {
}
ContainerManager
::
instance
()
->
mutable_container
(
"Obstacles"
)
->
Insert
(
perception_obstacles
);
ContainerManager
::
instance
()
->
mutable_container
(
"Obstacles"
)
->
Insert
(
perception_obstacles
);
EvaluatorManager
::
instance
()
->
Run
(
perception_obstacles
);
PredictorManager
::
instance
()
->
Run
(
perception_obstacles
);
// AdapterManager::PublishPrediction(PredictorManager::instance()->GetPredictions());
...
...
modules/prediction/prediction.h
浏览文件 @
191f3b72
...
...
@@ -21,6 +21,8 @@
#ifndef MODULES_PREDICTION_PREDICTION_H_
#define MODULES_PREDICTION_PREDICTION_H_
#include <string>
#include "ros/include/ros/ros.h"
#include "modules/perception/proto/perception_obstacle.pb.h"
#include "modules/prediction/proto/prediction_conf.pb.h"
...
...
@@ -38,30 +40,30 @@ class Prediction : public apollo::common::ApolloApp {
/**
* @brief Destructor
*/
virtual
~
Prediction
()
=
default
;
~
Prediction
()
=
default
;
/**
* @brief Get name of the node
* @return Name of the node
*/
virtual
std
::
string
Name
()
const
override
;
std
::
string
Name
()
const
override
;
/**
* @brief Initialize the node
* @return Status of the initialization
*/
virtual
::
apollo
::
common
::
Status
Init
()
override
;
::
apollo
::
common
::
Status
Init
()
override
;
/**
* @brief Start the node
* @return Status of the starting process
*/
virtual
::
apollo
::
common
::
Status
Start
()
override
;
::
apollo
::
common
::
Status
Start
()
override
;
/**
* @brief Stop the node
*/
v
irtual
v
oid
Stop
()
override
;
void
Stop
()
override
;
private:
::
apollo
::
common
::
Status
OnError
(
const
std
::
string
&
error_msg
);
...
...
modules/prediction/predictor/BUILD
浏览文件 @
191f3b72
load
(
"//tools:cpplint.bzl"
,
"cpplint"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
...
...
@@ -31,4 +33,6 @@ cc_library(
deps
=
[
]
)
\ No newline at end of file
)
cpplint
()
\ No newline at end of file
modules/prediction/predictor/predictor.h
浏览文件 @
191f3b72
...
...
@@ -44,7 +44,7 @@ class Predictor {
virtual
~
Predictor
()
=
default
;
};
}
// namespace prediction
}
// namespace apollo
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_PREDICTOR_PREDICTOR_H_
#endif
// MODULES_PREDICTION_PREDICTOR_PREDICTOR_H_
modules/prediction/predictor/predictor_factory.cc
浏览文件 @
191f3b72
...
...
@@ -39,5 +39,5 @@ std::unique_ptr<Predictor> PredictorFactory::CreatePredictor(
return
predictor
;
}
}
}
\ No newline at end of file
}
// namespace prediction
}
// namespace apollo
modules/prediction/predictor/predictor_factory.h
浏览文件 @
191f3b72
...
...
@@ -57,7 +57,7 @@ class PredictorFactory
DECLARE_SINGLETON
(
PredictorFactory
);
};
}
// namespace prediction
}
// namespace apollo
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_PREDICTOR_PREDICTOR_FACTORY_H_
\ No newline at end of file
#endif // MODULES_PREDICTION_PREDICTOR_PREDICTOR_FACTORY_H_
modules/prediction/predictor/predictor_manager.cc
浏览文件 @
191f3b72
...
...
@@ -28,5 +28,6 @@ const Predictor* PredictorManager::GetPredictor() {
void
PredictorManager
::
Run
(
const
::
apollo
::
perception
::
PerceptionObstacles
&
perception_obstacles
)
{}
}
}
}
// namespace prediction
}
// namespace apollo
modules/prediction/predictor/predictor_manager.h
浏览文件 @
191f3b72
...
...
@@ -48,12 +48,14 @@ class PredictorManager {
*/
const
Predictor
*
GetPredictor
();
void
Run
(
const
::
apollo
::
perception
::
PerceptionObstacles
&
perception_obstacles
);
void
Run
(
const
::
apollo
::
perception
::
PerceptionObstacles
&
perception_obstacles
);
DECLARE_SINGLETON
(
PredictorManager
)
};
}
// namespace prediction
}
// namespace apollo
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_PREDICTOR_PREDICTOR_MANAGER_H_
#endif // MODULES_PREDICTION_PREDICTOR_PREDICTOR_MANAGER_H_
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录