Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
3610a837
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,体验更适合开发者的 AI 搜索 >>
提交
3610a837
编写于
8月 04, 2017
作者:
F
fanzhu1985
提交者:
henryhu6
8月 03, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
routing: fix paths for offline topo (#402)
上级
a2945036
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
18 addition
and
32 deletion
+18
-32
modules/routing/common/routing_gflags.cc
modules/routing/common/routing_gflags.cc
+4
-2
modules/routing/common/routing_gflags.h
modules/routing/common/routing_gflags.h
+2
-0
modules/routing/common/utils.cc
modules/routing/common/utils.cc
+0
-17
modules/routing/common/utils.h
modules/routing/common/utils.h
+0
-3
modules/routing/graph/BUILD
modules/routing/graph/BUILD
+1
-0
modules/routing/graph/topo_graph.cc
modules/routing/graph/topo_graph.cc
+3
-2
modules/routing/topo_creator/BUILD
modules/routing/topo_creator/BUILD
+1
-0
modules/routing/topo_creator/graph_creator.cc
modules/routing/topo_creator/graph_creator.cc
+2
-1
modules/routing/topo_creator/topo_creator.cc
modules/routing/topo_creator/topo_creator.cc
+5
-7
未找到文件。
modules/routing/common/routing_gflags.cc
浏览文件 @
3610a837
...
...
@@ -26,8 +26,10 @@ DEFINE_string(route_topic_for_broadcast, "/routing/routing",
"the default routing topic"
);
DEFINE_bool
(
use_road_id
,
true
,
"enable use road id to cut routing result"
);
DEFINE_string
(
graph_dir
,
""
,
"the default directory of topology graph data"
);
DEFINE_string
(
graph_file_name
,
"routing_map.bin"
,
DEFINE_string
(
map_dir
,
"/apollo/modules/map/data"
,
"the default directory of hdmap"
);
DEFINE_string
(
map_file_name
,
"base_map.txt"
,
"the default file name of hdmap."
);
DEFINE_string
(
graph_dir
,
"/apollo/modules/map/data"
,
"the default directory of topology graph data"
);
DEFINE_string
(
graph_file_name
,
"routing_map.txt"
,
"the default file name of topology graph data"
);
DEFINE_string
(
rosparam_name_routing_init_status
,
"/pnc/routing_initialized"
,
...
...
modules/routing/common/routing_gflags.h
浏览文件 @
3610a837
...
...
@@ -27,6 +27,8 @@ DECLARE_bool(enable_old_routing);
DECLARE_string
(
route_topic_for_broadcast
);
DECLARE_bool
(
use_road_id
);
DECLARE_string
(
map_dir
);
DECLARE_string
(
map_file_name
);
DECLARE_string
(
graph_dir
);
DECLARE_string
(
graph_file_name
);
...
...
modules/routing/common/utils.cc
浏览文件 @
3610a837
...
...
@@ -27,23 +27,6 @@ using ::google::protobuf::io::FileInputStream;
using
::
google
::
protobuf
::
io
::
ZeroCopyInputStream
;
using
::
google
::
protobuf
::
io
::
CodedInputStream
;
bool
FileUtils
::
load_protobuf_data_from_file
(
const
std
::
string
&
file_path
,
::
google
::
protobuf
::
Message
*
const
proto_data
)
{
int
fd
=
open
(
file_path
.
c_str
(),
O_RDONLY
);
if
(
fd
==
-
1
)
{
AERROR
<<
"File %s not found"
<<
file_path
.
c_str
();
return
false
;
}
std
::
unique_ptr
<
ZeroCopyInputStream
>
raw_input
(
new
FileInputStream
(
fd
));
std
::
unique_ptr
<
CodedInputStream
>
coded_input
(
new
CodedInputStream
(
raw_input
.
get
()));
coded_input
->
SetTotalBytesLimit
(
INT_MAX
,
536870912
);
// 0..512M..2G
bool
ret
=
proto_data
->
ParseFromCodedStream
(
coded_input
.
get
());
close
(
fd
);
return
ret
;
}
bool
FileUtils
::
dump_protobuf_data_to_file
(
const
std
::
string
&
file_path
,
const
::
google
::
protobuf
::
Message
*
const
proto_data
)
{
...
...
modules/routing/common/utils.h
浏览文件 @
3610a837
...
...
@@ -25,9 +25,6 @@ namespace routing {
class
FileUtils
{
public:
static
bool
load_protobuf_data_from_file
(
const
std
::
string
&
file_path
,
::
google
::
protobuf
::
Message
*
const
proto_data
);
static
bool
dump_protobuf_data_to_file
(
const
std
::
string
&
file_path
,
const
::
google
::
protobuf
::
Message
&
proto_data
);
...
...
modules/routing/graph/BUILD
浏览文件 @
3610a837
...
...
@@ -39,6 +39,7 @@ cc_library(
"//modules/map/proto:map_proto"
,
"//modules/routing/proto:routing_proto"
,
"//modules/common:common"
,
"//modules/common/util"
,
"//modules/routing/common"
],
)
...
...
modules/routing/graph/topo_graph.cc
浏览文件 @
3610a837
...
...
@@ -17,6 +17,7 @@
#include "modules/routing/graph/topo_graph.h"
#include "modules/routing/common/utils.h"
#include "modules/routing/graph/topo_node.h"
#include "modules/common/util/file.h"
namespace
apollo
{
namespace
routing
{
...
...
@@ -70,8 +71,8 @@ bool TopoGraph::load_graph(const std::string& file_path) {
clear
();
::
apollo
::
routing
::
Graph
graph
;
if
(
!::
apollo
::
routing
::
FileUtils
::
load_protobuf_data_from_file
(
file_path
,
&
graph
))
{
if
(
!::
apollo
::
common
::
util
::
GetProtoFromFile
(
file_path
,
&
graph
))
{
AERROR
<<
"Failed to read topology graph from data."
;
return
false
;
}
...
...
modules/routing/topo_creator/BUILD
浏览文件 @
3610a837
...
...
@@ -34,6 +34,7 @@ cc_library(
"//modules/routing/proto:routing_proto"
,
"//modules/map/proto:map_proto"
,
"//modules/common:common"
,
"//modules/common/util"
,
"//modules/routing/common"
],
)
...
...
modules/routing/topo_creator/graph_creator.cc
浏览文件 @
3610a837
...
...
@@ -21,6 +21,7 @@
#include "modules/routing/common/utils.h"
#include "modules/routing/topo_creator/edge_creator.h"
#include "modules/routing/topo_creator/node_creator.h"
#include "modules/common/util/file.h"
namespace
apollo
{
namespace
routing
{
...
...
@@ -46,7 +47,7 @@ GraphCreator::GraphCreator(const std::string& base_map_file_path,
_dump_topo_file_path
(
dump_topo_file_path
)
{}
bool
GraphCreator
::
create
()
{
if
(
!::
apollo
::
routing
::
FileUtils
::
load_protobuf_data_from_f
ile
(
if
(
!::
apollo
::
common
::
util
::
GetProtoFromF
ile
(
_base_map_file_path
,
&
_pbmap
))
{
LOG
(
ERROR
)
<<
"Failed to load base map file from "
<<
_base_map_file_path
;
return
false
;
...
...
modules/routing/topo_creator/topo_creator.cc
浏览文件 @
3610a837
...
...
@@ -21,21 +21,19 @@
#include "modules/routing/topo_creator/graph_creator.h"
#include "modules/common/log.h"
DEFINE_string
(
base_map_dir
,
"/apollo/modules/map/data"
,
"directory of base map"
);
DEFINE_string
(
base_map_name
,
"base_map.txt"
,
"file name of base map"
);
DEFINE_string
(
dump_topo_path
,
"/apollo/modules/map/data/routing_map.bin"
,
"dump path of routing topology file"
);
int
main
(
int
argc
,
char
**
argv
)
{
google
::
InitGoogleLogging
(
argv
[
0
]);
google
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
std
::
unique_ptr
<::
apollo
::
routing
::
GraphCreator
>
creator_ptr
;
creator_ptr
.
reset
(
new
::
apollo
::
routing
::
GraphCreator
(
FLAGS_
base_map_dir
+
"/"
+
FLAGS_base_map
_name
,
FLAGS_
dump_topo_path
));
FLAGS_
map_dir
+
"/"
+
FLAGS_map_file
_name
,
FLAGS_
graph_dir
+
"/"
+
FLAGS_graph_file_name
));
if
(
!
creator_ptr
->
create
())
{
AERROR
<<
"Create rout
er
topo failed!"
;
AERROR
<<
"Create rout
ing
topo failed!"
;
return
-
1
;
}
LOG
(
INFO
)
<<
"Create routing topo succesful!"
;
LOG
(
INFO
)
<<
FLAGS_graph_dir
+
"/"
+
FLAGS_graph_file_name
;
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录