Skip to content

Commit

Permalink
RelativeMap: fixed a bug in navigator due to curvature downsampling.
Browse files Browse the repository at this point in the history
The curvature  is positive at the left turn and negative at the right turn. The previous downsampling strategy didn't consider the right turn scenario.
  • Loading branch information
davidhopper2003 authored and yifeijiang committed Jan 14, 2019
1 parent 0c9966e commit a3baf87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/map/relative_map/tools/navigator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@ bool GetNavigationPathFromFile(const std::string& filename,
auto json_obj = json::parse(line_str);
current_sampled_s = json_obj["s"];
current_kappa = json_obj["kappa"];
diff_s = current_sampled_s - last_sampled_s;
diff_s = std::fabs(current_sampled_s - last_sampled_s);
bool not_down_sampling =
FLAGS_navigator_down_sample
? diff_s >= kStraightSampleInterval ||
(diff_s >= kSmallKappaSampleInterval &&
current_kappa > kSmallKappa) ||
std::fabs(current_kappa) > kSmallKappa) ||
(diff_s >= kMiddleKappaSampleInterval &&
current_kappa > kMiddleKappa) ||
std::fabs(current_kappa) > kMiddleKappa) ||
(diff_s >= kLargeKappaSampleInterval &&
current_kappa > kLargeKappa)
std::fabs(current_kappa) > kLargeKappa)
: true;
if (not_down_sampling) {
last_sampled_s = current_sampled_s;
Expand Down

0 comments on commit a3baf87

Please sign in to comment.