Skip to content

Commit 49a4879

Browse files
authored
Merge branch 'feat/add-mrm-v0.6-launch-based-on-v3.0.0' into feat/add-leader-election-converter
2 parents bc8cffb + cf4a195 commit 49a4879

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

control/control_validator/config/control_validator.param.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212

1313
thresholds:
1414
max_distance_deviation: 1.0
15+
min_velocity_for_checking: 1.0 # m/s

control/control_validator/include/control_validator/control_validator.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ using nav_msgs::msg::Odometry;
4141
struct ValidationParams
4242
{
4343
double max_distance_deviation_threshold;
44+
double min_velocity_for_checking;
4445
};
4546

4647
class ControlValidator : public rclcpp::Node

control/control_validator/src/control_validator.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ void ControlValidator::setupParameters()
6161
auto & p = validation_params_;
6262
const std::string t = "thresholds.";
6363
p.max_distance_deviation_threshold = declare_parameter<double>(t + "max_distance_deviation");
64+
p.min_velocity_for_checking = declare_parameter<double>(t + "min_velocity_for_checking");
6465
}
6566

6667
try {
@@ -175,6 +176,10 @@ void ControlValidator::validate(const Trajectory & predicted_trajectory)
175176

176177
bool ControlValidator::checkValidMaxDistanceDeviation(const Trajectory & predicted_trajectory)
177178
{
179+
if (current_kinematics_->twist.twist.linear.x < validation_params_.min_velocity_for_checking) {
180+
return true;
181+
}
182+
178183
validation_status_.max_distance_deviation =
179184
calcMaxLateralDistance(*current_reference_trajectory_, predicted_trajectory);
180185
if (

0 commit comments

Comments
 (0)