|
@@ -913,13 +913,14 @@ void iv::decition::BrainDecition::UpdateLineToMap(iv::GPS_INS now_gps_ins)
|
|
|
}
|
|
|
|
|
|
if(left_line_points.size()!=0&&right_line_points.size()!=0){
|
|
|
+ roadWidth = fabs(left_line_points[0].x - right_line_points[0].x);
|
|
|
k = k1;
|
|
|
last_k = k;
|
|
|
- line_length = std::min(left_line_points.size(),right_line_points.size());
|
|
|
+ line_length = left_line_points.size();
|
|
|
for(int j=0;j<line_length;++j){
|
|
|
iv::Point2D reference_line_point;
|
|
|
- reference_line_point.x = (left_line_points[j].x+right_line_points[j].x)/2;
|
|
|
- reference_line_point.y = (left_line_points[j].y+right_line_points[j].y)/2;
|
|
|
+ reference_line_point.x = left_line_points[j].x+roadWidth/2.0;
|
|
|
+ reference_line_point.y = left_line_points[j].y;
|
|
|
reference_line_points.push_back(reference_line_point);
|
|
|
}
|
|
|
gpsTraceFromLane = iv::decition::DecideFromLaneline::getGpsTraceFromLane(reference_line_points);
|
|
@@ -930,7 +931,7 @@ void iv::decition::BrainDecition::UpdateLineToMap(iv::GPS_INS now_gps_ins)
|
|
|
line_length = left_line_points.size();
|
|
|
for(int j=0;j<line_length;++j){
|
|
|
iv::Point2D reference_line_point;
|
|
|
- reference_line_point.x = left_line_points[j].x+1.8;
|
|
|
+ reference_line_point.x = left_line_points[j].x+roadWidth/2.0;
|
|
|
reference_line_point.y = left_line_points[j].y;
|
|
|
reference_line_points.push_back(reference_line_point);
|
|
|
}
|
|
@@ -942,7 +943,7 @@ void iv::decition::BrainDecition::UpdateLineToMap(iv::GPS_INS now_gps_ins)
|
|
|
line_length = right_line_points.size();
|
|
|
for(int j=0;j<line_length;++j){
|
|
|
iv::Point2D reference_line_point;
|
|
|
- reference_line_point.x = right_line_points[j].x-1.8;
|
|
|
+ reference_line_point.x = right_line_points[j].x-roadWidth/2.0;
|
|
|
reference_line_point.y = right_line_points[j].y;
|
|
|
reference_line_points.push_back(reference_line_point);
|
|
|
}
|