Skip to content

Commit

Permalink
feat(control_validator): add min velocity for max distance deviation …
Browse files Browse the repository at this point in the history
…checking (#1337)

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

Signed-off-by: Makoto Kurihara <[email protected]>

* chore(control_validator): remove debug logs

Signed-off-by: Makoto Kurihara <[email protected]>

---------

Signed-off-by: Makoto Kurihara <[email protected]>
  • Loading branch information
mkuri authored Jun 17, 2024
1 parent 08bf607 commit cf4a195
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
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

0 comments on commit cf4a195

Please sign in to comment.