Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Go Sakayori <[email protected]>
  • Loading branch information
go-sakayori committed May 30, 2024
1 parent 85830a4 commit bfff4bf
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ rcl_interfaces::msg::SetParametersResult MotionVelocitySmootherNode::onParameter

update_param("adjusted_max_acceleration", p.adjusted_max_acceleration);
update_param("adjusted_max_jerk", p.adjusted_max_jerk);
update_param("adjusted_max_lateral_acceleration", p.adjusted_max_lateral_acceleration);

Check warning on line 203 in planning/motion_velocity_smoother/src/motion_velocity_smoother_node.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

MotionVelocitySmootherNode::onParameter already has high cyclomatic complexity, and now it increases in Lines of Code from 121 to 124. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
}

{
Expand Down Expand Up @@ -1124,6 +1125,7 @@ void MotionVelocitySmootherNode::onAdjustParam(
if (request->data && !adjustParam) {
smoother_->setMaxAccel(get_parameter("adjusted_max_acceleration").as_double());
smoother_->setMaxJerk(get_parameter("adjusted_max_jerk").as_double());
smoother_->setMaxLatAccel(get_parameter("adjusted_max_lateral_acceleration").as_double());

adjustParam = true;
} else if (!request->data && adjustParam) {
Expand Down

0 comments on commit bfff4bf

Please sign in to comment.