Skip to content

Commit

Permalink
Add initial Rift S driver
Browse files Browse the repository at this point in the history
This is a preliminary 3DOF driver for the Rift S headset and
controllers. Rotational IMU tracking and controller
controls are supported. It would also be possible to
publish more from the controllers with additional OpenHMD API,
such as capsense touch information for each button/trigger.

Distortion parameters are taken from the CV1 and need improving,
but aren't completely wrong.

Partially fixes OpenHMD#225
  • Loading branch information
thaytan committed Jun 22, 2020
1 parent 8687e4f commit 87f110f
Show file tree
Hide file tree
Showing 16 changed files with 2,662 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ set(openhmd_source_files
)

option(OPENHMD_DRIVER_OCULUS_RIFT "Oculus Rift DK1 and DK2" ON)
option(OPENHMD_DRIVER_OCULUS_RIFT_S "Oculus Rift S" ON)
option(OPENHMD_DRIVER_DEEPOON "Deepoon E2" ON)
option(OPENHMD_DRIVER_WMR "Windows Mixed Reality" ON)
option(OPENHMD_DRIVER_PSVR "Sony PSVR" ON)
Expand Down Expand Up @@ -58,6 +59,20 @@ if(OPENHMD_DRIVER_OCULUS_RIFT)
set(LIBS ${LIBS} ${HIDAPI_LIBRARIES})
endif(OPENHMD_DRIVER_OCULUS_RIFT)

if(OPENHMD_DRIVER_OCULUS_RIFT_S)
set(openhmd_source_files ${openhmd_source_files}
${CMAKE_CURRENT_LIST_DIR}/src/drv_oculus_rift_s/rift-s.c
${CMAKE_CURRENT_LIST_DIR}/src/drv_oculus_rift_s/rift-s-firmware.c
${CMAKE_CURRENT_LIST_DIR}/src/drv_oculus_rift_s/rift-s-protocol.c
${CMAKE_CURRENT_LIST_DIR}/src/ext_deps/nxjson.c
)
add_definitions(-DDRIVER_OCULUS_RIFT_S)

find_package(HIDAPI REQUIRED)
include_directories(${HIDAPI_INCLUDE_DIRS})
set(LIBS ${LIBS} ${HIDAPI_LIBRARIES})
endif(OPENHMD_DRIVER_OCULUS_RIFT_S)

if(OPENHMD_DRIVER_DEEPOON)
set(openhmd_source_files ${openhmd_source_files}
${CMAKE_CURRENT_LIST_DIR}/src/drv_deepoon/deepoon.c
Expand Down
14 changes: 14 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ if _drivers.contains('rift')
deps += dep_hidapi
endif

_drivers = get_option('drivers')
if _drivers.contains('rift-s')
sources += [
'src/drv_oculus_rift_s/rift-s.c',
'src/drv_oculus_rift_s/rift-s-controller.c',
'src/drv_oculus_rift_s/rift-s-protocol.c',
'src/drv_oculus_rift_s/rift-s-firmware.c',
'src/drv_oculus_rift_s/rift-s-radio.c',
'src/ext_deps/nxjson.c',
]
c_args += '-DDRIVER_OCULUS_RIFT_S'
deps += dep_hidapi
endif

if _drivers.contains('deepoon')
sources += [
'src/drv_deepoon/deepoon.c',
Expand Down
2 changes: 2 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ option(
type: 'array',
choices: [
'rift',
'rift-s',
'deepoon',
'psvr',
'vive',
Expand All @@ -28,6 +29,7 @@ option(
],
value: [
'rift',
'rift-s',
'deepoon',
'psvr',
'vive',
Expand Down
Loading

0 comments on commit 87f110f

Please sign in to comment.