Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
f0b63eab
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,发现更多精彩内容 >>
提交
f0b63eab
编写于
8月 04, 2017
作者:
T
Teveillan
提交者:
Jiangtao Hu
8月 04, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add comments in hdmap_roi_filter.h (#491)
上级
483ef0cc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
49 addition
and
43 deletion
+49
-43
modules/perception/obstacle/lidar/roi_filter/hdmap_roi_filter/hdmap_roi_filter.cc
...cle/lidar/roi_filter/hdmap_roi_filter/hdmap_roi_filter.cc
+2
-7
modules/perception/obstacle/lidar/roi_filter/hdmap_roi_filter/hdmap_roi_filter.h
...acle/lidar/roi_filter/hdmap_roi_filter/hdmap_roi_filter.h
+32
-21
modules/perception/obstacle/lidar/roi_filter/hdmap_roi_filter/polygon_mask.cc
...bstacle/lidar/roi_filter/hdmap_roi_filter/polygon_mask.cc
+11
-11
modules/perception/obstacle/lidar/roi_filter/hdmap_roi_filter/polygon_mask.h
...obstacle/lidar/roi_filter/hdmap_roi_filter/polygon_mask.h
+4
-4
未找到文件。
modules/perception/obstacle/lidar/roi_filter/hdmap_roi_filter/hdmap_roi_filter.cc
浏览文件 @
f0b63eab
...
...
@@ -17,8 +17,6 @@
namespace
apollo
{
namespace
perception
{
bool
HdmapROIFilter
::
Filter
(
const
pcl_util
::
PointCloudPtr
&
cloud
,
const
ROIFilterOptions
&
roi_filter_options
,
pcl_util
::
PointIndices
*
roi_indices
)
{
...
...
@@ -56,7 +54,7 @@ bool HdmapROIFilter::FilterWithPolygonMask(
Bitmap2D
bitmap
(
min_p
,
max_p
,
grid_size
,
major_dir
);
bitmap
.
BuildMap
();
DrawPolygonInBitmap
(
raw_polygons
,
bitmap
,
extend_dist_
);
DrawPolygonInBitmap
(
raw_polygons
,
extend_dist_
,
&
bitmap
);
// 4. Check each point whether is in roi grids in bitmap
return
Bitmap2dFilter
(
cloud
,
bitmap
,
roi_indices
);
...
...
@@ -143,12 +141,9 @@ void HdmapROIFilter::MergeHdmapStructToPolygons(
}
bool
HdmapROIFilter
::
Init
()
{
//FLAGS_work_root = "modules/perception";
//FLAGS_config_manager_path = "data/config_manager.conf";
// load model config
ConfigManager
*
config_manager
=
Singleton
<
ConfigManager
>::
Get
();
std
::
string
model_name
=
"HdmapROIFilter"
;
std
::
string
model_name
=
name
()
;
const
ModelConfig
*
model_config
=
nullptr
;
if
(
config_manager
==
nullptr
)
{
AERROR
<<
"Failed to get config manager"
;
...
...
modules/perception/obstacle/lidar/roi_filter/hdmap_roi_filter/hdmap_roi_filter.h
浏览文件 @
f0b63eab
...
...
@@ -52,29 +52,30 @@ public:
bool
Init
()
override
;
std
::
string
name
()
const
{
return
"HdmapROIFilter"
;}
/**
* @params[In] cloud: All the cloud points with local coordinates
* @params[In] roi_filter_options: Type definition in
* "../../interface/base_roi_filter.h". Contains the information
* of ROI and world to local coordinates transformation matrix.
* @params[Out] roi_indices: The indices of points within ROI
* @return true if filter points successfully, otherwise return false
*/
bool
Filter
(
const
pcl_util
::
PointCloudPtr
&
cloud
,
const
ROIFilterOptions
&
roi_filter_options
,
pcl_util
::
PointIndices
*
roi_indices
)
override
;
protected:
/**
* @brief: Draw polygons bitmap and check each point whether is in polygons
* @params[In] cloud: point cloud with local coordinates
* @params[In] map_polygons: polygons after transformed to scan polygon type
* @params[Out] roi_indices: Indices of point in roi
* @return true if filter points successfully, otherwise return false
* @brief: Draw polygons into grids in bitmap and check each point whether
* is in the grids within ROI.
*/
bool
FilterWithPolygonMask
(
const
pcl_util
::
PointCloudPtr
&
cloud
,
const
std
::
vector
<
PolygonType
>&
map_polygons
,
pcl_util
::
PointIndices
*
roi_indices
);
/**
* @brief: transform polygon and cloud to local corrdinates
* @params[In] cloud: point cloud with world coordinates
* @params[In] vel_pose: TODO
* @params[In] polygons_world: polygons with world coordinates
* @params[Out] polygons_loca: polygons with local coordinates
* @params[Out] cloud_local: point cloud with local coordinates
* @brief: Transform polygon points and cloud points from world coordinates
* system to local.
*/
void
TransformFrame
(
const
pcl_util
::
PointCloudConstPtr
&
cloud
,
...
...
@@ -85,23 +86,33 @@ protected:
/**
* @brief: Get major direction. Transform polygons type to what we want.
* @params[In] map_polygons: polygons with local coordinates
* @params[In] polygons: polygons with type of vector<Matrix<double, 2, 1>>
* @return major direction as x direction
*/
MajorDirection
GetMajorDirection
(
const
std
::
vector
<
PolygonType
>&
map_polygons
,
std
::
vector
<
PolygonScanConverter
::
Polygon
>*
polygons
);
void
MergeRoadBoundariesToPolygons
(
const
std
::
vector
<
RoadBoundary
>&
road_boundaries
,
std
::
vector
<
PolygonDType
>*
polygons
);
/**
* @brief: Merge left boundary and right boundary of each road into polygon
* type.
*/
void
MergeRoadBoundariesToPolygons
(
const
std
::
vector
<
RoadBoundary
>&
road_boundaries
,
std
::
vector
<
PolygonDType
>*
polygons
);
void
MergeHdmapStructToPolygons
(
const
HdmapStructConstPtr
&
hdmap_struct_ptr
,
std
::
vector
<
PolygonDType
>*
polygons
);
/**
* @brief: Merge junction polygons and road boundaries in a vector.
*/
void
MergeHdmapStructToPolygons
(
const
HdmapStructConstPtr
&
hdmap_struct_ptr
,
std
::
vector
<
PolygonDType
>*
polygons
);
bool
Bitmap2dFilter
(
const
pcl
::
PointCloud
<
pcl_util
::
Point
>::
ConstPtr
in_cloud_ptr
,
const
Bitmap2D
&
bitmap
,
pcl_util
::
PointIndices
*
roi_indices_ptr
);
/**
* @brief: After drawing polygons into grids in bitmap. We check each point
* whether is in the grids within ROI.
*/
bool
Bitmap2dFilter
(
const
pcl
::
PointCloud
<
pcl_util
::
Point
>::
ConstPtr
in_cloud_ptr
,
const
Bitmap2D
&
bitmap
,
pcl_util
::
PointIndices
*
roi_indices_ptr
);
// We only filter point with local coordinates x, y in [-range, range] in meters
double
range_
;
...
...
modules/perception/obstacle/lidar/roi_filter/hdmap_roi_filter/polygon_mask.cc
浏览文件 @
f0b63eab
...
...
@@ -51,14 +51,14 @@ void GetValidXRange(const typename PolygonScanConverter::Polygon &polygon,
*
major_dir_grid_size
+
bitmap_bottom_left_p
[
major_dir
];
}
void
DrawPolygonInBitmap
(
const
typename
PolygonScanConverter
::
Polygon
&
polygon
,
Bitmap2D
&
bitmap
,
const
double
extend_dist
)
{
PolygonScanConverter
::
DirectionMajor
major_dir
=
bitmap
.
get_dir_major
();
PolygonScanConverter
::
DirectionMajor
op_major_dir
=
bitmap
.
get_op_dir_major
();
double
major_dir_grid_size
=
bitmap
.
get_grid_size
()[
major_dir
];
void
DrawPolygonInBitmap
(
const
typename
PolygonScanConverter
::
Polygon
&
polygon
,
const
double
extend_dist
,
Bitmap2D
*
bitmap
)
{
PolygonScanConverter
::
DirectionMajor
major_dir
=
bitmap
->
get_dir_major
();
PolygonScanConverter
::
DirectionMajor
op_major_dir
=
bitmap
->
get_op_dir_major
();
double
major_dir_grid_size
=
bitmap
->
get_grid_size
()[
major_dir
];
Interval
valid_x_range
;
GetValidXRange
(
polygon
,
bitmap
,
major_dir
,
major_dir_grid_size
,
&
valid_x_range
);
GetValidXRange
(
polygon
,
*
bitmap
,
major_dir
,
major_dir_grid_size
,
&
valid_x_range
);
std
::
vector
<
std
::
vector
<
Interval
>>
scans_intervals
;
PolygonScanConverter
polygon_scan_converter
(
major_dir
);
...
...
@@ -66,8 +66,8 @@ void DrawPolygonInBitmap(const typename PolygonScanConverter::Polygon &polygon,
major_dir_grid_size
,
&
scans_intervals
);
const
Eigen
::
Vector2d
&
bitmap_bottom_left_p
=
bitmap
.
get_min_p
();
const
Eigen
::
Vector2d
&
bitmap_top_right_p
=
bitmap
.
get_max_p
();
const
Eigen
::
Vector2d
&
bitmap_bottom_left_p
=
bitmap
->
get_min_p
();
const
Eigen
::
Vector2d
&
bitmap_top_right_p
=
bitmap
->
get_max_p
();
double
x
=
valid_x_range
.
first
;
for
(
size_t
i
=
0
;
i
<
scans_intervals
.
size
();
x
+=
major_dir_grid_size
,
++
i
)
{
for
(
const
auto
&
scan_interval
:
scans_intervals
[
i
])
{
...
...
@@ -81,16 +81,16 @@ void DrawPolygonInBitmap(const typename PolygonScanConverter::Polygon &polygon,
if
(
valid_y_range
.
first
>
valid_y_range
.
second
)
{
continue
;
}
bitmap
.
Set
(
x
,
valid_y_range
.
first
,
valid_y_range
.
second
);
bitmap
->
Set
(
x
,
valid_y_range
.
first
,
valid_y_range
.
second
);
}
}
}
void
DrawPolygonInBitmap
(
const
std
::
vector
<
typename
PolygonScanConverter
::
Polygon
>&
polygons
,
Bitmap2D
&
bitmap
,
const
double
extend_dist
)
{
const
double
extend_dist
,
Bitmap2D
*
bitmap
)
{
for
(
const
auto
&
polygon
:
polygons
)
{
DrawPolygonInBitmap
(
polygon
,
bitmap
,
extend_dist
);
DrawPolygonInBitmap
(
polygon
,
extend_dist
,
bitmap
);
}
}
...
...
modules/perception/obstacle/lidar/roi_filter/hdmap_roi_filter/polygon_mask.h
浏览文件 @
f0b63eab
...
...
@@ -30,12 +30,12 @@ namespace perception {
typedef
typename
PolygonScanConverter
::
Interval
Interval
;
void
DrawPolygonInBitmap
(
const
PolygonScanConverter
::
Polygon
&
polygon
,
Bitmap2D
&
bitmap
,
const
double
extend_dist
);
void
DrawPolygonInBitmap
(
const
PolygonScanConverter
::
Polygon
&
polygon
,
const
double
extend_dist
,
Bitmap2D
*
bitmap
);
void
DrawPolygonInBitmap
(
const
std
::
vector
<
PolygonScanConverter
::
Polygon
>
&
polygons
,
Bitmap2D
&
bitmap
,
const
double
extend_dist
);
const
std
::
vector
<
PolygonScanConverter
::
Polygon
>
&
polygons
,
const
double
extend_dist
,
Bitmap2D
*
bitmap
);
/*
* @brief: Get valid x range(Major direction range)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录