diff --git a/source/VisionX/components/pointcloud_provider/AzureKinectPointCloudProvider/AzureKinectPointCloudProvider.cpp b/source/VisionX/components/pointcloud_provider/AzureKinectPointCloudProvider/AzureKinectPointCloudProvider.cpp index 4477a9a443de36c4027ede137d1b02cc56cf24b9..ca62a5e8c73a1d54e8feb02522b4b5afc8c8ca37 100644 --- a/source/VisionX/components/pointcloud_provider/AzureKinectPointCloudProvider/AzureKinectPointCloudProvider.cpp +++ b/source/VisionX/components/pointcloud_provider/AzureKinectPointCloudProvider/AzureKinectPointCloudProvider.cpp @@ -23,6 +23,7 @@ #include "AzureKinectPointCloudProvider.h" +#include "ArmarXCore/core/exceptions/LocalException.h" #include "ArmarXCore/core/logging/Logging.h" @@ -653,7 +654,17 @@ namespace visionx while(true) { - k4abt::frame body_frame = bodyTracker.pop_result(); + // body frames might just not be available. + const k4abt::frame body_frame = [&]() -> k4abt::frame{ + try { + auto result = bodyTracker.pop_result(); + return result; + } catch (...) { + ARMARX_VERBOSE << deactivateSpam(1) << "Exception in body tracking publishing: " << armarx::GetHandledExceptionString(); + return {}; + } + }(); + if (body_frame != nullptr) { armarx::core::time::ScopedStopWatch sw{createSwCallback("publish body tracking result")};