-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from LucidVR/develop
Release v0.4 Additions: * Force Feedback Haptics * Automatic Pose Calibration * Alphabetic Encoding Manager * Menu Button Changes and Fixes: * Controller discovery done through overlay - More reliable Vive wand discovery * Settings will now not reset between updates * Fix issues with bluetooth not working on some machines due to missing library * Fix bug with pose settings caused by unit conversions * Fix bug with playspace calibrator caused by lighthouse tracking name
- Loading branch information
Showing
42 changed files
with
2,330 additions
and
1,485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BasedOnStyle: Google | ||
ColumnLimit: 170 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ Build/ | |
*.vcxproj.* | ||
|
||
CMakeCache.txt | ||
cmake_install.cmake | ||
cmake_install.cmake | ||
clion_build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
#include <openvr_driver.h> | ||
#include <memory> | ||
#include "DeviceConfiguration.h" | ||
|
||
class Calibration { | ||
public: | ||
Calibration(); | ||
|
||
void StartCalibration(vr::DriverPose_t maintainPose); | ||
|
||
VRPoseConfiguration_t FinishCalibration(vr::TrackedDevicePose_t controllerPose, VRPoseConfiguration_t poseConfiguration, bool isRightHand); | ||
|
||
void CancelCalibration(); | ||
|
||
bool isCalibrating(); | ||
|
||
vr::DriverPose_t GetMaintainPose(); | ||
|
||
private: | ||
vr::DriverPose_t m_maintainPose; | ||
bool m_isCalibrating = false; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,59 @@ | ||
#pragma once | ||
#include <Winsock2.h> | ||
|
||
#include "CommunicationManager.h" | ||
#include "DeviceConfiguration.h" | ||
#include <memory> | ||
#include <thread> | ||
#include <atomic> | ||
#include <chrono> | ||
#include <vector> | ||
#include <memory> | ||
#include <sstream> | ||
#include <thread> | ||
#include <vector> | ||
#include <mutex> | ||
|
||
#include "CommunicationManager.h" | ||
#include "DeviceConfiguration.h" | ||
#include "DriverLog.h" | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <Winsock2.h> | ||
|
||
#include <windows.h> | ||
#include <bluetoothapis.h> | ||
#include <Ws2bth.h> | ||
#include <BluetoothAPIs.h> | ||
|
||
#ifdef _WIN32 | ||
#pragma comment(lib, "Ws2_32.lib") | ||
#pragma comment(lib, "Bthprops.lib") | ||
#endif | ||
|
||
#define ARDUINO_WAIT_TIME 1000 | ||
|
||
class BTSerialCommunicationManager : public ICommunicationManager { | ||
public: | ||
BTSerialCommunicationManager(const VRBTSerialConfiguration_t& configuration, std::unique_ptr<IEncodingManager> encodingManager); | ||
//connect to the device using serial | ||
void Connect(); | ||
//start a thread that listens for updates from the device and calls the callback with data | ||
void BeginListener(const std::function<void(VRCommData_t)>& callback); | ||
//returns if connected or not | ||
bool IsConnected(); | ||
//close the serial port | ||
void Disconnect(); | ||
private: | ||
void ListenerThread(const std::function<void(VRCommData_t)>& callback); | ||
bool ReceiveNextPacket(std::string &buff); | ||
bool PurgeBuffer(); | ||
bool getPairedEsp32BtAddress(); | ||
bool startupWindowsSocket(); | ||
bool connectToEsp32(); | ||
bool sendMessageToEsp32(); | ||
|
||
bool m_isConnected; | ||
std::atomic<bool> m_threadActive; | ||
std::thread m_serialThread; | ||
|
||
std::unique_ptr<IEncodingManager> m_encodingManager; | ||
|
||
VRBTSerialConfiguration_t m_btSerialConfiguration; | ||
|
||
BTH_ADDR m_esp32BtAddress; | ||
SOCKADDR_BTH m_btSocketAddress; | ||
SOCKET m_btClientSocket; | ||
WCHAR* m_wcDeviceName; | ||
//std::unique_ptr<WCHAR*> m_wcDeviceName; | ||
|
||
public: | ||
BTSerialCommunicationManager(const VRBTSerialConfiguration_t& configuration, std::unique_ptr<IEncodingManager> encodingManager); | ||
// connect to the device using serial | ||
void Connect(); | ||
// start a thread that listens for updates from the device and calls the callback with data | ||
void BeginListener(const std::function<void(VRCommData_t)>& callback); | ||
// returns if connected or not | ||
bool IsConnected(); | ||
// close the serial port | ||
void Disconnect(); | ||
|
||
void QueueSend(const VRFFBData_t& data); | ||
|
||
private: | ||
void ListenerThread(const std::function<void(VRCommData_t)>& callback); | ||
bool ReceiveNextPacket(std::string& buff); | ||
bool getPairedDeviceBtAddress(); | ||
bool startupWindowsSocket(); | ||
bool connectToDevice(); | ||
bool sendMessageToDevice(); | ||
bool m_isConnected; | ||
std::atomic<bool> m_threadActive; | ||
std::thread m_serialThread; | ||
|
||
std::unique_ptr<IEncodingManager> m_encodingManager; | ||
|
||
VRBTSerialConfiguration_t m_btSerialConfiguration; | ||
|
||
BTH_ADDR m_deviceBtAddress; | ||
SOCKADDR_BTH m_btSocketAddress; | ||
SOCKET m_btClientSocket; | ||
WCHAR* m_wcDeviceName; | ||
|
||
std::mutex m_writeMutex; | ||
|
||
std::string m_writeString = "\n"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
#pragma once | ||
#include <functional> | ||
#include <memory> | ||
|
||
#include "Encode/EncodingManager.h" | ||
|
||
class ICommunicationManager { | ||
public: | ||
virtual void Connect() = 0; | ||
virtual void BeginListener(const std::function<void(VRCommData_t)>& callback) = 0; | ||
virtual bool IsConnected() = 0; | ||
virtual void Disconnect() = 0; | ||
private: | ||
std::unique_ptr<IEncodingManager> m_encodingManager; | ||
public: | ||
virtual void Connect() = 0; | ||
virtual void BeginListener(const std::function<void(VRCommData_t)>& callback) = 0; | ||
virtual bool IsConnected() = 0; | ||
virtual void Disconnect() = 0; | ||
|
||
virtual void QueueSend(const VRFFBData_t& data) = 0; | ||
|
||
private: | ||
std::unique_ptr<IEncodingManager> m_encodingManager; | ||
}; |
Oops, something went wrong.