CameraRGBD: fall back to Qt viewer for -pcl on macOS

pcl::visualization::CloudViewer creates its render window on a background
thread, which macOS forbids (NSWindow must be created on the main
thread), aborting the process. On macOS, warn and use the default Qt
viewer instead of the legacy -pcl one.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
matlabbe
2026-06-28 14:15:23 -07:00
co-authored by Claude Opus 4.8
parent 80b537b2e4
commit f7d855e798
+12
View File
@@ -372,6 +372,18 @@ int main(int argc, char * argv[])
exit(1);
}
#ifdef __APPLE__
if(usePCLViz)
{
// pcl::visualization::CloudViewer creates its render window on its own
// background thread, but macOS only allows NSWindow creation on the main
// thread, so it aborts. Fall back to the default (Qt) viewer.
printf("-pcl is not supported on macOS (pcl::visualization::CloudViewer creates its "
"window on a background thread, which macOS forbids). Using the default viewer instead.\n");
usePCLViz = false;
}
#endif
if(usePCLViz)
{
rtabmap::SensorData data = camera->takeData();