Monado OpenXR Runtime
vive_lighthouse.c File Reference

Vive Lighthouse Watchman implementation. More...

#include <asm/byteorder.h>
#include <stdint.h>
#include <string.h>
#include <zlib.h>
#include <stdio.h>
#include "math/m_api.h"
#include "util/u_debug.h"
#include "util/u_logging.h"
#include "vive_lighthouse.h"
Include dependency graph for vive_lighthouse.c:

Data Structures

struct  lighthouse_ootx_report
 

Macros

#define LH_TRACE(...)   U_LOG_IFL_T(log_level, __VA_ARGS__)
 
#define LH_DEBUG(...)   U_LOG_IFL_D(log_level, __VA_ARGS__)
 
#define LH_INFO(...)   U_LOG_IFL_I(log_level, __VA_ARGS__)
 
#define LH_WARN(...)   U_LOG_IFL_W(log_level, __VA_ARGS__)
 
#define LH_ERROR(...)   U_LOG_IFL_E(log_level, __VA_ARGS__)
 
#define SKIP_BIT   4
 
#define DATA_BIT   2
 
#define ROTOR_BIT   1
 

Functions

struct lighthouse_ootx_report __attribute__ ((packed))
 
float _f16_to_float (uint16_t f16)
 
static float __le16_to_float (__le16 le16)
 
static bool pulse_in_this_sync_window (int32_t dt, uint16_t duration)
 
static bool pulse_in_next_sync_window (int32_t dt, uint16_t duration)
 
static bool pulse_in_sweep_window (int32_t dt, uint16_t duration)
 
static void _handle_ootx_frame (struct lighthouse_base *base)
 
static void lighthouse_base_reset (struct lighthouse_base *base)
 
static void _handle_ootx_data_word (struct lighthouse_watchman *watchman, struct lighthouse_base *base)
 
static void lighthouse_base_handle_ootx_data_bit (struct lighthouse_watchman *watchman, struct lighthouse_base *base, bool data)
 
static void lighthouse_base_handle_frame (struct lighthouse_watchman *watchman, struct lighthouse_base *base, uint32_t sync_timestamp)
 
static void _handle_sync_pulse (struct lighthouse_watchman *watchman, struct lighthouse_pulse *sync)
 
static void _handle_sweep_pulse (struct lighthouse_watchman *watchman, uint8_t id, uint32_t timestamp, uint16_t duration)
 
static void accumulate_sync_pulse (struct lighthouse_watchman *watchman, uint8_t id, uint32_t timestamp, uint16_t duration)
 
void lighthouse_watchman_handle_pulse (struct lighthouse_watchman *watchman, uint8_t id, uint16_t duration, uint32_t timestamp)
 
void lighthouse_watchman_init (struct lighthouse_watchman *watchman, const char *name)
 

Variables

static enum u_logging_level log_level
 
__le16 version
 
__le32 serial
 
__le16 phase [2]
 
__le16 tilt [2]
 
__u8 reset_count
 
__u8 model_id
 
__le16 curve [2]
 
__s8 gravity [3]
 
__le16 gibphase [2]
 
__le16 gibmag [2]
 
static unsigned int watchman_id
 

Detailed Description

Vive Lighthouse Watchman implementation.

Author
Lubosz Sarnecki lubos.nosp@m.z.sa.nosp@m.rneck.nosp@m.i@co.nosp@m.llabo.nosp@m.ra.c.nosp@m.om