@@ -56,9 +56,9 @@ KinematicsHandler::KinematicsHandler()
5656KinematicsHandler::~KinematicsHandler ()
5757{
5858 KinematicParameters* ptr = kinematics_.load ();
59- if (ptr != nullptr ) {
60- delete ptr;
61- }
59+ if (ptr != nullptr ) {
60+ delete ptr;
61+ }
6262}
6363
6464void KinematicsHandler::initialize (
@@ -154,11 +154,11 @@ void KinematicsHandler::deactivate()
154154void KinematicsHandler::setSpeedLimit (
155155 const double & speed_limit, const bool & percentage)
156156{
157- KinematicParameters* ptr = kinematics_.load ();
158- if (ptr == nullptr ) {
159- return ; // Nothing to update
160- }
161- KinematicParameters kinematics (*ptr);
157+ KinematicParameters* ptr = kinematics_.load ();
158+ if (ptr == nullptr ) {
159+ return ; // Nothing to update
160+ }
161+ KinematicParameters kinematics (*ptr);
162162
163163 if (speed_limit == nav2_costmap_2d::NO_SPEED_LIMIT) {
164164 // Restore default value
@@ -239,11 +239,11 @@ void
239239KinematicsHandler::updateParametersCallback (std::vector<rclcpp::Parameter> parameters)
240240{
241241 rcl_interfaces::msg::SetParametersResult result;
242- KinematicParameters* ptr = kinematics_.load ();
243- if (ptr == nullptr ) {
244- return ; // Nothing to update
245- }
246- KinematicParameters kinematics (*ptr);
242+ KinematicParameters* ptr = kinematics_.load ();
243+ if (ptr == nullptr ) {
244+ return ; // Nothing to update
245+ }
246+ KinematicParameters kinematics (*ptr);
247247
248248 for (auto parameter : parameters) {
249249 const auto & param_type = parameter.get_type ();
@@ -296,7 +296,6 @@ KinematicsHandler::updateParametersCallback(std::vector<rclcpp::Parameter> param
296296void KinematicsHandler::update_kinematics (KinematicParameters kinematics) {
297297 KinematicParameters* new_kinematics = new KinematicParameters (kinematics);
298298 KinematicParameters* old_kinematics = kinematics_.exchange (new_kinematics);
299-
300299 if (old_kinematics != nullptr ) {
301300 delete old_kinematics;
302301 }
0 commit comments