Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
009d30e7
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,发现更多精彩内容 >>
提交
009d30e7
编写于
7月 26, 2017
作者:
J
jiangyifei
提交者:
Jiangtao Hu
7月 26, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modified map_xysl with new map api.
上级
a00c1c3c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
19 deletion
+15
-19
modules/tools/map_tool/map_xysl.cc
modules/tools/map_tool/map_xysl.cc
+15
-19
未找到文件。
modules/tools/map_tool/map_xysl.cc
浏览文件 @
009d30e7
...
...
@@ -23,7 +23,7 @@
#include "modules/map/proto/map_geometry.pb.h"
#include "modules/common/log.h"
#include "modules/map/hdmap/hdmap_common.h"
#include "modules/map/hdmap/hdmap.h"
#include "modules/map/hdmap/hdmap
_impl
.h"
DEFINE_string
(
map_file
,
"modules/map/data/base_map.txt"
,
"the map file"
);
DEFINE_bool
(
xy_to_sl
,
false
,
"calculate xy to sl"
);
...
...
@@ -50,7 +50,7 @@ namespace tools {
class
MapUtil
{
public:
explicit
MapUtil
(
const
std
::
string
&
map_filename
)
:
_map_client
(
nullptr
)
{
_map_client
.
reset
(
new
apollo
::
hdmap
::
HDMap
());
_map_client
.
reset
(
new
apollo
::
hdmap
::
HDMap
Impl
());
_map_client
->
load_map_from_file
(
map_filename
);
}
...
...
@@ -109,15 +109,14 @@ class MapUtil {
double
*
heading
)
{
QUIT_IF
(
point
==
nullptr
,
-
1
,
ERROR
,
"arg point is null"
);
QUIT_IF
(
heading
==
nullptr
,
-
2
,
ERROR
,
"arg heading is null"
);
::
apollo
::
common
::
math
::
Vec2d
vec2
d
;
// TODO(yifei) map api is not available
int
ret
=
-
1
;
// int ret = _map_client.get_smooth_point_from_lane(
// create_id(lane_id), s, l, &vec2d, heading);
QUIT_IF
(
ret
!=
0
,
-
3
,
ERROR
,
"get_smooth_point_from_lane[%s] failed"
,
::
apollo
::
hdmap
::
Id
i
d
;
id
.
set_id
(
lane_id
);
const
::
apollo
::
hdmap
::
LaneInfo
*
lane_info_ptr
=
_map_client
->
get_lane_by_id
(
id
).
get
();
QUIT_IF
(
lane_info_ptr
==
nullptr
,
-
3
,
ERROR
,
"get_smooth_point_from_lane[%s] failed"
,
lane_id
.
c_str
());
point
->
set_x
(
vec2d
.
x
());
point
->
set_y
(
vec2d
.
y
());
*
point
=
lane_info_ptr
->
get_smooth_point
(
s
);
return
0
;
}
...
...
@@ -129,21 +128,19 @@ class MapUtil {
_map_client
->
get_lane_by_id
(
create_id
(
lane_id
)).
get
();
QUIT_IF
(
lane
==
nullptr
,
-
2
,
ERROR
,
"get_lane_by_id[%s] failed"
,
lane_id
.
c_str
());
// TODO(yifei) map api is not available
bool
ret
=
false
;
// bool ret = lane->get_projection(vec2d, s, l);
bool
ret
=
lane
->
get_projection
(
vec2d
,
s
,
l
);
QUIT_IF
(
!
ret
,
-
3
,
ERROR
,
"lane[%s] get projection for point[%f, %f] failed"
,
lane_id
.
c_str
(),
vec2d
.
x
(),
vec2d
.
y
());
return
0
;
}
const
::
apollo
::
hdmap
::
HDMap
*
get_map_client
()
const
{
const
::
apollo
::
hdmap
::
HDMap
Impl
*
get_map_client
()
const
{
return
_map_client
.
get
();
}
private:
std
::
unique_ptr
<
apollo
::
hdmap
::
HDMap
>
_map_client
;
std
::
unique_ptr
<
apollo
::
hdmap
::
HDMap
Impl
>
_map_client
;
};
}
// namespace tools
...
...
@@ -257,8 +254,7 @@ int main(int argc, char *argv[]) {
<<
"] overlap["
<<
lane
.
overlap_id
()
<<
"] crosswalk["
<<
lane
.
crosswalk_id
()
<<
"] yield_sign["
<<
lane
.
yield_sign_id
()
// TODO(yifei)
// << "] stop_sign num:[" << lane_ptr->stop_signs().size()
<<
"] stop_sign num:["
<<
lane_ptr
->
stop_signs
().
size
()
<<
"]"
<<
" start point(x,y,heading):"
<<
start_point
.
x
()
<<
","
<<
start_point
.
y
()
<<
","
<<
start_heading
...
...
@@ -282,10 +278,10 @@ int main(int argc, char *argv[]) {
}
}
if
(
!
FLAGS_print_map
.
empty
())
{
//
const auto *map_client = map_util.get_map_client();
//const auto *map_client = map_util.get_map_client();
std
::
ofstream
ofs
(
FLAGS_print_map
);
// TODO(yifei) map api is not available
//
ofs << map_client->_map.DebugString();
//ofs << map_client->_map.DebugString();
ofs
.
close
();
}
if
(
!
FLAGS_print_map_bin
.
empty
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录