Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
80f6a6ae
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,发现更多精彩内容 >>
提交
80f6a6ae
编写于
11月 15, 2019
作者:
A
Aaron Xiao
提交者:
Xiangquan Xiao
11月 15, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Localization: Quick fix on std::for_each which doesn't support early return.
上级
8ea26125
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
25 deletion
+18
-25
modules/localization/msf/local_pyramid_map/base_map/base_map_config.cc
...ization/msf/local_pyramid_map/base_map/base_map_config.cc
+18
-25
未找到文件。
modules/localization/msf/local_pyramid_map/base_map/base_map_config.cc
浏览文件 @
80f6a6ae
...
...
@@ -16,7 +16,6 @@
#include "modules/localization/msf/local_pyramid_map/base_map/base_map_config.h"
#include <algorithm>
#include <exception>
#include <iostream>
...
...
@@ -46,12 +45,10 @@ bool BaseMapConfig::Save(const std::string &file_path) {
bool
success
=
CreateXml
(
&
config
);
if
(
success
)
{
boost
::
property_tree
::
write_xml
(
file_path
,
config
);
std
::
cerr
<<
"Saved the map configuration to: "
<<
file_path
<<
"."
<<
std
::
endl
;
AINFO
<<
"Saved the map configuration to: "
<<
file_path
;
return
true
;
}
else
{
return
false
;
}
return
false
;
}
bool
BaseMapConfig
::
Load
(
const
std
::
string
&
file_path
)
{
...
...
@@ -60,12 +57,10 @@ bool BaseMapConfig::Load(const std::string &file_path) {
bool
success
=
LoadXml
(
config
);
if
(
success
)
{
std
::
cerr
<<
"Loaded the map configuration from: "
<<
file_path
<<
"."
<<
std
::
endl
;
AINFO
<<
"Loaded the map configuration from: "
<<
file_path
;
return
true
;
}
else
{
return
false
;
}
return
false
;
}
bool
BaseMapConfig
::
CreateXml
(
boost
::
property_tree
::
ptree
*
config
)
const
{
...
...
@@ -171,27 +166,25 @@ bool BaseMapConfig::LoadXml(const boost::property_tree::ptree &config) {
auto
datasets
=
config
.
get_child_optional
(
"map.map_record.datasets"
);
if
(
datasets
)
{
std
::
for_each
(
datasets
->
begin
(),
datasets
->
end
(),
[
this
](
const
boost
::
property_tree
::
ptree
::
value_type
&
v
)
{
map_datasets_
.
push_back
(
v
.
second
.
data
());
AINFO
<<
"Dataset: "
<<
v
.
second
.
data
();
});
for
(
const
boost
::
property_tree
::
ptree
::
value_type
&
v
:
*
datasets
)
{
map_datasets_
.
push_back
(
v
.
second
.
data
());
AINFO
<<
"Dataset: "
<<
v
.
second
.
data
();
}
}
// load md5 check info
auto
nodes
=
config
.
get_child_optional
(
"map.check_info.nodes"
);
if
(
nodes
)
{
std
::
for_each
(
nodes
->
begin
(),
nodes
->
end
(),
[
this
](
const
boost
::
property_tree
::
ptree
::
value_type
&
v
)
{
const
boost
::
property_tree
::
ptree
&
child
=
v
.
second
;
auto
path
=
child
.
get_optional
<
std
::
string
>
(
"path"
);
auto
md5
=
child
.
get_optional
<
std
::
string
>
(
"md5"
);
if
(
!
path
||
!
md5
)
{
std
::
cerr
<<
"Lack path or md5."
<<
std
::
endl
;
return
;
}
node_md5_map_
[
*
path
]
=
*
md5
;
});
for
(
const
boost
::
property_tree
::
ptree
::
value_type
&
v
:
*
nodes
)
{
const
boost
::
property_tree
::
ptree
&
child
=
v
.
second
;
auto
path
=
child
.
get_optional
<
std
::
string
>
(
"path"
);
auto
md5
=
child
.
get_optional
<
std
::
string
>
(
"md5"
);
if
(
!
path
||
!
md5
)
{
AERROR
<<
"Lack path or md5."
;
return
false
;
}
node_md5_map_
[
*
path
]
=
*
md5
;
}
}
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录