Commit graph

1033 commits

Author SHA1 Message Date
Mateo de Mayo 2bb0c5cda5 t/slam: Implement CSV writers for trajectories and timing info
This CSV files can be used for offline analysis.
2022-03-14 23:42:13 +00: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 1dbda3d8c8 t/euroc: Tie CSV file opening to recorder lifecycle
This is a better way of handling writing small but high frequency data
like IMU samples so as to avoid continuous opening and closing of a file.
2022-03-14 23:42:13 +00:00
Jakob Bornecrantz 37354b953c aux/vk: Add more timeline semaphore functions 2022-03-14 18:58:35 +00:00
Jakob Bornecrantz d0f6ea10bc u/worker: Fix some late feedback 2022-03-14 18:57:35 +00:00
Jakob Bornecrantz 84069cc4f0 u/logging: Add logging sink to intercept log messages 2022-03-14 17:21:20 +00:00
Antonio Ospite 37852ffa65 xrt: fix -Wreturn-type warnings
Add some missing returns pointed out by -Wreturn-type:

-----------------------------------------------------------------------
[75/1571] Building C object src/xrt/auxiliary/CMakeFiles/aux_util.dir/util/u_config_json.c.o
.../src/xrt/auxiliary/util/u_config_json.c: In function ‘u_gui_state_scene_to_string’:
.../src/xrt/auxiliary/util/u_config_json.c:524:1: warning: control reaches end of non-void function [-Wreturn-type]
  524 | }
      | ^
-----------------------------------------------------------------------
2022-03-14 14:06:02 +00:00
Jakob Bornecrantz 771aeda784 u/worker: Add task worker helper 2022-03-11 15:29:16 +00:00
Jakob Bornecrantz 76d8944765 os/threading: Add os_cond wrapper 2022-03-11 15:29:16 +00:00
Antonio Ospite e8c9d8f575 xrt: fix -Wunused-variable warnings
Some variables are only used in asserts, so they may be unused
depending on the build type:

-----------------------------------------------------------------------
[68/315] Building C object src/xrt/auxiliary/CMakeFiles/aux_util.dir/util/u_sink_combiner.c.o
.../src/xrt/auxiliary/util/u_sink_combiner.c:188:11: warning: unused variable 'diff_ns' [-Wunused-variable]
                int64_t diff_ns = frames[0]->timestamp - frames[1]->timestamp;
                        ^
1 warning generated.
[205/315] Building C object src/xrt/compositor/CMakeFiles/comp_main.dir/main/comp_renderer.c.o
.../src/xrt/compositor/main/comp_renderer.c:872:17: warning: unused variable 'layer_count' [-Wunused-variable]
        const uint32_t layer_count = c->base.slot.layer_count;
                       ^
1 warning generated.
-----------------------------------------------------------------------

Mark them as XRT_MAYBE_UNUSED to fix the build warnings.
2022-03-09 14:53:06 +01:00
Antonio Ospite 14a1ced0e4 xrt: fix -Wreturn-type warnings
Add some missing returns pointed out by -Wreturn-type:

-----------------------------------------------------------------------
[32/315] Building C object src/xrt/auxiliary/CMakeFiles/aux_gstreamer.dir/gstreamer/gst_sink.c.o
.../src/xrt/auxiliary/gstreamer/gst_sink.c:53:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
1 warning generated.
[84/315] Building C object src/xrt/auxiliary/CMakeFiles/aux_vk.dir/vk/vk_compositor_flags.c.o
.../src/xrt/auxiliary/vk/vk_compositor_flags.c:117:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
.../src/xrt/auxiliary/vk/vk_compositor_flags.c:146:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
2 warnings generated.
-----------------------------------------------------------------------

For the function returning VkImageAspectFlags return a literal 0 because
the enum values VK_IMAGE_ASPECT_NONE or VK_IMAGE_ASPECT_NONE_KHR may not
always be defined.
2022-03-09 14:52:29 +01:00
Jakob Bornecrantz 17e9e06de7 aux/vk: Detect external semaphore support 2022-03-08 21:04:56 +00:00
Jakob Bornecrantz c0bd8ce3ba aux/vk: Let vk_init_from_given enable timeline semaphores 2022-03-08 21:04:56 +00:00
Jakob Bornecrantz 3c8378631f aux/vk: Properly set log_level in given vk_bundles 2022-03-08 21:04:56 +00:00
Jakob Bornecrantz 3044794f93 aux/vk: Rename timeline_semaphores to features.timeline_semaphore 2022-03-08 21:04:56 +00:00
Moses Turner 7235b6a45a u/sink: Add some comments 2022-03-08 20:38:58 +00:00
Moses Turner 37f0c901d2 u/sink: Add sink to convert from stereo to two SLAM frames 2022-03-08 20:38:58 +00:00
Jakob Bornecrantz 7b0cee5a85 u/trace_marker: Add new tracking category 2022-03-08 10:46:48 +00:00
Jakob Bornecrantz d06bb04357 u/trace_marker: Tidy 2022-03-08 10:46:47 +00:00
Jakob Bornecrantz 0ebb1c3be9 t/psmv: Make TrackerPSMV be standard layout 2022-03-07 16:48:28 +00:00
Moses Turner ffee6c360b u/sink: Don't sleep when combining frames; we're not testing
Where's the dunce cap?
2022-03-01 01:14:57 -06:00
Jakob Bornecrantz f5c77dfb32 aux/vk: Add vk_create_and_submit_fence_native 2022-02-24 20:54:47 +00:00
Jakob Bornecrantz 78f3340bf5 aux/vk: Check which fence types support import and export 2022-02-24 20:54:47 +00:00
Jakob Bornecrantz ebe895bdb8 aux/vk: Add vkGetPhysicalDeviceExternal[Buffer|Fence|Semaphore]PropertiesKHR (NFC) 2022-02-24 17:51:59 +00:00
Jakob Bornecrantz 543f28abf9 aux/vk: Add vkGetFenceWin32HandleKHR (NFC) 2022-02-24 17:51:59 +00:00
Jakob Bornecrantz 36025886ee aux/vk: Refactor our sync primitives (NFC) 2022-02-24 17:51:59 +00:00
Jakob Bornecrantz d6e0c45855 aux/vk: Order files in build scripts (NFC) 2022-02-24 17:51:59 +00:00
Connor Smith e1c180240e Create VkQueue with queueIndex from XrGraphicsBindingVulkanKHR.
Per XR_KHR_vulkan_enable: "the OpenXR runtime must interpret the image
as being owned by the VkQueue specified in XrGraphicsBindingVulkanKHR."
(https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_vulkan_enable)
2022-02-23 17:45:46 -05:00
Mateo de Mayo a0021dc7d0 t/euroc: Fix memory leak in euroc recorder
This was the reason the recorder was eating so much RAM.
SSD write speeds should be enough for common use cases to keep RAM stable.
2022-02-22 22:56:07 +00:00
Ryan Pavlik 7b3a2e7c1a a/math: C wrapper for the float low-pass filter too. 2022-02-22 16:44:44 -06:00
Ryan Pavlik cf07791e93 a/math: Add a C wrapper for the integer low-pass filter. 2022-02-22 16:42:53 -06:00
Ryan Pavlik a0e2df4cf0 tracking/math: Move the generic low pass filters to a/math 2022-02-22 16:42:53 -06:00
Ryan Pavlik 4156cabedf a/tracking: Add an integer version of the low-pass filter. 2022-02-22 09:58:19 -06:00
Ryan Pavlik 928254ffed a/math: Add a rational number struct template. 2022-02-22 09:58:19 -06: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
Mateo de Mayo 17dee2bb68 t/slam: Cache tracked pose timestamp
This is mainly to avoid problems with filters that calculate
their dt from previous calls. In particular the one euro filter fix
that gets implemented in the next commit would crash because of dt=0.
2022-02-22 13:34:45 +00:00
Mateo de Mayo b04c26e522 a/math: Expose quat_{exp, ln} and test them 2022-02-22 13:34:45 +00:00
Moses Turner 8972778e00 a/vk: Remove superfluous format assignment in the readback pool
This also caused a segfault when the readback pool filled up.
2022-02-20 00:51:26 -06: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
Moses Turner 2e8f572a4d aux/vk: Add util to read VkImages back to a pool of xrt_frames
Co-authored-by: Jakob Bornecrantz <jakob@collabora.com>
2022-02-18 20:26:27 -06:00
Moses Turner 8f792c9165 u/sink: Add u_sink_create_to_r8g8b8_r8g8b8a8_r8g8b8x8_or_l8 2022-02-18 20:06:20 -06:00
Moses Turner 433ae0d9c6 aux/gst: Support RGBA and images with unusual row strides 2022-02-18 20:06:20 -06:00
Moses Turner 727c087366 aux/vk: Add helper for adding image memory barriers 2022-02-18 20:06:20 -06:00
Moses Turner 5a2088ee3e aux/vk: Add vkCmdBlitImage to vk_helpers 2022-02-18 20:06:20 -06:00
Moses Turner 3a7569a7b0 u/trace_marker: Add COMP_TRACE_IDENT 2022-02-18 20:06:20 -06:00
Moses Turner 00984aa021 aux/vk: Add advanced create image function 2022-02-18 20:06:20 -06:00
Jakob Bornecrantz ba0f7cba8b aux/vk: More comments 2022-02-19 00:34:01 +00:00
Jakob Bornecrantz 5222dfd728 aux/vk: Refactor and document various compositor swapchain image flags
This also fixes two errors:
* VK_IMAGE_USAGE_SAMPLED_BIT was not always added to depth formats.
* VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT was added to image
  views for sampling, where the spec only allows one of them.
2022-02-18 21:32:05 +00:00
Jakob Bornecrantz 05771e7b9e aux/vk: Rename compositor swapchain image helper functions (NFC) 2022-02-18 21:32:05 +00:00
Jakob Bornecrantz ad5a057737 aux/vk: Refactor out swapchain functions to own file (NFC) 2022-02-18 21:32:05 +00:00
Jakob Bornecrantz 4539b74e56 aux/vk: Re-org one function (NFC) 2022-02-18 21:32:05 +00:00
Jakob Bornecrantz 20c7e30304 aux/vk: Remove unnecessary breaks 2022-02-18 18:29:28 +00:00
Jakob Bornecrantz 0126819f21 aux/vk: Use aspect mask that covers both depth and stencil for mixed formats 2022-02-18 18:29:28 +00:00
Jakob Bornecrantz 9a884931bb c/client: Use correct VkImageAspectFlags in barriers 2022-02-17 19:29:57 +00:00
Jakob Bornecrantz 223aa515fd u/device: Add u_device_get_view_poses helper 2022-02-16 23:15:07 +00:00
Jakob Bornecrantz 47ae7c19c3 u/trace_marker: Add driver category 2022-02-16 22:25:55 +00:00
Jakob Bornecrantz 91a2a5d29d c/client: Set correct optimal layout for client swapchains 2022-02-16 18:20:44 +00:00
Mateo de Mayo 83fceec521 t/slam: Add filtering methods to the tracker
Adds three toggleable filters:
- Moving average
- Exponential smoothing
- One euro filter
2022-02-14 10:22:05 -03:00
Mateo de Mayo b90d60a9ce t/slam: Add prediction types that integrate gyro and accel samples 2022-02-14 10:22:05 -03:00
Mateo de Mayo 8820a3e99c a/math: Add m_filter_euro_quat 2022-02-14 10:22:05 -03:00
Mateo de Mayo 06597a0655 a/math: Add math_quat_{len, unrotate} 2022-02-14 10:22:05 -03:00
Mateo de Mayo cf5574a4e9 m/space: Add m_space_relation_interpolate 2022-02-14 10:22:05 -03:00
Moses Turner e553d1993b u/sink: refactor u_sink_combiner
So you can use the enforcing-genlock bit elsewhere
2022-02-10 10:55:06 -06:00
Ryan Pavlik acc9683e0f a/util: Fix copy/move assign of history buf 2022-02-08 17:08:00 -06:00
Ryan Pavlik a904914e6e a/util: Wrap "just enough" of the ring buffer stuff for generic use from C. 2022-02-08 13:18:15 -06:00
Ryan Pavlik 3b0252bda8 a/util: Don't make the RingBufferHelper compile-depend on max size. 2022-02-08 13:18:05 -06:00
Ryan Pavlik c079eabfdf a/util: iterator cleanups to reduce diffs, using a self typedef. 2022-02-08 17:00:11 +00:00
Ryan Pavlik 6908486022 a/util: Add age clamping to history buffer. 2022-02-08 17:00:11 +00:00
Ryan Pavlik 603117a1d1 a/util: Split history buf file up, factor out more generic iterator base 2022-02-08 17:00:11 +00:00
Ryan Pavlik 94e053d0d4 a/math: More relation history cleanup 2022-02-08 17:00:11 +00:00
Ryan Pavlik 1c183a9eeb a/math: Simplify m_history_relation using standard algorithms 2022-02-08 17:00:11 +00:00
Ryan Pavlik 90c74578d1 a/util: Refactor HistoryBuffer to be more like a standard container. 2022-02-08 17:00:11 +00:00
Ryan Pavlik 8030468f95 os: Add a c++ wrapper for our mutex types 2022-02-08 17:00:11 +00:00
Ryan Pavlik 9b6d117970 a/util: Some reorg and renaming in upa to be closer to upc 2022-02-08 10:51:40 -06:00
Ryan Pavlik 78e9acc6c4 a/util: Remove unused member in upc 2022-02-08 10:51:39 -06:00
Ryan Pavlik 0f8565ec71 a/util: Some further internal renames for pacing 2022-02-08 10:51:39 -06:00
Ryan Pavlik 6345962d66 a/util: Rename app_time_* in u_pc to comp_time_* 2022-02-08 10:51:39 -06:00
Ryan Pavlik d176b18598 a/util: Allow upc present offset to be variable. 2022-02-08 10:51:39 -06:00
Ryan Pavlik 2238aff403 a/util: Catch frame_id mismatch in u_pacing_compositor 2022-02-08 10:51:39 -06:00
Ryan Pavlik a2e1eb7e75 a/util: Have all timestamps be injected into pacing.
No more calling os_monotonic_get_ns() inside the pacing helpers.
Much better testability.
2022-02-08 10:51:39 -06:00
Ryan Pavlik d969bc334f a/util: More pacing documentation 2022-02-07 13:11:00 -06:00
Jakob Bornecrantz 309c45f4c4 aux/bindings: Tidy 2022-01-31 22:43:09 +00:00
Jakob Bornecrantz 037b161fb4 aux/binding: Rename function 2022-01-31 22:43:09 +00:00
Jakob Bornecrantz f0a5f1977c aux/bindings: Add OpenXR Identifier 2022-01-31 22:43:09 +00:00
Ryan Pavlik 9b9e23be62 a/util: Add a new constructor and a new method to u_string_list 2022-01-24 16:34:45 -06:00
Ryan Pavlik d057f00b54 doc: Fix broken link 2022-01-24 14:08:06 -06: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 7b3378b28a aux/tracking; st/gui: save/load calibration gui state to file 2022-01-18 17:18:43 +00:00
Moses Turner 254c233c76 util/u_config_json: add functions to save/load gui state to file 2022-01-18 17:18:43 +00:00
Ryan Pavlik 6677d42642 a/util: Frame pacing docs and some error handling 2022-01-15 01:06:48 +00:00
Ryan Pavlik a7c22fd185 a/util: Rename u_render_timing to u_pacing_app and u_frame_timing to u_pacing_compositor.
They both control pacing, but for different uses. Neither actually performs any timing.
2022-01-15 01:06:48 +00:00
Ryan Pavlik 365b3ca8d4 a/util: Make display timing helper more configurable.
Also comment some display timing interfaces better.
2022-01-15 01:06:48 +00:00
Christoph Haag f978f2691d aux/vk: Don't leak VkExtensionProperties 2022-01-13 23:48:44 +01:00
Christoph Haag 147851ffdc aux/ft: Add some documentation comments 2022-01-13 23:07:57 +01:00
Christoph Haag 3eecb0f991 aux/vk: Add vkGetPhysicalDeviceSurfaceCapabilities2EXT function 2022-01-13 23:07:16 +01:00
Christoph Haag 693aceb755 aux/vk: Add VK_EXT_display_control functions 2022-01-13 23:07:16 +01:00
Christoph Haag ec64a856b4 aux/vk: Use VK_DEBUG instead of U_LOG for vk device ext selection 2022-01-13 23:07:01 +01:00
Christoph Haag 8e020fac2d c/main: Add and enable VK_EXT_display_control optional device ext 2022-01-13 23:06:40 +01:00