Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
80660011
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,发现更多精彩内容 >>
提交
80660011
编写于
7月 31, 2019
作者:
T
tthhee
提交者:
Calvin Miao
8月 01, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Localization: update pyramid_map module
上级
fd90f229
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
49 addition
and
31 deletion
+49
-31
modules/localization/msf/local_pyramid_map/pyramid_map/aligned_matrix.h
...zation/msf/local_pyramid_map/pyramid_map/aligned_matrix.h
+2
-0
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_config.cc
...n/msf/local_pyramid_map/pyramid_map/pyramid_map_config.cc
+3
-1
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_config.h
...on/msf/local_pyramid_map/pyramid_map/pyramid_map_config.h
+3
-1
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_config_test.cc
.../local_pyramid_map/pyramid_map/pyramid_map_config_test.cc
+4
-2
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_matrix.cc
...n/msf/local_pyramid_map/pyramid_map/pyramid_map_matrix.cc
+6
-2
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_matrix.h
...on/msf/local_pyramid_map/pyramid_map/pyramid_map_matrix.h
+9
-5
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_matrix_test.cc
.../local_pyramid_map/pyramid_map/pyramid_map_matrix_test.cc
+22
-20
未找到文件。
modules/localization/msf/local_pyramid_map/pyramid_map/aligned_matrix.h
浏览文件 @
80660011
...
...
@@ -22,6 +22,7 @@
namespace
apollo
{
namespace
localization
{
namespace
msf
{
namespace
pyramid_map
{
template
<
typename
Scalar
,
int
aligned_len
=
alignof
(
max_align_t
)>
class
AlignedMatrix
{
...
...
@@ -226,6 +227,7 @@ operator=(const AlignedMatrix<Scalar, aligned_len>& matrix) {
return
*
this
;
}
}
// namespace pyramid_map
}
// namespace msf
}
// namespace localization
}
// namespace apollo
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_config.cc
浏览文件 @
80660011
...
...
@@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/localization/msf/local_map/pyramid_map/pyramid_map_config.h"
#include "modules/localization/msf/local_
pyramid_
map/pyramid_map/pyramid_map_config.h"
#include <string>
namespace
apollo
{
namespace
localization
{
namespace
msf
{
namespace
pyramid_map
{
PyramidMapConfig
::
PyramidMapConfig
(
const
std
::
string
&
map_version
)
:
BaseMapConfig
(
map_version
)
{}
...
...
@@ -129,6 +130,7 @@ bool PyramidMapConfig::LoadXml(const boost::property_tree::ptree& config) {
return
false
;
}
}
// namespace pyramid_map
}
// namespace msf
}
// namespace localization
}
// namespace apollo
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_config.h
浏览文件 @
80660011
...
...
@@ -16,11 +16,12 @@
#pragma once
#include <string>
#include "modules/localization/msf/local_map/base_map/base_map_config.h"
#include "modules/localization/msf/local_
pyramid_
map/base_map/base_map_config.h"
namespace
apollo
{
namespace
localization
{
namespace
msf
{
namespace
pyramid_map
{
class
PyramidMapConfig
:
public
BaseMapConfig
{
public:
...
...
@@ -53,6 +54,7 @@ class PyramidMapConfig : public BaseMapConfig {
virtual
bool
LoadXml
(
const
boost
::
property_tree
::
ptree
&
config
);
};
}
// namespace pyramid_map
}
// namespace msf
}
// namespace localization
}
// namespace apollo
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_config_test.cc
浏览文件 @
80660011
...
...
@@ -14,9 +14,9 @@
* limitations under the License.
*****************************************************************************/
#include "modules/localization/msf/local_map/pyramid_map/pyramid_map_config.h"
#include "modules/localization/msf/local_
pyramid_
map/pyramid_map/pyramid_map_config.h"
#include <gtest/gtest.h>
#include "modules/localization/msf/local_map/base_map/base_map_config.h"
#include "modules/localization/msf/local_
pyramid_
map/base_map/base_map_config.h"
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
...
...
@@ -26,6 +26,7 @@ int main(int argc, char** argv) {
namespace
apollo
{
namespace
localization
{
namespace
msf
{
namespace
pyramid_map
{
TEST
(
PyramidMapConfigTestSuite
,
base_config_method
)
{
PyramidMapConfig
config
(
"lossy_full_alt"
);
...
...
@@ -61,6 +62,7 @@ TEST(PyramidMapConfigTestSuite, base_config_method) {
config2
.
Load
(
config_file
);
}
}
// namespace pyramid_map
}
// namespace msf
}
// namespace localization
}
// namespace apollo
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_matrix.cc
浏览文件 @
80660011
...
...
@@ -13,13 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/localization/msf/local_map/pyramid_map/pyramid_map_matrix.h"
#include "modules/localization/msf/local_
pyramid_
map/pyramid_map/pyramid_map_matrix.h"
#include <algorithm>
#include <memory>
#include "cyber/common/log.h"
namespace
apollo
{
namespace
localization
{
namespace
msf
{
namespace
pyramid_map
{
PyramidMapMatrix
::
PyramidMapMatrix
()
{
Clear
();
}
...
...
@@ -1478,7 +1481,7 @@ double PyramidMapMatrix::ComputeMeanIntensity(unsigned int level) {
return
avg
;
}
void
PyramidMapMatrix
::
Reduce
(
PyramidMapMatrix
*
cells
,
void
PyramidMapMatrix
::
Reduce
(
std
::
shared_ptr
<
PyramidMapMatrix
>
cells
,
const
PyramidMapMatrix
&
new_cells
,
unsigned
int
level
,
unsigned
int
new_level
)
{
if
(
level
>=
cells
->
resolution_num_
)
{
...
...
@@ -1515,6 +1518,7 @@ void PyramidMapMatrix::Reduce(PyramidMapMatrix* cells,
}
}
}
// namespace pyramid_map
}
// namespace msf
}
// namespace localization
}
// namespace apollo
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_matrix.h
浏览文件 @
80660011
...
...
@@ -15,15 +15,17 @@
*****************************************************************************/
#pragma once
#include <memory>
#include <vector>
#include "modules/localization/msf/common/util/rect2d.h"
#include "modules/localization/msf/local_map/base_map/base_map_matrix.h"
#include "modules/localization/msf/local_map/pyramid_map/aligned_matrix.h"
#include "modules/localization/msf/local_map/pyramid_map/pyramid_map_config.h"
#include "modules/localization/msf/local_
pyramid_
map/base_map/base_map_matrix.h"
#include "modules/localization/msf/local_
pyramid_
map/pyramid_map/aligned_matrix.h"
#include "modules/localization/msf/local_
pyramid_
map/pyramid_map/pyramid_map_config.h"
namespace
apollo
{
namespace
localization
{
namespace
msf
{
namespace
pyramid_map
{
typedef
AlignedMatrix
<
float
>
FloatMatrix
;
typedef
AlignedMatrix
<
unsigned
int
>
UIntMatrix
;
...
...
@@ -199,8 +201,9 @@ class PyramidMapMatrix : public BaseMapMatrix {
double
ComputeMeanIntensity
(
unsigned
int
level
=
0
);
/**@brief Combine two PyramidMapMatrix instances (Reduce). */
static
void
Reduce
(
PyramidMapMatrix
*
cells
,
const
PyramidMapMatrix
&
new_cells
,
unsigned
int
level
=
0
,
unsigned
int
new_level
=
0
);
static
void
Reduce
(
std
::
shared_ptr
<
PyramidMapMatrix
>
cells
,
const
PyramidMapMatrix
&
new_cells
,
unsigned
int
level
=
0
,
unsigned
int
new_level
=
0
);
inline
bool
HasIntensity
()
const
;
inline
bool
HasIntensityVar
()
const
;
...
...
@@ -562,6 +565,7 @@ inline const UIntMatrix* PyramidMapMatrix::GetGroundCountMatrix(
return
&
ground_count_matrixes_
[
level
];
}
}
// namespace pyramid_map
}
// namespace msf
}
// namespace localization
}
// namespace apollo
modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_matrix_test.cc
浏览文件 @
80660011
...
...
@@ -14,9 +14,9 @@
* limitations under the License.
*****************************************************************************/
#include "modules/localization/msf/local_map/pyramid_map/pyramid_map_matrix.h"
#include "modules/localization/msf/local_
pyramid_
map/pyramid_map/pyramid_map_matrix.h"
#include <gtest/gtest.h>
#include "modules/localization/msf/local_map/pyramid_map/pyramid_map_config.h"
#include "modules/localization/msf/local_
pyramid_
map/pyramid_map/pyramid_map_config.h"
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
...
...
@@ -26,6 +26,7 @@ int main(int argc, char** argv) {
namespace
apollo
{
namespace
localization
{
namespace
msf
{
namespace
pyramid_map
{
class
PyramidMapMatrixTestSuite
:
public
::
testing
::
Test
{
protected:
...
...
@@ -40,7 +41,7 @@ TEST_F(PyramidMapMatrixTestSuite, constructor_and_init) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
1024
,
1024
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
pm_matrix
->
Init
(
*
config
);
EXPECT_EQ
(
pm_matrix
->
rows_mr_
[
0
],
1024
);
...
...
@@ -56,7 +57,7 @@ TEST_F(PyramidMapMatrixTestSuite, constructor_and_init) {
EXPECT_EQ
(
pm_matrix
->
ratio_
,
2
);
// check operator =
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix2
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix2
(
new
PyramidMapMatrix
());
config
->
SetMapNodeSize
(
2
,
2
);
pm_matrix2
->
Init
(
*
config
);
EXPECT_EQ
(
pm_matrix2
->
rows_mr_
[
0
],
2
);
...
...
@@ -79,7 +80,7 @@ TEST_F(PyramidMapMatrixTestSuite, get_and_set_intensity) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
2
,
2
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
// check getter safe before initializtion
EXPECT_EQ
(
pm_matrix
->
GetIntensityMatrixSafe
(),
nullptr
);
...
...
@@ -132,7 +133,7 @@ TEST_F(PyramidMapMatrixTestSuite, get_and_set_intensity_var) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
2
,
2
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
// check getter safe before initializtion
EXPECT_EQ
(
pm_matrix
->
GetIntensityVarMatrixSafe
(),
nullptr
);
...
...
@@ -178,7 +179,7 @@ TEST_F(PyramidMapMatrixTestSuite, get_and_set_altitude) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
2
,
2
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
// check getter safe before initializtion
EXPECT_EQ
(
pm_matrix
->
GetAltitudeMatrixSafe
(),
nullptr
);
...
...
@@ -244,7 +245,7 @@ TEST_F(PyramidMapMatrixTestSuite, get_and_set_altitude_var) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
2
,
2
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
// check getter safe before initializtion
EXPECT_EQ
(
pm_matrix
->
GetAltitudeVarMatrixSafe
(),
nullptr
);
...
...
@@ -290,7 +291,7 @@ TEST_F(PyramidMapMatrixTestSuite, get_and_set_ground_altitude) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
2
,
2
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
// check getter safe before initializtion
EXPECT_EQ
(
pm_matrix
->
GetGroundAltitudeMatrixSafe
(),
nullptr
);
...
...
@@ -337,7 +338,7 @@ TEST_F(PyramidMapMatrixTestSuite, get_and_set_count) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
2
,
2
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
// check getter safe before initializtion
EXPECT_EQ
(
pm_matrix
->
GetCountMatrixSafe
(),
nullptr
);
...
...
@@ -382,7 +383,7 @@ TEST_F(PyramidMapMatrixTestSuite, get_and_set_ground_count) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
2
,
2
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
// check getter safe before initializtion
EXPECT_EQ
(
pm_matrix
->
GetGroundCountMatrixSafe
(),
nullptr
);
...
...
@@ -428,7 +429,7 @@ TEST_F(PyramidMapMatrixTestSuite, set_and_reset_and_roi) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
3
,
3
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
pm_matrix
->
Init
(
*
config
);
EXPECT_EQ
(
pm_matrix
->
rows_mr_
[
0
],
3
);
...
...
@@ -533,7 +534,7 @@ TEST_F(PyramidMapMatrixTestSuite, merge_and_add_and_reduce) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
3
,
3
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
pm_matrix
->
Init
(
*
config
);
EXPECT_EQ
(
pm_matrix
->
rows_mr_
[
0
],
3
);
...
...
@@ -612,7 +613,7 @@ TEST_F(PyramidMapMatrixTestSuite, merge_and_add_and_reduce) {
pm_matrix
->
SetGroundCountMatrix
(
uint_data
,
9
,
0
);
pm_matrix
->
SetCountMatrix
(
uint_data
,
9
,
0
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix2
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix2
(
new
PyramidMapMatrix
());
pm_matrix2
->
Init
(
*
config
);
pm_matrix2
->
SetIntensityMatrix
(
float_data
,
9
,
0
);
pm_matrix2
->
SetIntensityVarMatrix
(
float_data
,
9
,
0
);
...
...
@@ -640,7 +641,7 @@ TEST_F(PyramidMapMatrixTestSuite, add_merge_get_base) {
std
::
unique_ptr
<
PyramidMapConfig
>
config
(
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
3
,
3
);
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
pm_matrix
->
Init
(
*
config
);
EXPECT_EQ
(
pm_matrix
->
rows_mr_
[
0
],
3
);
...
...
@@ -684,7 +685,7 @@ TEST_F(PyramidMapMatrixTestSuite, BottomUp) {
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
4
,
4
);
config
->
resolution_num_
=
2
;
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
pm_matrix
->
Init
(
*
config
);
EXPECT_EQ
(
pm_matrix
->
rows_mr_
[
0
],
4
);
...
...
@@ -743,7 +744,7 @@ TEST_F(PyramidMapMatrixTestSuite, flags_are_false_and_resolution_are_two) {
config
->
has_ground_altitude_
=
false
;
config
->
has_count_
=
false
;
config
->
has_ground_count_
=
false
;
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
pm_matrix
->
Init
(
*
config
);
// bottom up safe
...
...
@@ -760,7 +761,7 @@ TEST_F(PyramidMapMatrixTestSuite, check_const_matrix) {
new
PyramidMapConfig
(
"lossy_full_alt"
));
config
->
SetMapNodeSize
(
2
,
2
);
config
->
resolution_num_
=
1
;
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix
(
new
PyramidMapMatrix
());
pm_matrix
->
Init
(
*
config
);
const
PyramidMapMatrix
const_matrix
(
*
pm_matrix
);
...
...
@@ -781,7 +782,7 @@ TEST_F(PyramidMapMatrixTestSuite, check_const_matrix) {
EXPECT_EQ
((
*
const_matrix
.
GetGroundCountMatrix
(
0
))[
0
][
0
],
0
);
// bad case 1: resolution is 1024
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix2
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix2
(
new
PyramidMapMatrix
());
pm_matrix2
->
Init
(
*
config
);
const
PyramidMapMatrix
const_matrix2
(
*
pm_matrix2
);
EXPECT_EQ
(
const_matrix2
.
GetIntensityMatrixSafe
(
1024
),
nullptr
);
...
...
@@ -801,7 +802,7 @@ TEST_F(PyramidMapMatrixTestSuite, check_const_matrix) {
config
->
has_ground_altitude_
=
false
;
config
->
has_count_
=
false
;
config
->
has_ground_count_
=
false
;
std
::
unique
_ptr
<
PyramidMapMatrix
>
pm_matrix3
(
new
PyramidMapMatrix
());
std
::
shared
_ptr
<
PyramidMapMatrix
>
pm_matrix3
(
new
PyramidMapMatrix
());
pm_matrix3
->
Init
(
*
config
);
const
PyramidMapMatrix
const_matrix3
(
*
pm_matrix3
);
EXPECT_EQ
(
const_matrix3
.
GetIntensityMatrixSafe
(
0
),
nullptr
);
...
...
@@ -813,6 +814,7 @@ TEST_F(PyramidMapMatrixTestSuite, check_const_matrix) {
EXPECT_EQ
(
const_matrix3
.
GetGroundCountMatrixSafe
(
0
),
nullptr
);
}
}
// namespace pyramid_map
}
// namespace msf
}
// namespace localization
}
// namespace apollo
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录