From 2edbe33bb0269cb22ee8d5122ab5d6deca0804c4 Mon Sep 17 00:00:00 2001 From: Bence Magyar Date: Mon, 2 Dec 2024 10:48:45 +0000 Subject: [PATCH] less code is better MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christoph Fröhlich --- diff_drive_controller/src/diff_drive_controller.cpp | 3 +-- tricycle_controller/src/tricycle_controller.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/diff_drive_controller/src/diff_drive_controller.cpp b/diff_drive_controller/src/diff_drive_controller.cpp index 67eadca2a1..025f54e388 100644 --- a/diff_drive_controller/src/diff_drive_controller.cpp +++ b/diff_drive_controller/src/diff_drive_controller.cpp @@ -504,8 +504,7 @@ bool DiffDriveController::reset() subscriber_is_active_ = false; velocity_command_subscriber_.reset(); - received_velocity_msg_ptr_.set([](std::shared_ptr & stored_value) - { stored_value = nullptr; }); + received_velocity_msg_ptr_.set(nullptr); is_halted = false; return true; } diff --git a/tricycle_controller/src/tricycle_controller.cpp b/tricycle_controller/src/tricycle_controller.cpp index 77c11de28a..689dd50d77 100644 --- a/tricycle_controller/src/tricycle_controller.cpp +++ b/tricycle_controller/src/tricycle_controller.cpp @@ -434,8 +434,7 @@ bool TricycleController::reset() subscriber_is_active_ = false; velocity_command_subscriber_.reset(); - received_velocity_msg_ptr_.set([](std::shared_ptr & stored_value) - { stored_value = nullptr; }); + received_velocity_msg_ptr_.set(nullptr); is_halted = false; return true; }