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; }