Skip to content

Commit

Permalink
protect properly max_accel and max_decel (ros-navigation#3952)
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Doisy <guillaume@dexory.com>
Signed-off-by: gg <josho.wallace@gmail.com>
  • Loading branch information
2 people authored and jwallace42 committed Jan 3, 2024
1 parent 1353237 commit 10efedb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nav2_velocity_smoother/src/velocity_smoother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,9 @@ VelocitySmoother::dynamicParametersCallback(std::vector<rclcpp::Parameter> param
result.successful = false;
}
}
max_accels_ = parameter.as_double_array();
if (result.successful) {
max_accels_ = parameter.as_double_array();
}
} else if (name == "max_decel") {
for (unsigned int i = 0; i != 3; i++) {
if (parameter.as_double_array()[i] > 0.0) {
Expand All @@ -411,7 +413,9 @@ VelocitySmoother::dynamicParametersCallback(std::vector<rclcpp::Parameter> param
result.successful = false;
}
}
max_decels_ = parameter.as_double_array();
if (result.successful) {
max_decels_ = parameter.as_double_array();
}
} else if (name == "deadband_velocity") {
deadband_velocities_ = parameter.as_double_array();
}
Expand Down

0 comments on commit 10efedb

Please sign in to comment.