Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
d3266006
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,发现更多精彩内容 >>
提交
d3266006
编写于
2月 22, 2018
作者:
S
siyangy
提交者:
Dong Li
2月 22, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Dreamview: downsample prediction points (#2953)
* Dreamview: downsample prediction points * CR response
上级
6585cce6
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
151 addition
and
150 deletion
+151
-150
modules/dreamview/backend/simulation_world/simulation_world_service.cc
...view/backend/simulation_world/simulation_world_service.cc
+18
-13
modules/dreamview/backend/simulation_world/simulation_world_service.h
...mview/backend/simulation_world/simulation_world_service.h
+5
-2
modules/dreamview/backend/simulation_world/simulation_world_service_test.cc
...backend/simulation_world/simulation_world_service_test.cc
+1
-8
modules/dreamview/frontend/dist/2cb1e1fc341fc1283f2f.worker.js
...es/dreamview/frontend/dist/2cb1e1fc341fc1283f2f.worker.js
+2
-2
modules/dreamview/frontend/dist/2cb1e1fc341fc1283f2f.worker.js.map
...reamview/frontend/dist/2cb1e1fc341fc1283f2f.worker.js.map
+1
-1
modules/dreamview/frontend/dist/app.bundle.js
modules/dreamview/frontend/dist/app.bundle.js
+2
-2
modules/dreamview/frontend/dist/app.bundle.js.map
modules/dreamview/frontend/dist/app.bundle.js.map
+1
-1
modules/dreamview/frontend/dist/navigation.bundle.js
modules/dreamview/frontend/dist/navigation.bundle.js
+1
-1
modules/dreamview/frontend/dist/navigation.bundle.js.map
modules/dreamview/frontend/dist/navigation.bundle.js.map
+1
-1
modules/dreamview/frontend/proto_bundle/map_proto_bundle.json
...les/dreamview/frontend/proto_bundle/map_proto_bundle.json
+118
-118
modules/dreamview/frontend/src/renderer/prediction.js
modules/dreamview/frontend/src/renderer/prediction.js
+1
-1
未找到文件。
modules/dreamview/backend/simulation_world/simulation_world_service.cc
浏览文件 @
d3266006
...
...
@@ -23,6 +23,7 @@
#include "google/protobuf/util/json_util.h"
#include "modules/canbus/proto/chassis.pb.h"
#include "modules/common/configs/vehicle_config_helper.h"
#include "modules/common/math/quaternion.h"
#include "modules/common/proto/geometry.pb.h"
#include "modules/common/proto/vehicle_signal.pb.h"
...
...
@@ -39,7 +40,6 @@
#include "modules/planning/proto/planning.pb.h"
#include "modules/planning/proto/planning_internal.pb.h"
#include "modules/prediction/proto/prediction_obstacle.pb.h"
#include "modules/common/configs/vehicle_config_helper.h"
namespace
apollo
{
namespace
dreamview
{
...
...
@@ -51,6 +51,7 @@ using apollo::common::VehicleConfigHelper;
using
apollo
::
common
::
adapter
::
AdapterManager
;
using
apollo
::
common
::
monitor
::
MonitorMessage
;
using
apollo
::
common
::
monitor
::
MonitorMessageItem
;
using
apollo
::
common
::
PathPoint
;
using
apollo
::
common
::
time
::
Clock
;
using
apollo
::
common
::
time
::
ToSecond
;
using
apollo
::
common
::
time
::
millis
;
...
...
@@ -756,10 +757,8 @@ void SimulationWorldService::UpdatePlanningData(const PlanningData &data) {
planning_data
->
clear_path
();
for
(
auto
&
path
:
data
.
path
())
{
// Downsample the path points for frontend display.
// Angle threshold is about 5.72 degree.
constexpr
double
angle_threshold
=
0.1
;
std
::
vector
<
int
>
sampled_indices
=
DownsampleByAngle
(
path
.
path_point
(),
angle_threshold
);
auto
sampled_indices
=
DownsampleByAngle
(
path
.
path_point
(),
kAngleThreshold
);
auto
*
downsampled_path
=
planning_data
->
add_path
();
downsampled_path
->
set_name
(
path
.
name
());
...
...
@@ -809,14 +808,22 @@ void SimulationWorldService::UpdateSimulationWorld(
}
void
SimulationWorldService
::
CreatePredictionTrajectory
(
Object
*
world_object
,
const
PredictionObstacle
&
obstacle
)
{
const
PredictionObstacle
&
obstacle
,
Object
*
world_object
)
{
for
(
const
auto
&
traj
:
obstacle
.
trajectory
())
{
Prediction
*
prediction
=
world_object
->
add_prediction
();
prediction
->
set_probability
(
traj
.
probability
());
std
::
vector
<
PathPoint
>
points
;
for
(
const
auto
&
point
:
traj
.
trajectory_point
())
{
points
.
push_back
(
point
.
path_point
());
}
auto
sampled_indices
=
DownsampleByAngle
(
points
,
kAngleThreshold
);
for
(
auto
index
:
sampled_indices
)
{
const
auto
&
point
=
points
[
index
];
PolygonPoint
*
world_point
=
prediction
->
add_predicted_trajectory
();
world_point
->
set_x
(
point
.
path_point
().
x
()
+
map_service_
->
GetXOffset
());
world_point
->
set_y
(
point
.
path_point
().
y
()
+
map_service_
->
GetYOffset
());
world_point
->
set_x
(
point
.
x
()
+
map_service_
->
GetXOffset
());
world_point
->
set_y
(
point
.
y
()
+
map_service_
->
GetYOffset
());
}
}
}
...
...
@@ -832,7 +839,7 @@ void SimulationWorldService::UpdateSimulationWorld(
auto
&
world_obj
=
CreateWorldObjectIfAbsent
(
obstacle
.
perception_obstacle
());
// Add prediction trajectory to the object.
CreatePredictionTrajectory
(
&
world_obj
,
obstacle
);
CreatePredictionTrajectory
(
obstacle
,
&
world_obj
);
world_obj
.
set_timestamp_sec
(
std
::
max
(
obstacle
.
timestamp
(),
world_obj
.
timestamp_sec
()));
...
...
@@ -853,10 +860,8 @@ void SimulationWorldService::UpdateSimulationWorld(
for
(
const
Path
&
path
:
paths
)
{
// Downsample the path points for frontend display.
// Angle threshold is about 5.72 degree.
constexpr
double
angle_threshold
=
0.1
;
std
::
vector
<
int
>
sampled_indices
=
DownsampleByAngle
(
path
.
path_points
(),
angle_threshold
);
auto
sampled_indices
=
DownsampleByAngle
(
path
.
path_points
(),
kAngleThreshold
);
route_paths_
.
emplace_back
();
RoutePath
*
route_path
=
&
route_paths_
.
back
();
...
...
modules/dreamview/backend/simulation_world/simulation_world_service.h
浏览文件 @
d3266006
...
...
@@ -59,6 +59,9 @@ class SimulationWorldService {
// SimulationWorld.
static
constexpr
int
kMaxMonitorItems
=
30
;
// Angle threshold is about 5.72 degree.
static
constexpr
double
kAngleThreshold
=
0.1
;
/**
* @brief Constructor of SimulationWorldService.
* @param map_service the pointer of MapService.
...
...
@@ -169,8 +172,8 @@ class SimulationWorldService {
void
UpdateMainDecision
(
const
apollo
::
planning
::
MainDecision
&
main_decision
,
double
update_timestamp_sec
,
Object
*
world_main_stop
);
void
CreatePredictionTrajectory
(
Object
*
world_object
,
const
apollo
::
prediction
::
PredictionObstacle
&
obstacle
);
const
apollo
::
prediction
::
PredictionObstacle
&
obstacle
,
Object
*
world_object
);
void
UpdatePlanningData
(
const
apollo
::
planning_internal
::
PlanningData
&
data
);
void
PopulateMapInfo
(
double
radius
);
...
...
modules/dreamview/backend/simulation_world/simulation_world_service_test.cc
浏览文件 @
d3266006
...
...
@@ -438,14 +438,7 @@ TEST_F(SimulationWorldServiceTest, UpdatePrediction) {
const
Prediction
&
prediction
=
obj
.
prediction
(
j
);
EXPECT_NEAR
((
sim_world
.
object_size
()
-
i
-
1
)
*
0.1
+
j
,
prediction
.
probability
(),
kEpsilon
);
EXPECT_EQ
(
prediction
.
predicted_trajectory_size
(),
8
);
for
(
int
k
=
0
;
k
<
prediction
.
predicted_trajectory_size
();
++
k
)
{
const
auto
&
pt
=
prediction
.
predicted_trajectory
(
k
);
int
val
=
j
*
10
+
k
;
EXPECT_NEAR
(
val
,
pt
.
x
(),
kEpsilon
);
EXPECT_NEAR
(
val
,
pt
.
y
(),
kEpsilon
);
EXPECT_NEAR
(
0.0
,
pt
.
z
(),
kEpsilon
);
}
EXPECT_EQ
(
prediction
.
predicted_trajectory_size
(),
2
);
// Downsampled
}
EXPECT_NEAR
(
123.456
,
obj
.
timestamp_sec
(),
kEpsilon
);
}
...
...
modules/dreamview/frontend/dist/
5edf3e08e204ac1407e2
.worker.js
→
modules/dreamview/frontend/dist/
2cb1e1fc341fc1283f2f
.worker.js
浏览文件 @
d3266006
此差异已折叠。
点击以展开。
modules/dreamview/frontend/dist/
5edf3e08e204ac1407e2
.worker.js.map
→
modules/dreamview/frontend/dist/
2cb1e1fc341fc1283f2f
.worker.js.map
浏览文件 @
d3266006
此差异已折叠。
点击以展开。
modules/dreamview/frontend/dist/app.bundle.js
浏览文件 @
d3266006
此差异已折叠。
点击以展开。
modules/dreamview/frontend/dist/app.bundle.js.map
浏览文件 @
d3266006
此差异已折叠。
点击以展开。
modules/dreamview/frontend/dist/navigation.bundle.js
浏览文件 @
d3266006
此差异已折叠。
点击以展开。
modules/dreamview/frontend/dist/navigation.bundle.js.map
浏览文件 @
d3266006
此差异已折叠。
点击以展开。
modules/dreamview/frontend/proto_bundle/map_proto_bundle.json
浏览文件 @
d3266006
...
...
@@ -4,124 +4,6 @@
"nested"
:
{
"hdmap"
:
{
"nested"
:
{
"Projection"
:
{
"fields"
:
{
"proj"
:
{
"type"
:
"string"
,
"id"
:
1
}
}
},
"Header"
:
{
"fields"
:
{
"version"
:
{
"type"
:
"bytes"
,
"id"
:
1
},
"date"
:
{
"type"
:
"bytes"
,
"id"
:
2
},
"projection"
:
{
"type"
:
"Projection"
,
"id"
:
3
},
"district"
:
{
"type"
:
"bytes"
,
"id"
:
4
},
"generation"
:
{
"type"
:
"bytes"
,
"id"
:
5
},
"revMajor"
:
{
"type"
:
"bytes"
,
"id"
:
6
},
"revMinor"
:
{
"type"
:
"bytes"
,
"id"
:
7
},
"left"
:
{
"type"
:
"double"
,
"id"
:
8
},
"top"
:
{
"type"
:
"double"
,
"id"
:
9
},
"right"
:
{
"type"
:
"double"
,
"id"
:
10
},
"bottom"
:
{
"type"
:
"double"
,
"id"
:
11
},
"vendor"
:
{
"type"
:
"bytes"
,
"id"
:
12
}
}
},
"Map"
:
{
"fields"
:
{
"header"
:
{
"type"
:
"Header"
,
"id"
:
1
},
"crosswalk"
:
{
"rule"
:
"repeated"
,
"type"
:
"Crosswalk"
,
"id"
:
2
},
"junction"
:
{
"rule"
:
"repeated"
,
"type"
:
"Junction"
,
"id"
:
3
},
"lane"
:
{
"rule"
:
"repeated"
,
"type"
:
"Lane"
,
"id"
:
4
},
"stopSign"
:
{
"rule"
:
"repeated"
,
"type"
:
"StopSign"
,
"id"
:
5
},
"signal"
:
{
"rule"
:
"repeated"
,
"type"
:
"Signal"
,
"id"
:
6
},
"yield"
:
{
"rule"
:
"repeated"
,
"type"
:
"YieldSign"
,
"id"
:
7
},
"overlap"
:
{
"rule"
:
"repeated"
,
"type"
:
"Overlap"
,
"id"
:
8
},
"clearArea"
:
{
"rule"
:
"repeated"
,
"type"
:
"ClearArea"
,
"id"
:
9
},
"speedBump"
:
{
"rule"
:
"repeated"
,
"type"
:
"SpeedBump"
,
"id"
:
10
},
"road"
:
{
"rule"
:
"repeated"
,
"type"
:
"Road"
,
"id"
:
11
}
}
},
"ClearArea"
:
{
"fields"
:
{
"id"
:
{
...
...
@@ -538,6 +420,124 @@
}
}
},
"Projection"
:
{
"fields"
:
{
"proj"
:
{
"type"
:
"string"
,
"id"
:
1
}
}
},
"Header"
:
{
"fields"
:
{
"version"
:
{
"type"
:
"bytes"
,
"id"
:
1
},
"date"
:
{
"type"
:
"bytes"
,
"id"
:
2
},
"projection"
:
{
"type"
:
"Projection"
,
"id"
:
3
},
"district"
:
{
"type"
:
"bytes"
,
"id"
:
4
},
"generation"
:
{
"type"
:
"bytes"
,
"id"
:
5
},
"revMajor"
:
{
"type"
:
"bytes"
,
"id"
:
6
},
"revMinor"
:
{
"type"
:
"bytes"
,
"id"
:
7
},
"left"
:
{
"type"
:
"double"
,
"id"
:
8
},
"top"
:
{
"type"
:
"double"
,
"id"
:
9
},
"right"
:
{
"type"
:
"double"
,
"id"
:
10
},
"bottom"
:
{
"type"
:
"double"
,
"id"
:
11
},
"vendor"
:
{
"type"
:
"bytes"
,
"id"
:
12
}
}
},
"Map"
:
{
"fields"
:
{
"header"
:
{
"type"
:
"Header"
,
"id"
:
1
},
"crosswalk"
:
{
"rule"
:
"repeated"
,
"type"
:
"Crosswalk"
,
"id"
:
2
},
"junction"
:
{
"rule"
:
"repeated"
,
"type"
:
"Junction"
,
"id"
:
3
},
"lane"
:
{
"rule"
:
"repeated"
,
"type"
:
"Lane"
,
"id"
:
4
},
"stopSign"
:
{
"rule"
:
"repeated"
,
"type"
:
"StopSign"
,
"id"
:
5
},
"signal"
:
{
"rule"
:
"repeated"
,
"type"
:
"Signal"
,
"id"
:
6
},
"yield"
:
{
"rule"
:
"repeated"
,
"type"
:
"YieldSign"
,
"id"
:
7
},
"overlap"
:
{
"rule"
:
"repeated"
,
"type"
:
"Overlap"
,
"id"
:
8
},
"clearArea"
:
{
"rule"
:
"repeated"
,
"type"
:
"ClearArea"
,
"id"
:
9
},
"speedBump"
:
{
"rule"
:
"repeated"
,
"type"
:
"SpeedBump"
,
"id"
:
10
},
"road"
:
{
"rule"
:
"repeated"
,
"type"
:
"Road"
,
"id"
:
11
}
}
},
"BoundaryEdge"
:
{
"fields"
:
{
"curve"
:
{
...
...
modules/dreamview/frontend/src/renderer/prediction.js
浏览文件 @
d3266006
...
...
@@ -6,7 +6,6 @@ import { DEFAULT_COLOR, ObstacleColorMapping } from "renderer/obstacles.js";
import
{
drawCircle
,
drawSegmentsFromPoints
}
from
"
utils/draw
"
;
const
_
=
require
(
'
lodash
'
);
const
downsamplingRatio
=
10
;
const
majorThickness
=
3
;
export
default
class
Prediction
{
...
...
@@ -63,6 +62,7 @@ export default class Prediction {
scene
.
add
(
mesh
);
// Downsampling points to draw circles
const
downsamplingRatio
=
Math
.
ceil
(
predictedTraj
.
length
/
3
);
for
(
let
j
=
0
;
j
<
predictedTraj
.
length
;
j
+=
downsamplingRatio
)
{
const
circleMesh
=
this
.
getPredCircle
();
circleMesh
.
position
.
set
(
predictedTraj
[
j
].
x
,
predictedTraj
[
j
].
y
,
0.24
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录