提交 d35c6482 编写于 作者: D Dong Li 提交者: Jiangtao Hu

routing: update routing_map, and added check for Topology node length

上级 4abad656
......@@ -2,8 +2,16 @@ hdmap_version: "03/10/17_22.46.20"
hdmap_district: ""
node {
lane_id: "1_-1"
length: 0
cost: 0
length: 30.347678575236987
left_out {
start {
s: 0
}
end {
s: 30.347678575236987
}
}
cost: 29.203235383821113
central_curve {
segment {
line_segment {
......@@ -3140,6 +3148,12 @@ node {
y: 4140786.2013956155
}
}
s: 0
start_position {
x: 586392.84003
y: 4140673.01232
}
length: 30.34767
}
}
is_virtual: false
......
......@@ -3,9 +3,15 @@
## Introduction
Routing module generates high level navigation information based on request.
Routing module depends on a routing topology file, usually named `routing_map.*` in apollo.
The routing map can be genreated by command
```
bash scripts/generate_routing_topo_graph.sh
```
## Input
* Map data
* Routing request (Start and end location)
## Output
* Routing navigation information
......@@ -29,6 +29,7 @@ namespace routing {
namespace {
const double MIN_INTERNAL_FOR_NODE = 0.01; // in meter
const double kLenghtEpsilon = 1e-6; // in meter
using ::google::protobuf::RepeatedPtrField;
......@@ -93,6 +94,8 @@ bool TopoNode::IsOutRangeEnough(const std::vector<NodeSRange>& range_vec,
TopoNode::TopoNode(const Node& node)
: pb_node_(node), start_s_(0.0), end_s_(pb_node_.length()) {
CHECK(pb_node_.length() > kLenghtEpsilon) << "Node length is invalid in pb: "
<< pb_node_.DebugString();
Init();
origin_node_ = this;
}
......
......@@ -95,7 +95,9 @@ TEST(NodeSRangeTestSuit, basic_test) {
TEST(NodeWithRangeTestSuit, basic_test) {
Node node_1;
node_1.set_length(20);
Node node_2;
node_2.set_length(20);
TopoNode topo_node_1(node_1);
TopoNode topo_node_2(node_2);
double start_s_1 = 0.0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册