Skip to content

Conversation

@kylemcdonald
Copy link

@kylemcdonald kylemcdonald commented Jan 19, 2026

Tested and working with Vive Tracker 3.0 and Base Station 2.0 on a MacBook Pro M4.

  • Add macOS platform support by fixing several compatibility issues across the codebase
  • Replace <malloc.h> with <stdlib.h> on macOS in cnmatrix header since macOS doesn't provide <malloc.h>
  • Add HIDAPI library detection for macOS using Homebrew paths (/opt/homebrew/lib, /usr/local/lib)
  • Use .dylib plugin extension on macOS instead of .so
  • Replace /proc/self/exe with _NSGetExecutablePath() for getting executable path on macOS since procfs is not available
  • Add null check in survive_kalman_lighthouse_ootx() to prevent potential crashes
  • Enable pose output printf in api_example

SurvivePose pose = pose_event->pose;
FLT timecode = pose_event->time;
/*printf("%s %s (%7.3f): %f %f %f %f %f %f %f\n", survive_simple_object_name(pose_event->object),
printf("%s %s (%7.3f): %f %f %f %f %f %f %f\n", survive_simple_object_name(pose_event->object),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not commented out?

#include <stdbool.h>

#ifdef __APPLE__
#include <stdlib.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably include stdlib.h directly on all platforms rather than just malloc.h on everything else.

}
}
void survive_kalman_lighthouse_ootx(SurviveKalmanLighthouse *tracker) {
if (tracker == NULL) return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it often NULL ?

find_library(HIDAPI_LIBRARY hidapi PATHS /opt/homebrew/lib /usr/local/lib)
if(HIDAPI_LIBRARY)
list(APPEND ADDITIONAL_LIBRARIES ${HIDAPI_LIBRARY})
include_directories(/opt/homebrew/include /usr/local/include)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm that seems a bit too wide, there's no target available from CMake ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants