Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
99e20d21
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,发现更多精彩内容 >>
提交
99e20d21
编写于
9月 25, 2018
作者:
K
kechxu
提交者:
Jiangtao Hu
9月 25, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Perception: add convex_hull_2d_test
上级
7d00fae1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
7 deletion
+25
-7
modules/perception/base/point_cloud.h
modules/perception/base/point_cloud.h
+4
-0
modules/perception/common/geometry/BUILD
modules/perception/common/geometry/BUILD
+13
-0
modules/perception/common/geometry/convex_hull_2d_test.cc
modules/perception/common/geometry/convex_hull_2d_test.cc
+8
-7
未找到文件。
modules/perception/base/point_cloud.h
浏览文件 @
99e20d21
...
...
@@ -414,6 +414,10 @@ class AttributePointCloud : public PointCloud<PointT> {
std
::
vector
<
double
>*
mutable_points_timestamp
()
{
return
&
points_timestamp_
;
}
const
std
::
vector
<
float
>&
points_height
()
const
{
return
points_height_
;
}
float
points_height
(
size_t
i
)
const
{
return
points_height_
[
i
];
}
void
SetPointHeight
(
size_t
i
,
size_t
j
,
float
height
)
{
points_height_
[
i
*
width_
+
j
]
=
height
;
}
std
::
vector
<
float
>*
mutable_points_height
()
{
return
&
points_height_
;
}
const
std
::
vector
<
int32_t
>&
points_beam_id
()
const
{
return
points_beam_id_
;
}
...
...
modules/perception/common/geometry/BUILD
浏览文件 @
99e20d21
...
...
@@ -101,4 +101,17 @@ cc_test(
],
)
cc_test
(
name
=
"convex_hull_2d_test"
,
size
=
"small"
,
srcs
=
[
"convex_hull_2d_test.cc"
,
],
deps
=
[
":convex_hull_2d"
,
"//modules/perception/base:point_cloud"
,
"@gtest//:main"
,
],
)
cpplint
()
modules/perception/common/geometry/convex_hull_2d_test.cc
浏览文件 @
99e20d21
...
...
@@ -17,16 +17,19 @@
#include <cfloat>
#include <limits>
#include <memory>
#include "gtest/gtest.h"
#include "modules/perception/base/point.h"
#include "modules/perception/base/point_cloud.h"
namespace
apollo
{
namespace
perception
{
namespace
common
{
using
PointF
=
apollo
::
perception
::
base
::
PointXYZIT
<
float
>
;
using
PointFCloud
=
apollo
::
perception
::
base
::
PointCloud
<
PointF
>
;
using
apollo
::
perception
::
base
::
PointF
;
using
PointFCloud
=
apollo
::
perception
::
base
::
AttributePointCloud
<
PointF
>
;
using
PointFCloudPtr
=
std
::
shared_ptr
<
PointFCloud
>
;
TEST
(
ConvexHull2DTest
,
convex_hull_2d
)
{
ConvexHull2D
<
PointFCloud
,
PointFCloud
>
convex_hull_2d
;
...
...
@@ -34,10 +37,9 @@ TEST(ConvexHull2DTest, convex_hull_2d) {
bool
flag
=
true
;
flag
=
convex_hull_2d
.
GetConvexHull
(
pointcloud_in
,
&
pointcloud_out
);
EXPECT_FALSE
(
flag
);
// float heigh = 0.0f
;
PointF
pt
;
for
(
size_t
i
=
0
;
i
<
10
;
i
++
)
{
for
(
size_t
j
=
0
;
j
<
10
;
j
++
)
{
PointF
pt
;
pt
.
x
=
i
;
pt
.
y
=
j
;
pt
.
z
=
0.0
;
...
...
@@ -100,15 +102,14 @@ TEST(ConvexHull2DTest1, convex_hull_2d1) {
PointFCloudPtr
(
new
PointFCloud
(
128
,
128
,
PointF
()));
PointFCloud
pointcloud_out
;
PointF
tmp_pt
;
// float heigh
= 0.0f;
float
height
=
0.0
f
;
for
(
size_t
i
=
0
;
i
<
128
;
i
++
)
{
for
(
size_t
j
=
0
;
j
<
128
;
j
++
)
{
tmp_pt
.
x
=
1.
f
*
i
;
tmp_pt
.
y
=
1.
f
*
j
;
tmp_pt
.
z
=
1.
f
*
i
;
float
heigh
=
i
*
1.0
f
;
*
(
pointcloud_in_ptr
->
at
(
i
,
j
))
=
tmp_pt
;
*
(
pointcloud_in_ptr
->
points_height
(
i
,
j
))
=
heigh
;
pointcloud_in_ptr
->
SetPointHeight
(
i
,
j
,
height
)
;
}
}
bool
flag
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录