From 06ecd147ecaacca941a7bb54b668fd02d2917fb4 Mon Sep 17 00:00:00 2001 From: Quintin Date: Fri, 27 Oct 2023 10:24:25 -0400 Subject: [PATCH] atomic is not needed here since always modified in critical section, wrong assert that works in release but not debug (#594) --- src/perception/zed_wrapper/zed_wrapper.bridge.cu | 2 +- src/perception/zed_wrapper/zed_wrapper.cpp | 2 +- src/perception/zed_wrapper/zed_wrapper.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/perception/zed_wrapper/zed_wrapper.bridge.cu b/src/perception/zed_wrapper/zed_wrapper.bridge.cu index 62335d6e9..5ebab9f35 100644 --- a/src/perception/zed_wrapper/zed_wrapper.bridge.cu +++ b/src/perception/zed_wrapper/zed_wrapper.bridge.cu @@ -37,7 +37,7 @@ namespace mrover { assert(bgraGpu.getWidth() >= xyzGpu.getWidth()); assert(bgraGpu.getHeight() >= xyzGpu.getHeight()); assert(bgraGpu.getChannels() == 4); - assert(xyzGpu.getChannels() == 3); + assert(xyzGpu.getChannels() == 4); // Last channel is unused assert(msg); auto* bgraGpuPtr = bgraGpu.getPtr(sl::MEM::GPU); diff --git a/src/perception/zed_wrapper/zed_wrapper.cpp b/src/perception/zed_wrapper/zed_wrapper.cpp index c19353c8f..f69ef66ba 100644 --- a/src/perception/zed_wrapper/zed_wrapper.cpp +++ b/src/perception/zed_wrapper/zed_wrapper.cpp @@ -137,7 +137,7 @@ namespace mrover { { std::unique_lock lock{mSwapMutex}; // Waiting on the condition variable will drop the lock and reacquire it when the condition is met - mSwapCv.wait(lock, [this] { return mIsSwapReady.load(); }); + mSwapCv.wait(lock, [this] { return mIsSwapReady; }); mIsSwapReady = false; mPcThreadProfiler.measureEvent("Wait"); diff --git a/src/perception/zed_wrapper/zed_wrapper.hpp b/src/perception/zed_wrapper/zed_wrapper.hpp index d252851bb..cde5d0aaa 100644 --- a/src/perception/zed_wrapper/zed_wrapper.hpp +++ b/src/perception/zed_wrapper/zed_wrapper.hpp @@ -53,7 +53,7 @@ namespace mrover { std::thread mPointCloudThread, mGrabThread; std::mutex mSwapMutex; std::condition_variable mSwapCv; - std::atomic_bool mIsSwapReady = false; + bool mIsSwapReady = false; LoopProfiler mPcThreadProfiler{"Zed Wrapper Point Cloud"}, mGrabThreadProfiler{"Zed Wrapper Grab"};