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"
|
#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) |
|
|
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...
|
|
|
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_base * | wmr_controller_og_create (struct wmr_controller_connection *conn, enum xrt_device_type controller_type, uint16_t pid, enum u_logging_level log_level) |
|
◆ wmr_controller_og_input_index
Indices in input list of each input.
◆ binding_profiles_odyssey
Initial value:= {
{
.name = XRT_DEVICE_SIMPLE_CONTROLLER,
.inputs = 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
Initial value:= {
{
.name = XRT_DEVICE_SIMPLE_CONTROLLER,
.inputs = simple_inputs_og,
.outputs = simple_outputs_og,
},
}
◆ simple_inputs_odyssey
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
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
Initial value:= {
{XRT_OUTPUT_NAME_SIMPLE_VIBRATION, XRT_OUTPUT_NAME_ODYSSEY_CONTROLLER_HAPTIC},
}
◆ simple_outputs_og
Initial value:= {
{XRT_OUTPUT_NAME_SIMPLE_VIBRATION, XRT_OUTPUT_NAME_WMR_HAPTIC},
}