Commit graph

888 commits

Author SHA1 Message Date
Moses Turner 0a843eb20f d/dai: Translation is in cm but in m in Monado 2022-03-23 20:56:15 +00:00
korejan d43c7ffa71 android: Support for using device's set display refresh rate
* Adds support for querying the device's currently set display refresh rate to
  be used for android driver on creation. Allowing for devices which support
  selecting other refresh rate modes beyond 60hz.
* Changes hardcoded sensor polling rate to now match refresh queried from the
  device.
2022-03-22 12:33:30 +00:00
Moses Turner b3872e925f Switch real-time users of u_sink_queue to u_sink_simple_queue 2022-03-19 14:28:09 +00:00
Jakob Bornecrantz 6f10a20ce0 d/multi: Use xrt_device_get_tracked_pose function 2022-03-17 02:08:33 +00:00
Moses Turner d2366b31dc d/multi: Correctly override the head pose in get_view_poses 2022-03-15 20:13:10 -05:00
Moses Turner e4805c07e2 d/rs: Tracking origin probably should have an identity pose 2022-03-15 20:13:10 -05:00
Mateo de Mayo c9f7184d64 t/slam: Implement timing and trajectory error UI graphs 2022-03-14 23:42:13 +00:00
Mateo de Mayo af2dde11c3 misc: Fix some release build warnings and minor changes
- Add CMakeUserPresets.json to .gitignore
- Fix DASSERTs warning for release builds
- Do not use one euro filter with invalid poses
- Other NFC style changes
2022-03-14 23:42:13 +00:00
Mateo de Mayo e889ee7562 d/euroc: Implement ground truth trajectory load 2022-03-14 23:42:13 +00:00
Mateo de Mayo 71694b80fd d/euroc: Refactor player to stream samples more like a real device
Splits the image and IMU producers into their own threads.
2022-03-14 23:42:13 +00:00
Antonio Ospite 6ca4522de0 d/ns: really silence -Wunused-result warning
A previous change didn't really ignore the return value of fread() and
a warning was still emitted:

-----------------------------------------------------------------------
[103/1571] Building C object src/xrt/drivers/CMakeFiles/drv_ns.dir/north_star/ns_hmd.c.o
../src/xrt/drivers/north_star/ns_hmd.c: In function ‘ns_config_load’:
../src/xrt/drivers/north_star/ns_hmd.c:512:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  512 |  (void)fread(json, 1, file_size, config_file);
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------------

Check the return value of fread to fix the warning for good, and declare
the return value of ftell as long as stated in the man page.
2022-03-14 14:06:02 +00:00
Jakob Bornecrantz e1b0f55a87 d/ns: Always check to close file on error path 2022-03-09 22:34:37 +00:00
Antonio Ospite a4167ee500 d/ns: silence -Wunused-result warning, close config_file in error paths
On some systems fread() is declared with  attribute warn_unused_result
and this results in a build warning:

-----------------------------------------------------------------------
Building C object src/xrt/drivers/CMakeFiles/drv_ns.dir/north_star/ns_hmd.c.o
.../src/xrt/drivers/north_star/ns_hmd.c: In function ‘ns_config_load’:
.../src/xrt/drivers/north_star/ns_hmd.c:512:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  512 |  fread(json, 1, file_size, config_file);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------------

Explicitly ignore the return value of that fread() to silence the
warning.

And while at it also close config_file in some error paths between
fopen() and fclose() which where leaking the file pointer when jumping
to the parse_error label.
2022-03-09 16:10:43 +01:00
Moses Turner 30b779e515 t/hand: Add ht_sync 2022-03-08 20:44:25 +00:00
Moses Turner a9db1a6f6e d/ht_crtl_emu: Free driver 2022-03-08 13:52:23 -06:00
Jakob Bornecrantz bf1edf96eb d/dai: Add OV7251 sensor info 2022-03-04 14:04:13 +00:00
Henry Che add7b5723f Update illixr_device.cpp: There is no function called get_view_pose in xrt_device.h. 2022-02-23 17:13:38 +00:00
Mateo de Mayo cee1571625 d/euroc: Fix euroc player skip functionality 2022-02-22 22:56:07 +00:00
Mateo de Mayo 4b94d83c11 a/math: Fix one euro implementations not dividing by dt
The dy name was kept. It can now be thought of as "[d]erivative of [y]"
instead of the previous "change of y". Also, the beta parameters of the
one-euro users were adjusted by approximately multiplying them by 0.016
to compensate.
2022-02-22 13:34:45 +00:00
nima01 be3546eb92 d/wmr: Reverb G1: Avoid camera buffer related hangs 2022-02-20 14:57:36 +00:00
Christoph Haag 49b81e219f aux/util: Move fov from u_device_simple_info::views to top level 2022-02-19 13:04:32 +00:00
Christoph Haag 996a5d3e9a xrt: Move fov from xrt_view to xrt_hmd_parts::distortion 2022-02-19 13:04:32 +00:00
Christoph Haag 5e1805f04b build: Add sample driver to meson build 2022-02-19 13:04:32 +00:00
Ryan Pavlik 4ecbcc2d27 d/wmr: Fix doxygen warning 2022-02-19 01:15:36 +00:00
Christoph Haag 5b1d15f143 d/survive: Change license to BSL, as originally intended 2022-02-19 00:55:54 +00:00
Christoph Haag b2e7fc0f11 d/survive: Add pragma once and c++ compatibility 2022-02-19 00:55:54 +00:00
Christoph Haag bab6858eb8 d/multi: Change license to BSL, as originally intended 2022-02-19 00:55:54 +00:00
Christoph Haag 43f0bb4343 xrt: Fix tracking override docs 2022-02-19 00:43:30 +00:00
Nova f2ec7a7dd5 d/survive: Add SURVIVE_DISABLE_HAND_EMULATION env variable 2022-02-17 13:20:59 +00:00
Jakob Bornecrantz 9b656cde77 xrt: Remove xrt_device::get_view_pose
Co-authored-by: Christoph Haag <christoph.haag@collabora.com>
2022-02-16 23:15:24 +00:00
Jakob Bornecrantz 0511b319ba drivers: Implement xrt_device::get_view_poses
Co-authored-by: Christoph Haag <christoph.haag@collabora.com>
2022-02-16 23:15:08 +00:00
Jakob Bornecrantz b322ff689b d/wmr: Add trace markers to some common functions 2022-02-16 22:25:55 +00:00
Jakob Bornecrantz 4aa2ae985c d/wmr: Refactor hololens code a bit 2022-02-16 22:25:55 +00:00
Jakob Bornecrantz 8f5a7b88c7 d/wmr: Tidy todos 2022-02-16 22:25:55 +00:00
Jakob Bornecrantz 7791a04069 d/rs: Add math include to fix build and org includes
Fixes build on Ubuntu 21.10
2022-02-14 14:34:06 +00:00
Mateo de Mayo 3cba6dc700 d/rs: Add exposure controls to the debug UI 2022-02-14 10:22:05 -03:00
nima01 41edf12a0d d/wmr: Debug GUI support for enabling/disabling HMD screen and displaying IPD and proximity values 2022-02-12 03:45:16 +00:00
Moses Turner 7ee8a7dba0 d/dai: add stereo-RGB pipeline behind ifdef, waiting for Luxonis to upstream multicam support 2022-02-10 10:55:06 -06:00
Ryan Pavlik c30acbf9f8 d/ht: Forward declarations and IWYU 2022-02-08 17:27:42 -06:00
Ryan Pavlik 5b8c869b56 d/ht: Fix header and usages of helpers 2022-02-08 17:21:46 -06:00
Ryan Pavlik 8c7af28904 d/ht: Fix build issues against updated history structure. 2022-02-08 16:58:24 -06:00
Ryan Pavlik 65ef8d58f1 d/ht: Cleanup usage of history buffer.
May wish to reconsider whether all these usages are required: they appear to only use the back (latest) element.
2022-02-08 17:00:11 +00:00
Moses Turner 614e0e58ae d/ht: use new HistoryBuf api 2022-02-08 17:00:11 +00:00
Ryan Pavlik d05df584b2 d/ht: Some cleanups 2022-02-08 17:00:11 +00:00
nima01 45466e419b d/wmr: Reverb G1 proximity sensor support 2022-02-02 02:27:55 +01:00
Christoph Haag 2ad634bd1e d/wmr: print json config on debug log level 2022-01-21 20:32:35 +00:00
Christoph Haag 6e339014a5 d/wmr: Add Medion Erazer X1000 2022-01-21 20:32:35 +00:00
Christoph Haag 45adabe135 d/wmr: Clarify comment in headset_map assert 2022-01-21 20:32:35 +00:00
Christoph Haag 88d55c6e22 d/wmr: Sort HP G2 controller PID to the other HP devices 2022-01-21 20:32:35 +00:00
Christoph Haag 96c09e06e7 d/wmr: consolidate interface getters
Moving them into one function makes it simpler to add more HMDs.
2022-01-21 20:32:35 +00:00
Ryan Pavlik c9889f776f xrt: Rename xrt_space_graph to xrt_relation_chain.
Rename all functions and instances accordingly as well,
and add documentation for all methods.
2022-01-21 19:54:30 +00:00
Moses Turner 2188d8afc2 d/remote: expose hand active state to remote gui 2022-01-18 14:33:11 -06:00
Jarvis Huang 52cb2ef123 d/android: Stop thread function when device destoryed 2022-01-05 14:59:39 +00:00
Simon Zeni 8b1d432b79 d/ht_ctrl_emu: fix crash and truncation warning 2021-12-24 15:19:51 -05:00
Mateo de Mayo 88a3848b5a d/wmr: Map wmr_source data to monotonic clock 2021-12-21 11:43:17 +00:00
Mateo de Mayo 74e149159b t/slam: Add SLAM_SUBMIT_FROM_START envvar
Useful for setups that need some tuning to their sensors before sending
data to a SLAM system.
Removes the submit_frames property from wmr_camera as this replaces it.
2021-12-21 11:43:17 +00:00
Mateo de Mayo 1c7323f1c2 d/rs: Generalize laser emitter option setup to any rs option 2021-12-21 11:43:17 +00:00
Mateo de Mayo fa431fc010 d/rs: Map all rs_hdev timestamps to monotonic clock 2021-12-21 11:43:17 +00:00
James Hogan 7ee8d1ac5d
xrt: Revert xrt_view::display::{w|h}_pixels changes
Commit 749723f0ba ("xrt: Remove xrt_view::display::{w|h}_meters")
accidentally removed some references to {w|h}_pixels as well as
{w|h}_meters. This resulted in recommended view image sizes of 0px*0px.

Revert those changes without reverting the rest of the commit.

Fixes: 749723f0ba ("xrt: Remove xrt_view::display::{w|h}_meters")
2021-12-20 23:00:40 +00:00
Simon Zeni 4e4e6708bc Revert "d/survive: ajust timestamp from button event"
This reverts commit b396c200d0.

The issue has been fixed in libsurvive [1]

[1]: https://github.com/cntools/libsurvive/pull/250
2021-12-17 13:40:53 -05:00
Moses Turner a19f13171b meson: use cjson_include with depthai driver 2021-12-14 14:12:42 +00:00
Christoph Haag b7c8a6faa5 d/ht_ctrl_emu: work around truncation warning
../src/xrt/drivers/ht_ctrl_emu/ht_ctrl_emu.cpp: In function ‘int cemu_devices_create(xrt_device*, xrt_device*, xrt_device**)’:
../src/xrt/drivers/ht_ctrl_emu/ht_ctrl_emu.cpp:439:102: warning: ‘ Left Hand’ directive output may be truncated writing 10 bytes into a region of size between 1 and 256 [-Wformat-truncation=]
  439 |                 int ret = snprintf(cemud[i]->base.str, XRT_DEVICE_NAME_LEN, i ? "%s Right Hand" : "%s Left Hand", hands->str);
      |                                                                                                      ^~~~~~~~~~
../src/xrt/drivers/ht_ctrl_emu/ht_ctrl_emu.cpp:439:35: note: ‘snprintf’ output between 11 and 266 bytes into a destination of size 256
  439 |                 int ret = snprintf(cemud[i]->base.str, XRT_DEVICE_NAME_LEN, i ? "%s Right Hand" : "%s Left Hand", hands->str);
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/xrt/drivers/ht_ctrl_emu/ht_ctrl_emu.cpp:439:84: warning: ‘ Right Hand’ directive output may be truncated writing 11 bytes into a region of size between 1 and 256 [-Wformat-truncation=]
  439 |                 int ret = snprintf(cemud[i]->base.str, XRT_DEVICE_NAME_LEN, i ? "%s Right Hand" : "%s Left Hand", hands->str);
      |                                                                                    ^~~~~~~~~~~
../src/xrt/drivers/ht_ctrl_emu/ht_ctrl_emu.cpp:439:35: note: ‘snprintf’ output between 12 and 267 bytes into a destination of size 256
  439 |                 int ret = snprintf(cemud[i]->base.str, XRT_DEVICE_NAME_LEN, i ? "%s Right Hand" : "%s Left Hand", hands->str);
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-12-14 14:58:33 +01:00
Christoph Haag 2b101e6ffa d/wmr: don't print NULL value in error message
In file included from ../src/xrt/drivers/wmr/wmr_config.h:15,
                 from ../src/xrt/drivers/wmr/wmr_config.c:16:
In function ‘wmr_config_parse_camera_config’,
    inlined from ‘wmr_config_parse_calibration’ at ../src/xrt/drivers/wmr/wmr_config.c:422:8,
    inlined from ‘wmr_hmd_config_parse’ at ../src/xrt/drivers/wmr/wmr_config.c:477:13:
../src/xrt/auxiliary/util/u_logging.h:84:25: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
   84 |                         u_log(__FILE__, __LINE__, __func__, level, __VA_ARGS__);                                       \
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/xrt/auxiliary/util/u_logging.h:220:38: note: in expansion of macro ‘U_LOG_IFL’
  220 | #define U_LOG_IFL_E(cond_level, ...) U_LOG_IFL(U_LOGGING_ERROR, cond_level, __VA_ARGS__)
      |                                      ^~~~~~~~~
../src/xrt/drivers/wmr/wmr_config.c:22:35: note: in expansion of macro ‘U_LOG_IFL_E’
   22 | #define WMR_ERROR(log_level, ...) U_LOG_IFL_E(log_level, __VA_ARGS__)
      |                                   ^~~~~~~~~~~
../src/xrt/drivers/wmr/wmr_config.c:267:17: note: in expansion of macro ‘WMR_ERROR’
  267 |                 WMR_ERROR(log_level, "Invalid camera calibration block %d - unknown camera purpose %s", c->n_cameras,
      |                 ^~~~~~~~~
../src/xrt/drivers/wmr/wmr_config.c: In function ‘wmr_hmd_config_parse’:
../src/xrt/drivers/wmr/wmr_config.c:267:100: note: format string is defined here
  267 |                 WMR_ERROR(log_level, "Invalid camera calibration block %d - unknown camera purpose %s", c->n_cameras,
      |                                                                                                    ^~
2021-12-14 14:54:47 +01:00
Christoph Haag 42ae21d412 d/hdk: Remove unused variable 2021-12-14 14:19:53 +01:00
Mateo de Mayo 74e79ff274 d/wmr: Add SLAM tracker 2021-12-13 10:41:55 +00:00
Mateo de Mayo d3bde043bd d/wmr: Forward IMU samples to wmr_source 2021-12-13 10:41:55 +00:00
Mateo de Mayo 41f42e0b3a d/wmr: Add wmr_source with camera streams support 2021-12-13 10:41:55 +00:00
Mateo de Mayo 92c1e55c37 d/wmr: Prepare HMD for SLAM tracking 2021-12-13 10:41:55 +00:00
Mateo de Mayo c1edfa95d7 d/wmr: Add Odyssey+ activation/deactivation functions
Co-authored-by: Jan Schmidt <jan@centricular.com>
2021-12-13 10:41:55 +00:00
Mateo de Mayo 7338aded9c d/wmr: Add exposure setting 2021-12-13 10:41:55 +00:00
Mateo de Mayo d9aaa4369f d/wmr: Add ROI rect for WMR cameras 2021-12-13 10:41:55 +00:00
Jan Schmidt 3bb3197fec d/wmr: Parse controller configuration
Extract LED and inertial sensor configuration from
controller JSON
2021-12-13 11:47:12 +11:00
Jan Schmidt ea4836b081 d/wmr: Read controller firmware configuration blocks.
Implement reading and logging of controller firmware blocks.

The main JSON configuration is obfuscated. The raw block can
be dumped to disk by setting the WMR_CONFIG_DUMP env var
to point to a directory to receive controller configs
2021-12-13 11:47:12 +11:00
Jan Schmidt 4e24a1277e d/wmr: Add pragma once to BT controller header 2021-12-13 11:47:12 +11:00
Jan Schmidt 1c67a1ff52 d/wmr: Add HP Reverb G2 controller PID
Recognise the HP Reverb G2 WMR controller if it is directly
connected via bluetooth (instead of tunnelled through the
headset like it normally would be).
2021-12-13 11:47:12 +11:00
Simon Zeni b396c200d0 d/survive: ajust timestamp from button event 2021-12-12 23:07:14 +00:00
Nima01 b3e0f5bc6a d/wmr: WMR Controller (BT): Don't waste CPU cycles when reading 2021-12-12 21:37:50 +01:00
Nima01 2d48a9bca2 d/wmr: WMR Controller (BT) 3DoF working, based on gyro and accel.
Tested on HP Reverb G1. Reading and applying device specific
config data is still pending.
2021-12-12 16:47:35 +00:00
Mateo de Mayo fe4f6c6eb0 misc: Improve wmr and euroc docs, fix ht memory leak, stride for cv::Mats 2021-12-12 13:13:18 -03:00
Moses Turner 749723f0ba xrt: Remove xrt_view::display::{w|h}_meters
It is not used anywhere.
2021-12-10 21:27:15 -06:00
Jakob Bornecrantz 59a09abf6a d/dai: Document work around 2021-12-10 21:31:28 +00:00
Jakob Bornecrantz 775d82d728 d/dai: Work around issue in v2.13.3 2021-12-10 21:31:28 +00:00
Moses Turner c66b29d117 d/wmr: use u_extents_2d_split_side_by_side instead of u_device_setup_split_side_by_side 2021-12-10 14:08:52 -06:00
nima01 d5d1695438 d/wmr: Hook up motion controller gyro and accel
Basic IMU setup with fusion. Reading and applying config callibration data from controller is still work in progress
2021-12-08 00:43:50 +00:00
Jakob Bornecrantz aad9b04a92 d/wmr: Fix warning and tidy 2021-12-07 13:30:45 +00:00
Jakob Bornecrantz eee143f401 d/rs: Use long name as documentation name 2021-12-07 11:26:20 +00:00
Jakob Bornecrantz 3e38ada9a5 build: s/rs/realsense/g 2021-12-07 11:26:20 +00:00
Jakob Bornecrantz 6ae52651c4 d/vive: Up max config z and json size, also tidy 2021-12-06 19:43:49 +00:00
Jan Schmidt 6cc92c369a d/wmr: Fix accel <-> gyro mixup in previous change.
There was a typo in the calibration bias/correction
patch that messed up accel values by accidentally
reusing the gyro value.
2021-12-06 01:45:25 +11:00
Jan Schmidt c06c3fa782 d/wmr: Make WMR to OpenXR coordinate transform explicit
Instead of negating Y and Z readings from the IMU when
parsing, parse the native values, then apply the rotation
using the centerline transform before fusion.
2021-12-05 00:09:25 +11:00
Jan Schmidt c7549c8680 d/wmr: Apply HMD IMU correction from calibration.
Apply the mix_matrix and bias_offsets adjustments for
IMU readings.
2021-12-05 00:06:05 +11:00
Jan Schmidt ee030ff0c8 d/wmr: Extend config reading to include bias/mix_matrix
Add extraction of bias offsets and mix_matrix (rotation)
correction for IMU accel, gyro and mag configuration entries.
2021-12-05 00:06:05 +11:00
Jan Schmidt 385a3bd33d d/wmr: Split out inertial sensor configuration
Inertial sensor configuration blocks are common to
both HMD and controller calibration. Factor out a
shared structure to receive them.
2021-12-05 00:06:05 +11:00
Jan Schmidt 76c18bfdc7 d/wmr: Rename wmr_config_parse to wmr_hmd_config_parse() 2021-12-05 00:06:05 +11:00
Jakob Bornecrantz 971739627a d/vive: Actually print error message to say what is going on 2021-12-03 21:13:57 +00:00
Moses Turner 8af3a47f5a cmake: make DepthAI driver link to aux_tracking 2021-12-03 19:22:57 +00:00
Jakob Bornecrantz efde7f185c a/math: Put m_relation_history_get out argument last 2021-12-03 14:00:32 +00:00
Mateo de Mayo e245f4e5a9 u/sink: Allow u_sink_queue to queue more than one frame
Passing max_size=1 gives a similar behaviour as before, although instead
of discarding the last enqueued frame, it just ignores the new frame.
2021-12-01 13:45:18 +00:00
Simon Zeni ba7f9d9578 d/ht_cemu: enable build if XRT_BUILD_DRIVER_HANDTRACKING is enabled 2021-12-01 05:36:05 +00:00
Simon Zeni 749792f324 d/ht_cemu: enable meson build 2021-12-01 05:36:05 +00:00