Commit graph

1480 commits

Author SHA1 Message Date
Thomas Thron
f23d298e6f src/driver_global_scene_solver.c: add_scenes: clean up old scenes after tracker was turned off and on again 2026-07-22 10:05:00 -04:00
Thomas Thron
a1b32719d3 driver_vive.libusb.h: handle_transfer: goto object_turned_off if survive_device_is_rf is true for the object 2026-07-22 10:05:00 -04:00
Thomas Thron
4e8705d68b driver_vive.c: move survive_device_is_rf up 2026-07-22 10:05:00 -04:00
Thomas Thron
721a58d27c poser_mpfit.c: solve_global_scene: early out when bestObjForCal == -1 2026-07-13 11:08:26 -04:00
Ben E.
d230bf7bd2 Fix typo in survive_simple_object_charge_percet (percent) 2026-07-06 09:32:41 -04:00
Mark Stalzer
5588cadf5a macOS: plugin loading, hidapi, and alloca/stdlib.h fixes
survive_plugins.unix.h: use .dylib extension and _NSGetExecutablePath()
on Apple. Also fixes a latent Linux bug where readlink() return value
was used as an array index without checking for error (-1).

CMakeLists.txt: find hidapi on Apple via pkg-config rather than
hardcoded Homebrew paths, which differ between Apple Silicon
(/opt/homebrew) and Intel (/usr/local).

cn_matrix.h: replace <malloc.h> with <stdlib.h> unconditionally, but
guard the re-inclusion of <malloc.h> with _WIN32. <malloc.h> does not
exist on macOS; <stdlib.h> provides malloc on all platforms. MSVC does
not declare alloca in <stdlib.h> — it lives in <malloc.h>.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 15:05:38 +00:00
Mark Stalzer
3388071730 driver_vive: downgrade unknown lightcap report from error to warning
SV_ERROR with SURVIVE_ERROR_HARWARE_FAULT crashes the process when an
unrecognised USB lightcap report ID is received. New tracker firmware
routinely emits report IDs that older libsurvive versions do not know;
crashing on an unrecognised ID makes libsurvive incompatible with any
firmware newer than it was built against.

The adjacent VIVE_REPORT_USB_TRACKER_LIGHTCAP_V1 case already uses
SV_INFO and ignores the packet. Apply the same treatment to the unknown
case: log a warning and continue so tracking on all known report types
is unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 15:34:59 +00:00
Mark Stalzer
08b0d8c713 driver_vive: clear_halt before submit_transfer in AttachInterface
A stalled USB endpoint must be cleared before resubmitting a transfer.
Without libusb_clear_halt(), libusb_submit_transfer() will return
LIBUSB_ERROR_PIPE (-9) on any endpoint left halted from a previous
session or failed transfer, causing the interface attachment to fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 15:33:58 +00:00
xu.chai
b41840d315 poser_mpfit: Skip disabled lighthouses to prevent matrix assertion failures 2026-05-08 19:07:16 +00:00
Mark Stalzer
2f4303c76f solve_global_scene: treat MP_MAXITER as calibration failure
MP_MAXITER (return code 5) means the solver exhausted its iteration
budget without converging. The current code treats this as success
(res <= 0 is false), so the unconverged — and potentially wrong —
lighthouse positions are written to disk via survive_recording and
the GSS result is accepted.

On the next launch those positions are loaded as the starting point
for calibration. If the unconverged solve is significantly wrong,
all subsequent tracking is corrupted and the only recovery is to
delete config.json.

Adding res == MP_MAXITER to the failure condition rejects unconverged
GSS solves the same way as explicit solver errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 20:55:11 +00:00
Mark Stalzer
bf27b41570 kalman: cap process noise dt to prevent t^7 explosion on tracking gaps
Cap dt at 0.05s (5x the normal ~8ms IMU interval) before computing the
power series. State prediction still uses the real dt; only uncertainty
growth (Q matrix) is bounded. Without this cap, a gap of ~1s yields
t^7 = 1.0 which inflates Q enough to cause NaN/Inf in the filter on the
next update (observed as a quatrotateabout assertion failure on cold start
or blackout recovery). This matches standard practice for discretised
continuous-time process noise models where large gaps should widen
uncertainty to a finite maximum rather than to infinity.

Fixes: tracker freezes after lighthouse occlusion / blackout recovery
       (collabora/libsurvive#346)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 20:51:39 +00:00
Eidenz
8f80f7fa5e feat: Beyond device to survive_default_devices 2026-03-20 03:01:08 +00:00
Mark Stalzer
477688f4e6 fix use-of-uninitialized-value in survive_kalman_tracker_stats
integration_variance[16] is stack-allocated but variance_tracker_calc()
may not write all elements when the tracker had zero observations
(counts == 0 or variance.size == 0). The uninitialized array is then
read by SV_VERBOSE via LINMATH_VEC7_EXPAND / LINMATH_VEC6_EXPAND.

Found by MSan when running test_replays.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 20:32:42 +00:00
Timo Witte
32cf62c527 initialize variables before logging 2025-04-07 14:14:44 +00:00
Simon Zeni
440518bb7b driver/gatt: upgrade to gattlib 0.7.2 2025-03-28 13:05:46 +00:00
Simon Zeni
af5ecd64f4 cmake: use CMAKE_VS_NUGET_PACKAGE_RESTORE on win32 2025-03-11 20:49:04 +00:00
KoenigSimon
9d8ec46f02 change buffer size to 64 to allow protocol switching on windows 2025-03-07 14:11:23 +00:00
Simon Zeni
4fb6d888d0 src/driver_usbmon: replace off64_t by z_off_t
`off64_t` is not a language defined type and is not available everywhere. Instead
the function should use `z_off_t` which is defined by zlib (and is most likely
`off_t`)
2024-05-10 16:53:37 +02:00
thetaengineering
037189ebbc Fix sensor data loss on linux caused by 464dd97 (#294) 2024-01-23 19:52:14 +01:00
Caio Mendes
464dd9734a Fix windows wireless dongle setup 2023-09-21 00:32:38 -03:00
Mario Kleiner
1ff91395ff Improve detection/handling of HTC Vive Pro Eye + Wand controllers.
As tested with a HTC Vive Pro Eye + Wand controllers, this removes
a warning about unknown headset name for the "T20" device.

More importantly it fixes input mappings of the Wand controllers
delivered with the HMD:

- Grip buttons now work. Before they were dead.
- Menu buttons now work. Before they were dead.
- Touching the touchpad correctly registers as touch instead of click.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2023-04-13 22:57:05 +02:00
Justin Berger
d89876a1af Fix imu timestamp in ros node 2023-03-11 01:12:55 -07:00
Justin Berger
3abf12e054 Fix time in ros publisher 2023-03-10 22:39:32 -07:00
Justin Berger
a3d450899a Fixing windows initializers 2023-02-23 11:04:42 -07:00
Justin Berger
5319743334 Make disable-calibrate apply to GSS 2022-08-12 13:48:57 -06:00
Justin Berger
4914ff7877 Read config from env variables 2022-07-21 13:01:43 -06:00
Justin Berger
5194502b6d Remove bad assert 2022-07-21 12:01:15 -06:00
Justin Berger
e403d59f01 Fix CI; ROS joystick functionality 2022-07-11 10:36:02 -06:00
jdavidberger
ac401b774d
Update driver_vive.c
Squelch warning message after ten occurrences
2022-07-11 10:30:56 -06:00
jdavidberger
2d39a25570 Add verbosity message to show why it declined the interface 2022-07-10 23:38:14 -06:00
Moses Turner
6d3344014c Don't grab the microphone device under libusb 2022-07-10 23:38:14 -06:00
Justin Berger
d939c24f4e More conservative timeout approach 2022-03-15 20:34:33 -06:00
Justin Berger
771c39c54a Refactor: Plugin/poser cbs now have a dedicated entry in SO to lookup their data; simplifies a number of places we had to juggle void* manually 2022-02-13 16:00:09 -07:00
Justin Berger
b7117a189a Made ros node more compliant 2022-02-13 14:20:08 -07:00
Justin Berger
4ae7b6b0a5 Saw a case on windows where HID_API didn't return objects grouped together so this logic failed. Swapping to just look at interace 0. All trackable devices should have this interface defined 2022-02-13 14:20:08 -07:00
Justin Berger
0500216fbf Fixed assert since t could be 0 2022-02-13 14:13:32 -07:00
Justin Berger
1e66d61ea9 Add verbose messages to hid enumeration 2022-02-13 13:37:34 -07:00
Justin Berger
affdef0dbd Fixed bad diag size
Fixed bad diff call in test
2022-02-13 12:35:20 -07:00
Justin Berger
fd8faaff30 Fixed cmake macro eval 2022-02-11 10:01:54 -07:00
Justin Berger
12b38a13a1 Print options in CI; possible fix windows issue 2022-02-11 09:27:55 -07:00
Justin Berger
74a17aaafa Strip newline 2022-02-08 01:15:32 -07:00
Justin Berger
0e5065146c Added VERSION in CI 2022-02-08 01:03:38 -07:00
Justin Berger
1261728956 Add flag to disable bias from config files 2022-02-06 13:49:19 -07:00
Justin Berger
fb63ba0f07 Fix optimizer test for windows 2022-02-05 17:04:54 -07:00
Justin Berger
3af353a4d6 Removed configurable jac mode; fix for windows _Generic 2022-02-05 16:35:55 -07:00
Justin Berger
cd97c2c3d9 Share safe_fns with cnkalman; fixs warnings 2022-02-05 14:52:17 -07:00
Justin Berger
add8d78fdb Re-enable now working replay files 2022-02-05 14:52:13 -07:00
Justin Berger
875947fd54 Integrate prior lh positions in a way that makes sense 2022-02-05 14:05:01 -07:00
Justin Berger
560d62d616 Misc bug fixs 2022-02-05 14:05:01 -07:00
Justin Berger
d3a41970aa Merge accel meas code 2022-02-05 14:05:01 -07:00