Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #65 from HipsterSloth/openvr_update
Browse files Browse the repository at this point in the history
The Grand SteamVRInput Update
  • Loading branch information
HipsterSloth authored Dec 3, 2018
2 parents 30365f8 + ec0194f commit ba3be31
Show file tree
Hide file tree
Showing 167 changed files with 14,579 additions and 5,567 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
Expand All @@ -28,9 +27,12 @@
*.app

# Build directories
build*
build
bin*

# Project IDE dirs
generated*

# Auto-downloaded Dependencies
deps

Expand All @@ -41,4 +43,4 @@ docs
SetBuildVars.bat

# Allow source model files
!src/openvr_plugin/resources/*.obj
!src/openvr_plugin/resources/*.obj
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "thirdparty/openvr"]
path = thirdparty/openvr
url = https://github.com/ValveSoftware/openvr.git
[submodule "thirdparty/Configuru"]
path = thirdparty/Configuru
url = https://github.com/emilk/Configuru.git
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Note: For now this build script just builds doxygen pages and deploys them to the gh-branch on each commit.
# When the PSMoveService has a linux library published (WIP) uncomment the build to compile
# against linux.
language: cpp
addons:
apt:
packages: cmake
before_install:
- sudo apt-get update && sudo apt-get install doxygen
# TODO uncomment this when PSMoveService has a linux published library
# - generate.sh
script:
doxygen doc/Doxyfile # Generate Doxygen Documentation
# TODO uncomment this when PSMoveService has a linux published library
# - build.sh
deploy: # Publish static Doxygen html files to gh-pages branch, accessible at https://<username>.github.io/PSMoveSteamVRBridge
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN # Set in travis-ci.org dashboard, marked secure
keep-history: true
local-dir: docs/html
on:
branch: master
99 changes: 12 additions & 87 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
cmake_minimum_required(VERSION 3.2)
project(PSMoveSteamVRBridge VERSION 0.1.0)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/main/cmake/CMakeUtils.txt)
include(ExternalProject)

set(ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})

LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
IF (NOT MSVC)
set(CMAKE_CXX_FLAGS "-std=c++11")
Expand All @@ -24,92 +25,16 @@ ENDIF()

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Shared architecture label used for install folder locations
if (${CMAKE_C_SIZEOF_DATA_PTR} EQUAL 8)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(ARCH_LABEL "Win64")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(ARCH_LABEL "OSX64")
else()
set(ARCH_LABEL "Linux64")
endif()
else()
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(ARCH_LABEL "Win32")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(ARCH_LABEL "OSX32")
else()
set(ARCH_LABEL "Linux32")
endif()
endif()
# Set project info
set(PSM_DRIVER_PROJECT_NAME "PSMoveSteamVRBridge")
set(TARGET_BUILD_DIR "build")
message(STATUS "Project driver version: ${DRIVER_VERSION}")
message(STATUS "Project name: ${PSM_DRIVER_PROJECT_NAME}")
message(STATUS "Target build directory: ${TARGET_BUILD_DIR}")

#------------------------
# Project Version
#------------------------

# Retrieve version from header file
set(PSM_DRIVER_VERSION_HEADER_FILE "${ROOT_DIR}/src/openvr_plugin/driver_version.h")

file(STRINGS ${PSM_DRIVER_VERSION_HEADER_FILE} PSM_DRIVER_VERSION_PARTS
REGEX "^#define[ \t]+PSM_DRIVER_VERSION_(MAJOR|MINOR|HOTFIX)[ \t]+[0-9]+$")
# Configure and build external projects
build_external_project(PSMoveService ${ROOT_DIR}/deps ${PSM_PACKAGE_URL})
build_external_project(OpenVR ${ROOT_DIR}/deps ${OPENVR_PACKAGE_URL})

# Verify version parts
string(REGEX MATCH "PSM_DRIVER_VERSION_MAJOR[ \t]+[0-9]+" PSM_DRIVER_VERSION_MAJOR ${PSM_DRIVER_VERSION_PARTS})
string(REGEX MATCH "PSM_DRIVER_VERSION_MINOR[ \t]+[0-9]+" PSM_DRIVER_VERSION_MINOR ${PSM_DRIVER_VERSION_PARTS})
string(REGEX MATCH "PSM_DRIVER_VERSION_HOTFIX[ \t]+[0-9]+" PSM_DRIVER_VERSION_HOTFIX ${PSM_DRIVER_VERSION_PARTS})

if(NOT PSM_DRIVER_VERSION_MAJOR
OR NOT PSM_DRIVER_VERSION_MINOR
OR NOT PSM_DRIVER_VERSION_HOTFIX)
message(FATAL_ERROR "Unable to retrieve project version from ${PSM_DRIVER_VERSION_HEADER_FILE}")
endif()

# Extract version numbers
string(REGEX REPLACE "PSM_DRIVER_VERSION_MAJOR[ \t]+([0-9]+)" "\\1" PSM_DRIVER_VERSION_MAJOR ${PSM_DRIVER_VERSION_MAJOR})
string(REGEX REPLACE "PSM_DRIVER_VERSION_MINOR[ \t]+([0-9]+)" "\\1" PSM_DRIVER_VERSION_MINOR ${PSM_DRIVER_VERSION_MINOR})
string(REGEX REPLACE "PSM_DRIVER_VERSION_HOTFIX[ \t]+([0-9]+)" "\\1" PSM_DRIVER_VERSION_HOTFIX ${PSM_DRIVER_VERSION_HOTFIX})

set(PSM_DRIVER_VERSION_STRING "${PSM_DRIVER_VERSION_MAJOR}.${PSM_DRIVER_VERSION_MINOR}.${PSM_DRIVER_VERSION_HOTFIX}")

message(STATUS "Project version: ${PSM_DRIVER_VERSION_STRING}")

set(PSM_DRIVER_PROJECT_NAME "PSMoveSteamVRBridge_${PSM_DRIVER_VERSION_STRING}")

# PSMoveService Build

# Make sure psmoveservice build URL has been specified
IF(NOT PSMOVESERVICE_BUILD_URL)
message(FATAL_ERROR "Please set PSMoveService build URL using -DPSMOVESERVICE_BUILD_URL=/path/to/psmoveservice/build.zip")
ELSE()
message(STATUS "PSMoveService Build URL: ${PSMOVESERVICE_BUILD_URL}")
ENDIF()

ExternalProject_Add(
PSMoveService
PREFIX ${ROOT_DIR}/deps/PSMoveService
URL ${PSMOVESERVICE_BUILD_URL}
# Disable install step
INSTALL_COMMAND ""
# Disable the configure step
CONFIGURE_COMMAND ""
# Disable the build step
BUILD_COMMAND ""
# Wrap download, configure and build steps in a script to log output
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
INSTALL_DIR ${ROOT_DIR}/${PSM_DRIVER_PROJECT_NAME}/${ARCH_LABEL}/)

# Get the PSMoveClient_CAPI include and lib paths
ExternalProject_Get_Property(PSMoveService source_dir)
set(PSMOVESERVICE_BIN_DIR ${source_dir}/bin)
set(PSMOVECLIENT_INCLUDE_DIR ${source_dir}/include)
set(PSMOVECLIENT_LIB_DIR ${source_dir}/lib)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(PSMOVECLIENT_LIB_FILE "PSMoveClient_CAPI.lib")
else()
set(PSMOVECLIENT_LIB_FILE "libPSMoveClient_CAPI.a")
endif()

# Step into the subdirectories
# Configure the cmake for the driver
add_subdirectory(src)
1 change: 0 additions & 1 deletion PSMoveServiceReleaseURL.txt

This file was deleted.

14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[![Documentation](https://codedocs.xyz/HipsterSloth/PSMoveSteamVRBridge.svg)](https://codedocs.xyz/HipsterSloth/PSMoveSteamVRBridge/)

# PSMoveSteamVRBridge
# PSMoveSteamVRBridge [![Build status](https://ci.appveyor.com/api/projects/status/epo1qleh474o539v?svg=true)](https://ci.appveyor.com/project/HipsterSloth/psmovesteamvrbridge) [![Documentation](https://img.shields.io/badge/code-documented-brightgreen.svg)](https://superevensteven.github.io/PSMoveSteamVRBridge/annotated.html)
PSMoveSteamVRBridge is a client for [PSMoveService](https://github.com/cboulay/PSMoveService) that takes the pose and button data of PSMove/DualShock4/PSNavi controller and forwards it into SteamVR. The [FAQ](https://github.com/HipsterSloth/PSMoveSteamVRBridge/wiki/Frequently-Asked-Questions) is a good starting point for any specific questions you may have about the project.

**NOTE** This is alpha software still heavily in development. If you are downloading this project to play games on SteamVR please be aware that this tool may not work for the game you want to play so buyer beware. That said, if you are feeling brave and want to test this we appreciate the feedback about what works and what doesn't.
Expand All @@ -15,6 +13,12 @@ If you want to make modifications to the service or want to debug it, you can bu
* General setup guides, troubleshooting and design docs can be found on the [wiki](https://github.com/HipsterSloth/PSMoveSteamVRBridge/wiki)
* Documentation for the code is hosted on [codedocs](https://codedocs.xyz/HipsterSloth/PSMoveSteamVRBridge/) (In Progress)

### Installing the Driver in SteamVR
#### Automated Installer
In the installer folder of this project is an XML definition file for the BitRock installer project. This is a cross-platform installer that offer free licenses for opensource projects. This project's installer is built using that.

[![alt text][bitrock-logo]][bitrock-url]

# Getting Help
Please start with the wiki. If you can't find help with your problem then please search through the issues (especially the closed ones) to see if your problem has been addressed already. If you still find no previous mention of your problem then you have one of two options:

Expand All @@ -39,3 +43,7 @@ Special thanks to the following people who helped make this project possible:
* YossiMH - Improvements to touch pad mappings and help with the HMD/Controller alignment tool
* William (zelmon64) - Many improvements to config tool UX, beta testing, and troubleshooting hero
* Antonio Jose Ramos Marquez - Work on PS4EyeDriver and PSX hardware reverse engineering
* Stephen O'Hair - Huge refactor of the SteamVR plugin to help get it working with the new SteamVR input system

[bitrock-logo]:https://github.com/alatnet/OpenPSVR/blob/master/installer/installer-logo.png "BitRock Installer"
[bitrock-url]:http://bitrock.com
46 changes: 46 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: '{build}'
branches:
only:
- master
clone_folder: c:\projects\PSMoveSteamVR
image:
- Visual Studio 2017
configuration:
- Release
- Debug
platform:
- x64
environment:
matrix:
- arch: Win64
# - arch: #does not work, Release|x64 not a valid target
matrix:
fast_finish: true

# skip unsupported combinations
init:
- set arch=
- if "%arch%"=="Win64" ( set arch= Win64)
- echo %arch%
- echo %APPVEYOR_BUILD_WORKER_IMAGE%
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set generator="Visual Studio 15 2017%arch%" )
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set generator="Visual Studio 14 2015%arch%" )
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" ( set generator="Visual Studio 12 2013%arch%" )
- echo %generator%

before_build:
- cmd: |-
cmake --version
clean.bat
generate.bat
build_script:
c:\projects\PSMoveSteamVR\build.bat
only_commits:
files:
- CMakeLists.txt
- appveyor.yml
- build.bat
- clean.bat
- generate.bat
- src/
27 changes: 27 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@echo off

::Build driver
call :buildDriver || goto handleError

::Exit batch script
goto exit

::---------------------------
::|Function definitions below
::---------------------------

::Function runs INSTALL cmake target which will build the driver as either debug/release
:buildDriver
echo "Build Type=%BUILD_TYPE%"
cmake --build generated --target INSTALL --config %BUILD_TYPE%
goto:eof

:handleError
echo "BUILD FAILED"
exit /b 1
goto:eof

:exit
echo "BUILD SUCCESSFUL"
exit /b 0
goto:eof
54 changes: 54 additions & 0 deletions build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# PSMoveSteamVR VS Specific
driver.version=1.6.0

# Build type < Debug | Release >
build.type=Release

# CMake build generator tools : https://cmake.org/cmake/help/v3.11/manual/cmake-generators.7.html
#
# Makefile Generators:
# Borland Makefiles
# MSYS Makefiles
# MinGW Makefiles
# NMake Makefiles
# NMake Makefiles JOM
# Unix Makefiles
# Watcom WMake
#
# Visual Studio Generators:
# Visual Studio 6 Win64
# Visual Studio 7 Win64
# Visual Studio 7 .NET 2003 Win64
# Visual Studio 8 2005 Win64
# Visual Studio 9 2008 Win64
# Visual Studio 10 2010 Win64
# Visual Studio 11 2012 Win64
# Visual Studio 12 2013 Win64
# Visual Studio 14 2015 Win64
# Visual Studio 15 2017 Win64
#
# Ninja Generator:
# Ninja
#
# Other Generators:
# Green Hills MULTI
# Xcode
#
# Extra Generators:
# CodeBlocks
# CodeLite
# Eclipse CDT4
# Kate
# Sublime Text 2
cmake.build.generator.windows=Visual Studio 14 2015 Win64
cmake.build.generator.linux=Unix Makefiles
cmake.build.generator.OSX=Xcode

# Dependencies
psmoveservice.package.name=psmoveservice-sdk
psmoveservice.package.url=https://github.com/cboulay/PSMoveService/releases/download/v0.9-alpha9.0.1/PSMoveService_0.9_alpha9.0.1.zip
psmoveservice.package.version=v0.9-alpha9.0.1

openvr.package.name=openvr-sdk
openvr.package.url=https://github.com/ValveSoftware/openvr/archive/v1.0.17.zip
openvr.pacakge.version=v1.0.17
25 changes: 25 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

#Function to build driver
buildDriver(){
local BUILD_TYPE=$1
cmake --build ide --target INSTALL --config $BUILD_TYPE || return $?
echo BUILD SUCCESS
echo -e "\E[1;32mBUILD SUCCESS\E[;0m";
exit 0
}

#Function to handle errors
function handleError() {
error_msg="BUILD FAILED"
echo -e "\E[1;31m$error_msg\E[;0m";
exit 1;
}


# this will trap any errors or commands with non-zero exit status
# by calling function catch_errors()
trap handleError ERR;

#Main entry point
buildDriver
Loading

0 comments on commit ba3be31

Please sign in to comment.