File tree 1 file changed +12
-1
lines changed
planning/mission_planner/src/mission_planner
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -734,6 +734,13 @@ bool MissionPlanner::check_reroute_safety(
734
734
return false ;
735
735
}
736
736
737
+ const auto current_velocity = odometry_->twist .twist .linear .x ;
738
+
739
+ // if vehicle is stopped, do not check safety
740
+ if (current_velocity < 0.01 ) {
741
+ return true ;
742
+ }
743
+
737
744
auto hasSamePrimitives = [](
738
745
const std::vector<LaneletPrimitive> & original_primitives,
739
746
const std::vector<LaneletPrimitive> & target_primitives) {
@@ -878,13 +885,17 @@ bool MissionPlanner::check_reroute_safety(
878
885
}
879
886
880
887
// check safety
881
- const auto current_velocity = odometry_->twist .twist .linear .x ;
882
888
const double safety_length =
883
889
std::max (current_velocity * reroute_time_threshold_, minimum_reroute_length_);
884
890
if (accumulated_length > safety_length) {
885
891
return true ;
886
892
}
887
893
894
+ RCLCPP_WARN (
895
+ get_logger (),
896
+ " Length of lane where original and B target (= %f) is less than safety length (= %f), so "
897
+ " reroute is not safe." ,
898
+ accumulated_length, safety_length);
888
899
return false ;
889
900
}
890
901
} // namespace mission_planner
You can’t perform that action at this time.
0 commit comments