* 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.
- Add CMakeUserPresets.json to .gitignore
- Fix DASSERTs warning for release builds
- Do not use one euro filter with invalid poses
- Other NFC style changes
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.
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.
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.
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.
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")
../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);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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,
| ^~
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
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).
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.
Extract timestamp in source 100ns units and convert to
nanoseconds, then place them in the emitted xrt_frames.
Unwrap the 8-bit frame sequence counter to 64-bits, and
add that too.
Add some comments and debug for other fields in the
incoming data.
OpenHMD has a global variable wmr_config_key too which is exported in some
build configurations, causing Monado to fail linking openhmd and the wmr
driver together.
Add a debug report for 0x17 packets on Reverb G2 that
report controller statuses. The statuses seen so far
are 0x0 for unpaired, 0x1 for paired but offline, and
0x2 for online. Paired reports provide VID and PID for the
associated motion controller.
Handle the debug message packet from the bluetooth
interface on the HP G2. There might be other packet
types, but that's the only one I've seen so far.
Compute the frame size required for the cameras on a given
headset.
Copy the pixels out into an xrt_frame, then send it
to a debug sink - one for SLAM tracking exposures, and
1 for controller frames.
Based on a patch by Jakob Bornecrantz
Older linux kernels like 4.15 don't have V4L2_CID_DIGITAL_GAIN or
V4L2_CTRL_FLAG_MODIFY_LAYOUT, add conditional guards to build
successfully on systems with such kernels.
This matches the OpenXR usage: the array is the plural of the element type,
and the count is the singular element type plus "count" (usually CountOutput
because of the two-call idiom)
Includes fixes to other code to match API changes.
We now have a cmake-format config file.
We no longer use list variables for sources, instead using
target_sources when we need to add, in accordance with current
best practice. (This makes it a lot easier to edit too.) There's no more
include_directories(), add_definitions(), or other gently-deprecated
directory-scoped commands, nor any CMake scripts that include
a parent directory reference (named targets instead)
Use a similar "hardcoded" idea as in p_factory_ensure_frameserver.
This fix usage of SLAM sources in other contexts like calibration, at the
cost of requiring a device to call create_tracked_slam at least once.
(again, similar to how psmv/psvr/hand tracking work already)
- Prevent race conditions with a lock
- Check that timestamps "domains" are the same across samples
- Use faster sensor to push the IMU sample instead of always gyro