Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
19c9b1d5
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,发现更多精彩内容 >>
提交
19c9b1d5
编写于
9月 19, 2018
作者:
Y
Yajia Zhang
提交者:
Kecheng Xu
9月 19, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
prediction: added ScenarioFeatures class
上级
9b361811
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
251 addition
and
0 deletion
+251
-0
modules/prediction/common/BUILD
modules/prediction/common/BUILD
+9
-0
modules/prediction/common/scenario_features.cc
modules/prediction/common/scenario_features.cc
+128
-0
modules/prediction/common/scenario_features.h
modules/prediction/common/scenario_features.h
+114
-0
未找到文件。
modules/prediction/common/BUILD
浏览文件 @
19c9b1d5
...
...
@@ -153,4 +153,13 @@ cc_test(
],
)
cc_library
(
name
=
"scenario_features"
,
srcs
=
[
"scenario_features.cc"
],
hdrs
=
[
"scenario_features.h"
],
deps
=
[
"//framework:cybertron"
,
],
)
cpplint
()
modules/prediction/common/scenario_features.cc
0 → 100644
浏览文件 @
19c9b1d5
/******************************************************************************
* Copyright 2018 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/common/scenario_features.h"
#include "cybertron/common/log.h"
namespace
apollo
{
namespace
prediction
{
void
ScenarioFeatures
::
set_ego_velocity
(
const
double
ego_velocity
)
{
ego_velocity_
=
ego_velocity
;
}
double
ScenarioFeatures
::
get_ego_velocity
()
const
{
return
ego_velocity_
;
}
void
ScenarioFeatures
::
set_ego_acceleration
(
const
double
ego_acceleration
)
{
ego_acceleration_
=
ego_acceleration
;
}
double
ScenarioFeatures
::
get_ego_acceleration
()
const
{
return
ego_acceleration_
;
}
bool
ScenarioFeatures
::
has_ego_lane
()
const
{
return
has_ego_lane_
;
}
void
ScenarioFeatures
::
reset_ego_lane
()
{
has_ego_lane_
=
false
;
}
void
ScenarioFeatures
::
SetEgoLane
(
const
std
::
string
&
lane_id
,
const
double
lane_s
)
{
has_ego_lane_
=
true
;
ego_lane_id_
=
lane_id
;
ego_lane_s_
=
lane_s
;
}
std
::
pair
<
std
::
string
,
double
>
ScenarioFeatures
::
GetEgoLane
()
const
{
CHECK
(
has_ego_lane_
);
return
{
ego_lane_id_
,
ego_lane_s_
};
}
bool
ScenarioFeatures
::
has_left_neighbor_lane
()
const
{
return
has_left_neighbor_lane_
;
}
void
ScenarioFeatures
::
reset_left_neighbor_lane
()
{
has_left_neighbor_lane_
=
false
;
}
void
ScenarioFeatures
::
SetLeftNeighborLane
(
const
std
::
string
&
lane_id
,
const
double
lane_s
)
{
has_left_neighbor_lane_
=
true
;
left_neighbor_lane_id_
=
lane_id
;
left_neighbor_lane_s_
=
lane_s
;
}
std
::
pair
<
std
::
string
,
double
>
ScenarioFeatures
::
GetLeftNeighborLane
()
const
{
CHECK
(
has_left_neighbor_lane_
);
return
{
left_neighbor_lane_id_
,
left_neighbor_lane_s_
};
}
bool
ScenarioFeatures
::
has_right_neighbor_lane
()
const
{
return
has_right_neighbor_lane_
;
}
void
ScenarioFeatures
::
reset_right_neighbor_lane
()
{
has_right_neighbor_lane_
=
false
;
}
void
ScenarioFeatures
::
SetRightNeighborLane
(
const
std
::
string
&
lane_id
,
const
double
lane_s
)
{
has_right_neighbor_lane_
=
true
;
right_neighbor_lane_id_
=
lane_id
;
right_neighbor_lane_s_
=
lane_s
;
}
std
::
pair
<
std
::
string
,
double
>
ScenarioFeatures
::
GetRightNeighborLane
()
const
{
CHECK
(
has_right_neighbor_lane_
);
return
{
right_neighbor_lane_id_
,
right_neighbor_lane_s_
};
}
bool
ScenarioFeatures
::
has_front_junction
()
const
{
return
has_front_junction_
;
}
void
ScenarioFeatures
::
reset_front_junction
()
{
has_front_junction_
=
false
;
}
void
ScenarioFeatures
::
SetFrontJunction
(
const
std
::
string
&
junction_id
,
const
double
dist
)
{
has_front_junction_
=
true
;
front_junction_id_
=
junction_id
;
dist_to_front_junction_
=
dist
;
}
std
::
pair
<
std
::
string
,
double
>
ScenarioFeatures
::
GetFrontJunction
()
const
{
CHECK
(
has_front_junction_
);
return
{
front_junction_id_
,
dist_to_front_junction_
};
}
void
ScenarioFeatures
::
AddObstacleId
(
const
int
obstacle_id
)
{
obstacle_ids_
.
push_back
(
obstacle_id
);
}
const
std
::
vector
<
int
>&
ScenarioFeatures
::
get_obstacle_ids
()
const
{
return
obstacle_ids_
;
}
}
// namespace prediction
}
// namespace apollo
modules/prediction/common/scenario_features.h
0 → 100644
浏览文件 @
19c9b1d5
/******************************************************************************
* Copyright 2018 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.
*****************************************************************************/
#ifndef MODULES_PREDICTION_COMMON_SCENARIO_FEATURES_H_
#define MODULES_PREDICTION_COMMON_SCENARIO_FEATURES_H_
#include <string>
#include <utility>
#include <vector>
namespace
apollo
{
namespace
prediction
{
class
ScenarioFeatures
{
public:
ScenarioFeatures
()
=
default
;
virtual
~
ScenarioFeatures
()
=
default
;
void
set_ego_velocity
(
const
double
ego_velocity
);
double
get_ego_velocity
()
const
;
void
set_ego_acceleration
(
const
double
ego_acceleration
);
double
get_ego_acceleration
()
const
;
bool
has_ego_lane
()
const
;
void
reset_ego_lane
();
void
SetEgoLane
(
const
std
::
string
&
lane_id
,
const
double
lane_s
);
std
::
pair
<
std
::
string
,
double
>
GetEgoLane
()
const
;
bool
has_left_neighbor_lane
()
const
;
void
reset_left_neighbor_lane
();
void
SetLeftNeighborLane
(
const
std
::
string
&
lane_id
,
const
double
lane_s
);
std
::
pair
<
std
::
string
,
double
>
GetLeftNeighborLane
()
const
;
bool
has_right_neighbor_lane
()
const
;
void
reset_right_neighbor_lane
();
void
SetRightNeighborLane
(
const
std
::
string
&
lane_id
,
const
double
lane_s
);
std
::
pair
<
std
::
string
,
double
>
GetRightNeighborLane
()
const
;
bool
has_front_junction
()
const
;
void
reset_front_junction
();
void
SetFrontJunction
(
const
std
::
string
&
junction_id
,
const
double
dist
);
std
::
pair
<
std
::
string
,
double
>
GetFrontJunction
()
const
;
void
AddObstacleId
(
const
int
obstacle_id
);
const
std
::
vector
<
int
>&
get_obstacle_ids
()
const
;
private:
double
ego_velocity_
=
0.0
;
double
ego_acceleration_
=
0.0
;
double
ego_heading_
=
0.0
;
bool
has_ego_lane_
=
false
;
std
::
string
ego_lane_id_
;
double
ego_lane_s_
=
0.0
;
bool
has_left_neighbor_lane_
=
false
;
std
::
string
left_neighbor_lane_id_
;
double
left_neighbor_lane_s_
=
0.0
;
bool
has_right_neighbor_lane_
=
false
;
std
::
string
right_neighbor_lane_id_
;
double
right_neighbor_lane_s_
=
0.0
;
bool
has_front_junction_
=
false
;
std
::
string
front_junction_id_
;
double
dist_to_front_junction_
=
0.0
;
std
::
vector
<
int
>
obstacle_ids_
;
};
}
// namespace prediction
}
// namespace apollo
#endif
/* MODULES_PREDICTION_COMMON_SCENARIO_FEATURES_H_ */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录