Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(control_validator): add min velocity for max distance deviation checking #1337

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@

thresholds:
max_distance_deviation: 1.0
min_velocity_for_checking: 1.0 # m/s
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ using nav_msgs::msg::Odometry;
struct ValidationParams
{
double max_distance_deviation_threshold;
double min_velocity_for_checking;
};

class ControlValidator : public rclcpp::Node
Expand Down
5 changes: 5 additions & 0 deletions control/control_validator/src/control_validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ void ControlValidator::setupParameters()
auto & p = validation_params_;
const std::string t = "thresholds.";
p.max_distance_deviation_threshold = declare_parameter<double>(t + "max_distance_deviation");
p.min_velocity_for_checking = declare_parameter<double>(t + "min_velocity_for_checking");
}

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

bool ControlValidator::checkValidMaxDistanceDeviation(const Trajectory & predicted_trajectory)
{
if (current_kinematics_->twist.twist.linear.x < validation_params_.min_velocity_for_checking) {
return true;
}

validation_status_.max_distance_deviation =
calcMaxLateralDistance(*current_reference_trajectory_, predicted_trajectory);
if (
Expand Down
Loading