Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
9d5c4ee2
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,发现更多精彩内容 >>
提交
9d5c4ee2
编写于
8月 01, 2017
作者:
H
henryhu6
提交者:
Jiangtao Hu
8月 01, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean up routing 2
上级
aed72cc6
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
117 addition
and
6628 deletion
+117
-6628
modules/routing/conf/adapter.conf
modules/routing/conf/adapter.conf
+2
-17
modules/routing/conf/routing.pb.txt
modules/routing/conf/routing.pb.txt
+0
-6561
modules/routing/routing.cc
modules/routing/routing.cc
+22
-36
modules/routing/routing.h
modules/routing/routing.h
+34
-10
modules/routing/srv/routing_signal.srv
modules/routing/srv/routing_signal.srv
+0
-3
modules/routing/topo_creator/BUILD
modules/routing/topo_creator/BUILD
+58
-0
modules/routing/topo_creator/topo_creator.cc
modules/routing/topo_creator/topo_creator.cc
+1
-1
未找到文件。
modules/routing/conf/adapter.conf
浏览文件 @
9d5c4ee2
config
{
type
:
LOCALIZATION
type
:
ROUTING_REQUEST
mode
:
RECEIVE_ONLY
message_history_limit
:
10
}
config
{
type
:
PAD
mode
:
RECEIVE_ONLY
message_history_limit
:
10
}
config
{
type
:
PLANNING_TRAJECTORY
mode
:
RECEIVE_ONLY
message_history_limit
:
10
}
config
{
type
:
CHASSIS
mode
:
RECEIVE_ONLY
message_history_limit
:
10
}
config
{
type
:
CONTROL_COMMAND
type
:
ROUTING
mode
:
PUBLISH_ONLY
}
config
{
...
...
modules/routing/conf/routing.pb.txt
浏览文件 @
9d5c4ee2
此差异已折叠。
点击以展开。
modules/routing/routing.cc
浏览文件 @
9d5c4ee2
...
...
@@ -22,60 +22,46 @@
namespace
apollo
{
namespace
routing
{
Routing
::
Routing
()
{
_node_handle_ptr
.
reset
(
new
ros
::
NodeHandle
(
FLAGS_node_namespace
));
ROS_INFO
(
"Use new routing request and result!"
);
_service
=
_node_handle_ptr
->
advertiseService
(
FLAGS_signal_probe_service
,
&
Routing
::
on_request
,
this
);
_publisher
=
_node_handle_ptr
->
advertise
<
std_msgs
::
String
>
(
FLAGS_route_topic_for_broadcast
,
1
);
std
::
string
Routing
::
Name
()
const
{
return
FLAGS_node_name
;
}
Status
Routing
::
Init
()
{
std
::
string
graph_path
=
FLAGS_graph_dir
+
"/"
+
FLAGS_graph_file_name
;
ROS_INFO
(
"Use routing topology graph path: %s"
,
graph_path
.
c_str
());
_navigator_ptr
.
reset
(
new
Navigator
(
graph_path
));
// set init ok for ADS test, when it knows routing is ok, it can replay bags
_node_handle_ptr
->
setParam
(
FLAGS_rosparam_name_routing_init_status
,
true
);
return
Status
::
OK
();
}
Routing
::~
Routing
()
{}
Status
Control
::
Start
()
{
if
(
!
_navigator_ptr
->
is_ready
())
{
AERROR
<<
"Navigator is not ready!"
;
return
Status
::
ERROR
();
}
ROS_INFO
(
"Routing service is ready."
);
apollo
::
common
::
monitor
::
MonitorBuffer
buffer
(
&
monitor_
);
buffer
.
INFO
(
"Routing started"
);
return
Status
::
OK
();
}
bool
Routing
::
on_request
(
routing
::
routing_signal
::
Request
&
req
,
routing
::
routing_signal
::
Response
&
res
)
{
ROS_INFO
(
"Get new routing request!!!"
);
void
OnRouting_Request
(
const
apollo
::
routing
::
RoutingRequest
&
routing_req
)
{
AINFO
<<
"Get new routing request!!!"
;
::
apollo
::
routing
::
RoutingRequest
request_proto
;
::
apollo
::
routing
::
RoutingResult
response_proto
;
if
(
!
request_proto
.
ParseFromString
(
req
.
routing_request
.
data
))
{
ROS_ERROR
(
"The request proto is invalid."
)
;
AERROR
<<
"The request proto is invalid."
;
return
false
;
}
if
(
!
_navigator_ptr
->
search_route
(
request_proto
,
&
response_proto
))
{
ROS_ERROR
(
"Failed to search route with navigator."
);
return
false
;
}
if
(
!
response_proto
.
SerializeToString
(
&
(
res
.
routing_response
.
data
)))
{
ROS_ERROR
(
"Failed to serialize routing response."
);
AERROR
<<
"Failed to search route with navigator."
;
return
false
;
}
if
(
request_proto
.
broadcast
())
{
std_msgs
::
String
publish_msg
;
if
(
!
response_proto
.
SerializeToString
(
&
(
publish_msg
.
data
)))
{
ROS_ERROR
(
"Failed to serialize routing response."
);
return
false
;
}
_publisher
.
publish
(
publish_msg
);
AdapterManager
::
PublishControlCommand
(
*
control_command
);
}
return
true
;
}
bool
Routing
::
run
()
{
if
(
!
_navigator_ptr
->
is_ready
())
{
ROS_ERROR
(
"Navigator is not ready!"
);
return
false
;
}
ROS_INFO
(
"Routing service is ready."
);
ros
::
spin
();
return
false
;
}
void
Routing
::
Stop
()
{}
}
// namespace routing
}
// namespace apollo
modules/routing/routing.h
浏览文件 @
9d5c4ee2
...
...
@@ -19,31 +19,55 @@
#include <memory>
#include "routing/routing_signal.h"
#include "common/routing_gflags.h"
#include "common/routing_macros.h"
#include "modules/common/apollo_app.h"
#include "modules/common/monitor/monitor.h"
namespace
apollo
{
namespace
routing
{
class
Navigator
;
class
Routing
:
public
apollo
::
common
::
ApolloApp
{
friend
class
RoutingTestBase
;
//
friend class RoutingTestBase;
public:
~
Routing
();
bool
run
();
Routing
()
:
monitor_
(
apollo
::
common
::
monitor
::
MonitorMessageItem
::
Routing
)
{}
/**
* @brief module name
*/
std
::
string
Name
()
const
override
;
/**
* @brief module initialization function
* @return initialization status
*/
apollo
::
common
::
Status
Init
()
override
;
/**
* @brief module start function
* @return start status
*/
apollo
::
common
::
Status
Start
()
override
;
/**
* @brief module stop function
*/
void
Stop
()
override
;
/**
* @brief destructor
*/
virtual
~
Routing
()
=
default
;
private:
bool
on_request
(
routing
::
routing_signal
::
Request
&
req
,
routing
::
routing_signal
::
Response
&
res
);
void
OnRouting_Request
(
const
apollo
::
routing
::
RoutingRequest
&
routing_req
);
private:
std
::
unique_ptr
<
ros
::
NodeHandle
>
_node_handle_ptr
;
ros
::
ServiceServer
_service
;
ros
::
Publisher
_publisher
;
std
::
unique_ptr
<
Navigator
>
_navigator_ptr
;
DECLARE_ARBITER_SINGLETON
(
Routing
);
};
}
// namespace routing
...
...
modules/routing/srv/routing_signal.srv
已删除
100644 → 0
浏览文件 @
aed72cc6
std_msgs/String routing_request
---
std_msgs/String routing_response
modules/routing/topo_creator/BUILD
0 → 100644
浏览文件 @
9d5c4ee2
load
(
"//tools:cpplint.bzl"
,
"cpplint"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
name
=
"edge_creator"
,
srcs
=
[
"edge_creator.cc"
,
],
hdrs
=
[
"edge_creator.h"
,
],
deps
=
[
"//external:gflags"
,
],
)
cc_library
(
name
=
"graph_creator"
,
srcs
=
[
"graph_creator.cc"
,
],
hdrs
=
[
"graph_creator.h"
,
],
deps
=
[
"//external:gflags"
,
":edge_creator"
,
":node_creator"
,
],
)
cc_library
(
name
=
"node_creator"
,
srcs
=
[
"node_creator.cc"
,
],
hdrs
=
[
"node_creator.h"
,
],
deps
=
[
"//external:gflags"
,
],
)
cc_binary
(
name
=
"topo_creator"
,
srcs
=
[
"topo_creator.cc"
],
deps
=
[
"//external:gflags"
,
":graph_creator"
,
"//modules/common:log"
,
"//modules/routing/common"
,
"//modules/control/proto:control_proto"
,
],
)
cpplint
()
modules/routing/to
ols/topo_creator_main
.cc
→
modules/routing/to
po_creator/topo_creator
.cc
浏览文件 @
9d5c4ee2
...
...
@@ -19,7 +19,7 @@
#include "gflags/gflags.h"
#include "glog/logging.h"
#include "topo_creator/graph_creator.h"
#include "
modules/routing/
topo_creator/graph_creator.h"
DEFINE_string
(
base_map_dir
,
"/home/caros/adu_data/map"
,
"directory of base map"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录