Monado OpenXR Runtime
wmr_controller_og.c File Reference

Driver for WMR Controllers. More...

#include "math/m_api.h"
#include "util/u_device.h"
#include "util/u_trace_marker.h"
#include "util/u_var.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include "wmr_common.h"
#include "wmr_controller.h"
Include dependency graph for wmr_controller_og.c:

Data Structures

struct  wmr_controller_og_input
 
struct  wmr_controller_og
 

Macros

#define WMR_PACKED
 
#define SET_WMR_INPUT(wcb, NAME)   (wcb->base.inputs[WMR_CONTROLLER_INDEX_##NAME].name = XRT_INPUT_WMR_##NAME)
 
#define SET_ODYSSEY_INPUT(wcb, NAME)    (wcb->base.inputs[WMR_CONTROLLER_INDEX_##NAME].name = XRT_INPUT_ODYSSEY_CONTROLLER_##NAME)
 

Enumerations

enum  wmr_controller_og_input_index {
  WMR_CONTROLLER_INDEX_MENU_CLICK , WMR_CONTROLLER_INDEX_HOME_CLICK , WMR_CONTROLLER_INDEX_SQUEEZE_CLICK , WMR_CONTROLLER_INDEX_TRIGGER_VALUE ,
  WMR_CONTROLLER_INDEX_THUMBSTICK_CLICK , WMR_CONTROLLER_INDEX_THUMBSTICK , WMR_CONTROLLER_INDEX_TRACKPAD_CLICK , WMR_CONTROLLER_INDEX_TRACKPAD_TOUCH ,
  WMR_CONTROLLER_INDEX_TRACKPAD , WMR_CONTROLLER_INDEX_GRIP_POSE , WMR_CONTROLLER_INDEX_AIM_POSE
}
 Indices in input list of each input. More...
 

Functions

static void vec3_from_wmr_controller_accel (const int32_t sample[3], struct xrt_vec3 *out_vec)
 
static void vec3_from_wmr_controller_gyro (const int32_t sample[3], struct xrt_vec3 *out_vec)
 
static bool wmr_controller_og_packet_parse (struct wmr_controller_og *ctrl, const unsigned char *buffer, size_t len)
 
static bool handle_input_packet (struct wmr_controller_base *wcb, uint64_t time_ns, uint8_t *buffer, uint32_t buf_size)
 
static xrt_result_t wmr_controller_og_update_inputs (struct xrt_device *xdev)
 
static void wmr_controller_og_set_output (struct xrt_device *xdev, enum xrt_output_name name, const union xrt_output_value *value)
 
static void wmr_controller_og_destroy (struct xrt_device *xdev)
 
struct wmr_controller_basewmr_controller_og_create (struct wmr_controller_connection *conn, enum xrt_device_type controller_type, uint16_t pid, enum u_logging_level log_level)
 

Variables

static struct xrt_binding_input_pair simple_inputs_og [4]
 
static struct xrt_binding_output_pair simple_outputs_og [1]
 
static struct xrt_binding_profile binding_profiles_og [1]
 
static struct xrt_binding_input_pair simple_inputs_odyssey [4]
 
static struct xrt_binding_output_pair simple_outputs_odyssey [1]
 
static struct xrt_binding_profile binding_profiles_odyssey [1]
 

Detailed Description

Driver for WMR Controllers.

Author
Jan Schmidt jan@c.nosp@m.entr.nosp@m.icula.nosp@m.r.co.nosp@m.m

Enumeration Type Documentation

◆ wmr_controller_og_input_index

Indices in input list of each input.

Variable Documentation

◆ binding_profiles_odyssey

struct xrt_binding_profile binding_profiles_odyssey[1]
static
Initial value:
= {
{
.name = XRT_DEVICE_SIMPLE_CONTROLLER,
.inputs = simple_inputs_odyssey,
.input_count = ARRAY_SIZE(simple_inputs_odyssey),
.outputs = simple_outputs_odyssey,
.output_count = ARRAY_SIZE(simple_outputs_odyssey),
},
}
#define ARRAY_SIZE(a)
Array size helper.
Definition: xrt_compiler.h:30

◆ binding_profiles_og

struct xrt_binding_profile binding_profiles_og[1]
static
Initial value:
= {
{
.name = XRT_DEVICE_SIMPLE_CONTROLLER,
.inputs = simple_inputs_og,
.input_count = ARRAY_SIZE(simple_inputs_og),
.outputs = simple_outputs_og,
.output_count = ARRAY_SIZE(simple_outputs_og),
},
}

◆ simple_inputs_odyssey

struct xrt_binding_input_pair simple_inputs_odyssey[4]
static
Initial value:
= {
{XRT_INPUT_SIMPLE_SELECT_CLICK, XRT_INPUT_ODYSSEY_CONTROLLER_TRIGGER_VALUE},
{XRT_INPUT_SIMPLE_MENU_CLICK, XRT_INPUT_ODYSSEY_CONTROLLER_MENU_CLICK},
{XRT_INPUT_SIMPLE_GRIP_POSE, XRT_INPUT_ODYSSEY_CONTROLLER_GRIP_POSE},
{XRT_INPUT_SIMPLE_AIM_POSE, XRT_INPUT_ODYSSEY_CONTROLLER_AIM_POSE},
}

◆ simple_inputs_og

struct xrt_binding_input_pair simple_inputs_og[4]
static
Initial value:
= {
{XRT_INPUT_SIMPLE_SELECT_CLICK, XRT_INPUT_WMR_TRIGGER_VALUE},
{XRT_INPUT_SIMPLE_MENU_CLICK, XRT_INPUT_WMR_MENU_CLICK},
{XRT_INPUT_SIMPLE_GRIP_POSE, XRT_INPUT_WMR_GRIP_POSE},
{XRT_INPUT_SIMPLE_AIM_POSE, XRT_INPUT_WMR_AIM_POSE},
}

◆ simple_outputs_odyssey

struct xrt_binding_output_pair simple_outputs_odyssey[1]
static
Initial value:
= {
{XRT_OUTPUT_NAME_SIMPLE_VIBRATION, XRT_OUTPUT_NAME_ODYSSEY_CONTROLLER_HAPTIC},
}

◆ simple_outputs_og

struct xrt_binding_output_pair simple_outputs_og[1]
static
Initial value:
= {
{XRT_OUTPUT_NAME_SIMPLE_VIBRATION, XRT_OUTPUT_NAME_WMR_HAPTIC},
}