Browse Source

WIP: Vive Tracker initialization

Marcel Zickler 3 years ago
parent
commit
e75529fe0a

+ 1 - 0
.idea/.idea.VRCyling/.idea/contentModel.xml

@@ -868,6 +868,7 @@
             <e p="CalibratableTracker.cs" t="Include" />
             <e p="CameraTracker.cs" t="Include" />
             <e p="FrontWheelTracker.cs" t="Include" />
+            <e p="IdentifyTrackers.cs" t="Include" />
             <e p="KineticLegTracker.cs" t="Include" />
             <e p="MatchPlayerPositionAndCalibrate.cs" t="Include" />
           </e>

+ 0 - 1
.idea/.idea.VRCyling/.idea/indexLayout.xml

@@ -43,7 +43,6 @@
       <Path>Integrations</Path>
       <Path>Library</Path>
       <Path>Logs</Path>
-      <Path>Temp</Path>
       <Path>UserSettings</Path>
       <Path>obj</Path>
     </explicitExcludes>

+ 11 - 16
.idea/.idea.VRCyling/.idea/workspace.xml

@@ -23,21 +23,14 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="ae9d46da-fd77-45ea-9287-d8d155f44bcf" name="Default Changelist" comment="lean controller">
-      <change afterPath="$PROJECT_DIR$/Assets/Prefabs/LookStraightHUD.prefab" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/Assets/Prefabs/LookStraightHUD.prefab.meta" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/Assets/Scripts/Display/LookStraightDisplay.cs" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/Assets/Scripts/Display/LookStraightDisplay.cs.meta" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/IdentifyTrackers.cs" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/IdentifyTrackers.cs.meta" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/.idea.VRCyling/.idea/contentModel.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.VRCyling/.idea/contentModel.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/.idea.VRCyling/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.VRCyling/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/Assembly-CSharp-Editor.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/Assembly-CSharp-Editor.csproj" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/Assembly-CSharp.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/Assembly-CSharp.csproj" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scenes/MainScene.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scenes/MainScene.unity" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/Controller/Bicycle/IBicycleController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Controller/Bicycle/IBicycleController.cs" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/Assets/Scripts/Controller/Bicycle/RbBicycleController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Controller/Bicycle/RbBicycleController.cs" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Haptic/VibrationController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Haptic/VibrationController.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/Tracking/CameraTracker.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/CameraTracker.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/Tracking/MatchPlayerPositionAndCalibrate.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/MatchPlayerPositionAndCalibrate.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/ProjectSettings/DynamicsManager.asset" beforeDir="false" afterPath="$PROJECT_DIR$/ProjectSettings/DynamicsManager.asset" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/SteamVR.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/SteamVR.csproj" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/SteamVR_Editor.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/SteamVR_Editor.csproj" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/SteamVR_Input_Editor.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/SteamVR_Input_Editor.csproj" afterDir="false" />
@@ -57,6 +50,7 @@
     <setting file="file://$PROJECT_DIR$/Assets/Scripts/Wheels/SwitchColliderOnStanding.cs" root0="FORCE_HIGHLIGHTING" />
     <setting file="file://$PROJECT_DIR$/Assets/Scripts/Tracking/KineticLegTracker.cs" root0="FORCE_HIGHLIGHTING" />
     <setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/1A3A5801-6E2C-4FF1-B975-52B718793608/5a/7e36ae17/DepthOfField.cs" root0="SKIP_HIGHLIGHTING" />
+    <setting file="file://$PROJECT_DIR$/Library/PackageCache/com.valvesoftware.unity.openvr@e340bc848225-1611139568890/Runtime/openvr_api.cs" root0="SKIP_HIGHLIGHTING" />
     <setting file="file://$PROJECT_DIR$/Library/PackageCache/com.unity.render-pipelines.universal@8.2.0/Runtime/ScriptableRendererData.cs" root0="SKIP_HIGHLIGHTING" />
     <setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/BFC774E3-9F15-4E8B-ACC0-AAE5397B53AE/b4/c0ce131f/Mathf.cs" root0="SKIP_HIGHLIGHTING" />
     <setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/F8918D0C-C5FC-41A1-BABA-01B207A4C016/1a/773d1d3a/Physics.cs" root0="SKIP_HIGHLIGHTING" />
@@ -71,7 +65,6 @@
   <component name="IdeDocumentHistory">
     <option name="CHANGED_PATHS">
       <list>
-        <option value="$PROJECT_DIR$/Assets/Scripts/Logging/PolarEcgDataLogger.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Logging/ViveSensorDataLogger.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Logging/FrontWheelTrackerLogger.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Logging/RouteEventLogger.cs" />
@@ -118,10 +111,11 @@
         <option value="$PROJECT_DIR$/Assets/Scripts/Controller/Lean/HmdLeanController.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Display/LookStraightDisplay.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Tracking/MatchPlayerPositionAndCalibrate.cs" />
-        <option value="$PROJECT_DIR$/Assets/Scripts/Tracking/CameraTracker.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Controller/Bicycle/IBicycleController.cs" />
+        <option value="$PROJECT_DIR$/Assets/Scripts/Tracking/CameraTracker.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Controller/Bicycle/RbBicycleController.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Haptic/VibrationController.cs" />
+        <option value="$PROJECT_DIR$/Assets/Scripts/Tracking/IdentifyTrackers.cs" />
       </list>
     </option>
   </component>
@@ -195,6 +189,8 @@
       <workItem from="1615801269868" duration="4270000" />
       <workItem from="1615805576316" duration="97000" />
       <workItem from="1615970052613" duration="12089000" />
+      <workItem from="1615987932942" duration="2186000" />
+      <workItem from="1616403254170" duration="2206000" />
     </task>
     <task id="LOCAL-00001" summary="VR Stuff, Bicycle Animations">
       <created>1606399745852</created>
@@ -482,7 +478,6 @@
       <screen x="0" y="0" width="1440" height="860" />
     </state>
     <state x="346" y="136" key="SettingsEditor/0.0.1440.860@0.0.1440.860" timestamp="1608627211813" />
-    <state x="461" y="164" key="SettingsEditor/0.0.1920.1040@0.0.1920.1040" timestamp="1607347297764" />
     <state x="98" y="98" width="1852" height="916" key="VCS.FileHistoryDialog" timestamp="1615979704751">
       <screen x="0" y="0" width="2048" height="1112" />
     </state>
@@ -524,24 +519,24 @@
     </state>
     <state x="300" y="85" width="1140" height="689" key="editAsTableFormatDialogDimension/0.0.1440.860@0.0.1440.860" timestamp="1610362422263" />
     <state x="400" y="103" key="editAsTableFormatDialogDimension/0.0.1920.1040@0.0.1920.1040" timestamp="1610533263726" />
-    <state x="524" y="37" width="1001" height="1037" key="find.popup" timestamp="1614156731422">
+    <state x="524" y="37" width="1001" height="1037" key="find.popup" timestamp="1615988943747">
       <screen x="0" y="0" width="2048" height="1112" />
     </state>
     <state x="368" y="29" width="703" height="801" key="find.popup/0.0.1440.860@0.0.1440.860" timestamp="1610363676930" />
     <state x="491" y="35" width="938" height="969" key="find.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1610533618773" />
-    <state x="524" y="37" width="1001" height="1037" key="find.popup/0.0.2048.1112@0.0.2048.1112" timestamp="1614156731422" />
+    <state x="524" y="37" width="1001" height="1037" key="find.popup/0.0.2048.1112@0.0.2048.1112" timestamp="1615988943747" />
     <state x="539" y="255" key="run.anything.popup" timestamp="1611924507844">
       <screen x="0" y="0" width="2048" height="1112" />
     </state>
     <state x="379" y="197" key="run.anything.popup/0.0.1440.860@0.0.1440.860" timestamp="1610374243030" />
     <state x="539" y="255" key="run.anything.popup/0.0.2048.1112@0.0.2048.1112" timestamp="1611924507844" />
-    <state x="665" y="241" width="717" height="725" key="search.everywhere.popup" timestamp="1615979222043">
+    <state x="665" y="241" width="717" height="725" key="search.everywhere.popup" timestamp="1615989125736">
       <screen x="0" y="0" width="2048" height="1112" />
     </state>
     <state x="478" y="197" width="672" height="561" key="search.everywhere.popup/0.0.1440.860@0.0.1440.860" timestamp="1610362007792" />
     <state x="476" y="204" width="672" height="588" key="search.everywhere.popup/0.0.1440.900@0.0.1440.900" timestamp="1608636877159" />
     <state x="623" y="225" width="672" height="678" key="search.everywhere.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1610538285122" />
-    <state x="665" y="241" width="717" height="725" key="search.everywhere.popup/0.0.2048.1112@0.0.2048.1112" timestamp="1615979222043" />
+    <state x="665" y="241" width="717" height="725" key="search.everywhere.popup/0.0.2048.1112@0.0.2048.1112" timestamp="1615989125736" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>

+ 3 - 0
Assembly-CSharp-Editor.csproj

@@ -366,6 +366,9 @@
  <Reference Include="UnityEditor.WindowsStandalone.Extensions">
  <HintPath>C:/Program Files/Unity/Hub/Editor/2020.1.12f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
  </Reference>
+ <Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
+ <HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
+ </Reference>
  <Reference Include="DotNetZip">
  <HintPath>C:/Users/student/Desktop/VRCyling/Assets/NuGet/Editor/DotNetZip.dll</HintPath>
  </Reference>

+ 1 - 0
Assembly-CSharp.csproj

@@ -332,6 +332,7 @@
      <Compile Include="Assets\Scripts\SicknessReduction\Visual\Rendering\BokehFeature.cs" />
      <Compile Include="Assets\AdvancedAnt\Scripts\SpeedDisplay.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Mesg.cs" />
+     <Compile Include="Assets\Scripts\Tracking\IdentifyTrackers.cs" />
      <None Include="Assets\TextMesh Pro\Shaders\TMPro.cginc" />
      <None Include="Assets\TextMesh Pro\Shaders\TMP_SDF-Mobile Overlay.shader" />
      <None Include="Assets\AdvancedAnt\Plugins\Ant\License.txt" />

+ 302 - 289
Assets/Scenes/MainScene.unity

@@ -26,7 +26,7 @@ RenderSettings:
   m_AmbientIntensity: 1
   m_AmbientMode: 0
   m_SubtractiveShadowColor: {r: 0.13296545, g: 0.19145328, b: 0.33962262, a: 1}
-  m_SkyboxMaterial: {fileID: 896745363}
+  m_SkyboxMaterial: {fileID: 1590483420}
   m_HaloStrength: 0
   m_FlareStrength: 1
   m_FlareFadeSpeed: 3
@@ -13482,7 +13482,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 60126615}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 2.731001, y: -0.12599999, z: 0.3399999}
+  m_LocalPosition: {x: 2.731, y: -0.018, z: 0.214}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 2074345914}
@@ -19823,7 +19823,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: d37c2cf88f7c59f4c8cf5d3812568143, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  index: 2
+  index: 1
   origin: {fileID: 587912098}
 --- !u!23 &84544594
 MeshRenderer:
@@ -212909,288 +212909,6 @@ Transform:
     type: 3}
   m_PrefabInstance: {fileID: 896617782}
   m_PrefabAsset: {fileID: 0}
---- !u!21 &896745363
-Material:
-  serializedVersion: 6
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_Name: Sky 02
-  m_Shader: {fileID: 4800000, guid: 6fc9318f5193c094c98c0d450cd61e3b, type: 3}
-  m_ShaderKeywords: _BACKGROUNDMODE_COLORS _CLOUDSLITBYSUN_ON _DISABLEDIRECTIONLIGHT_ON
-    _ENABLECLOUDS_ON _ENABLEDIRECTIONLIGHT_ON _ENABLESUNMOONMASK_ON _ENABLESUNMOON_ON
-    _ENABLESUN_ON _USECUBEMAP_ON _USEENVIRONMENTGRADIENT_ON _USETEXTURE_ON
-  m_LightmapFlags: 0
-  m_EnableInstancingVariants: 0
-  m_DoubleSidedGI: 0
-  m_CustomRenderQueue: -1
-  stringTagMap: {}
-  disabledShaderPasses: []
-  m_SavedProperties:
-    serializedVersion: 3
-    m_TexEnvs:
-    - _BackgroundCubemap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _BumpMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _CloudsCubemap:
-        m_Texture: {fileID: 8900000, guid: ee7bf433ad404fe4cb5e19b8a93b3bed, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _Cubemap:
-        m_Texture: {fileID: 8900000, guid: ae71550a4c81f73409f14f4d6eca2c0f, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _CubemapBG:
-        m_Texture: {fileID: 8900000, guid: b8d891a789549494aaa157c0edc53a12, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _DetailAlbedoMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _DetailMask:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _DetailNormalMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _EmissionMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _MainTex:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _MetallicGlossMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _MoonTexture:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _Normal:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _OcclusionMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _ParallaxMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _PatternCubemap:
-        m_Texture: {fileID: 8900000, guid: 3845b30ba2fbdee44a85e5ead4dd2974, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _PatternOverlay:
-        m_Texture: {fileID: 8900000, guid: 1f3407b97870a2e46864ac55deec53b0, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _SkyPatternOverlay:
-        m_Texture: {fileID: 8900000, guid: b8d891a789549494aaa157c0edc53a12, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _Spherical:
-        m_Texture: {fileID: 2800000, guid: 61c0b9c0523734e0e91bc6043c72a490, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _StarsCubemap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _Sun:
-        m_Texture: {fileID: 2800000, guid: 19982f8bf5fa2ed42b65ac271d4f0279, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _SunTexture:
-        m_Texture: {fileID: 2800000, guid: dd566660fc358aa4098080e42ca0db56, type: 3}
-        m_Scale: {x: 0, y: 0}
-        m_Offset: {x: 1, y: 1}
-    - _Tex:
-        m_Texture: {fileID: 2800000, guid: 623f215c9cf5dc04aa628d4dd7b6bd73, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _Texture:
-        m_Texture: {fileID: 2800000, guid: 12726e6bff222df4cbbe3ebde547c297, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _TextureSample0:
-        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
-        m_Scale: {x: 4.46, y: 5.19}
-        m_Offset: {x: 0, y: 0}
-    - _TextureSample1:
-        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
-        m_Scale: {x: 1.46, y: -1.61}
-        m_Offset: {x: 1.05, y: 3.12}
-    - _TextureSample2:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _TopTexture0:
-        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _TwinklingTexture:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _scaledTexture:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _tex:
-        m_Texture: {fileID: 2800000, guid: 12726e6bff222df4cbbe3ebde547c297, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _texcoord:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _texture:
-        m_Texture: {fileID: 2800000, guid: 64e7766099ad46747a07014e44d0aea1, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    m_Floats:
-    - _BackgroundCat: 1
-    - _BackgroundCubemapSpace: 0
-    - _BackgroundExposure: 1
-    - _BackgroundMode: 0
-    - _Banner: 1
-    - _BumpScale: 1
-    - _CloudHeight: 0
-    - _CloudsCat: 1
-    - _CloudsHeight: 0.1
-    - _CloudsLitbySun: 1
-    - _CloudsRotation: 10
-    - _CloudsRotationSpeed: 1
-    - _Contrast: 0.477
-    - _Contrsat: 1
-    - _Cutoff: 0
-    - _DetailNormalMapScale: 1
-    - _DisableCloudsRotation: 0
-    - _DisableDirectionLight: 1
-    - _DisableRotation: 0
-    - _DstBlend: 0
-    - _Enable1Twinkling: 0
-    - _EnableBuiltinFog: 0
-    - _EnableClouds: 1
-    - _EnableCloudsRotation: 0
-    - _EnableDirectionLight: 1
-    - _EnableFogMessage: 0
-    - _EnableMoon: 0
-    - _EnablePatternOverlay: 0
-    - _EnableSkyPatternOverlay: 0
-    - _EnableStars: 0
-    - _EnableStarsRotation: 0
-    - _EnableStarsTwinkling: 0
-    - _EnableSun: 1
-    - _EnableSunMask: 0
-    - _EnableSunMoon: 1
-    - _EnableSunMoonMask: 1
-    - _EnableTwinkling: 0
-    - _EqHeight: 0.419
-    - _EquatorHeight: 0.275
-    - _EquatorSmoothness: 0.741
-    - _Exposure: 0
-    - _Fade: 0.463
-    - _Float0: 2.7
-    - _Float1: 0
-    - _Float2: 0
-    - _Float3: 8.91
-    - _Float4: -1
-    - _Float5: -0.2
-    - _Float6: 1
-    - _FogCat: 1
-    - _FogFill: 0.273
-    - _FogHeight: 0.165
-    - _FogIntensity: 0
-    - _FogSmoothness: 0.47
-    - _GlossMapScale: 1
-    - _Glossiness: 0.5
-    - _GlossyReflections: 1
-    - _Keyword0: 0
-    - _Metallic: 0
-    - _Mode: 0
-    - _MoonCat: 1
-    - _MoonIntensity: 1
-    - _MoonSize: 0.5
-    - _OcclusionStrength: 1
-    - _Parallax: 0.02
-    - _PatternCat: 1
-    - _PatternContrast: 0.2
-    - _RoatationSpeed: 0.4
-    - _Rotation: 0
-    - _RotationSpeed: 0.5
-    - _SkyPatternContrast: 0.477
-    - _SkyPatternOverlay: 0
-    - _SmoothnessTextureChannel: 0
-    - _SpecularHighlights: 1
-    - _SrcBlend: 1
-    - _StarsAmount: 3
-    - _StarsCat: 1
-    - _StarsHeightMask: 0
-    - _StarsIntensity: 0
-    - _StarsLayer: 1
-    - _StarsRotation: 360
-    - _StarsRotationSpeed: 0.5
-    - _StarsSize: 0
-    - _StarsSunMask: 0
-    - _SunCat: 1
-    - _SunIntensity: 2.33
-    - _SunRadiusB: 0
-    - _SunRadoisA: 0.463
-    - _SunSize: 0.864
-    - _ToggleSwitch0: 0
-    - _TwinklingContrast: 0
-    - _TwinklingSpeed: 0
-    - _UVSec: 0
-    - _UseCUBEMAP: 1
-    - _UseEnvironmentGradient: 1
-    - _UseSkyPatternOverlay: 0
-    - _UseTexture: 1
-    - _WaveScale: 0
-    - _WaveSpeed: 0
-    - _ZWrite: 1
-    - __dirty: 0
-    - _adf: 0
-    - _angle: 145
-    - _fresnell: 0
-    - _mip: 0
-    m_Colors:
-    - _CloudLightColor: {r: 1, g: 1, b: 1, a: 1}
-    - _CloudShadowColor: {r: 0.33239606, g: 0.46899295, b: 0.85294116, a: 1}
-    - _CloudsLightColor: {r: 0.9338235, g: 0.9338235, b: 0.9338235, a: 1}
-    - _CloudsShadowColor: {r: 0.4625865, g: 0.49787903, b: 0.9117647, a: 1}
-    - _Color: {r: 1, g: 1, b: 1, a: 1}
-    - _Color0: {r: 0, g: 0.5054344, b: 1, a: 0}
-    - _Color1: {r: 1, g: 1, b: 1, a: 0}
-    - _Color2: {r: 0.059472326, g: 0.25068596, b: 0.8088235, a: 0}
-    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
-    - _Eq: {r: 1, g: 0.6769777, b: 0.330882, a: 0}
-    - _EquatorColor: {r: 1, g: 0.956522, b: 0.8632076, a: 0}
-    - _Ground: {r: 0.4779411, g: 0.43111518, b: 0.23545504, a: 0}
-    - _GroundColor: {r: 0.3679245, g: 0.3679245, b: 0.3679245, a: 0}
-    - _MoonColor: {r: 1, g: 1, b: 1, a: 1}
-    - _Sky: {r: 0.6691177, g: 0.29519898, b: 0.29519898, a: 0}
-    - _SkyColor: {r: 0.4462442, g: 0.5670902, b: 0.8679245, a: 0}
-    - _Skycol: {r: 0.27941146, g: 0.64219046, b: 1, a: 0}
-    - _SunColor: {r: 1, g: 0.85071, b: 0.66176474, a: 1}
-    - _Tint: {r: 1, g: 1, b: 1, a: 0}
-    - _Vector1: {r: 0, g: 1, b: 0, a: 0}
-    - _water: {r: 0.5, g: 0.5, b: 0.5, a: 1}
-  m_BuildTextureStacks: []
 --- !u!1001 &897072378
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -308575,7 +308293,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: d37c2cf88f7c59f4c8cf5d3812568143, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  index: 1
+  index: 4
   origin: {fileID: 587912098}
 --- !u!23 &1305795379
 MeshRenderer:
@@ -373994,6 +373712,288 @@ PrefabInstance:
       objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: 2605f88d3a092824691ed33e21a760ab, type: 3}
+--- !u!21 &1590483420
+Material:
+  serializedVersion: 6
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Sky 02
+  m_Shader: {fileID: 4800000, guid: 6fc9318f5193c094c98c0d450cd61e3b, type: 3}
+  m_ShaderKeywords: _BACKGROUNDMODE_COLORS _CLOUDSLITBYSUN_ON _DISABLEDIRECTIONLIGHT_ON
+    _ENABLECLOUDS_ON _ENABLEDIRECTIONLIGHT_ON _ENABLESUNMOONMASK_ON _ENABLESUNMOON_ON
+    _ENABLESUN_ON _USECUBEMAP_ON _USEENVIRONMENTGRADIENT_ON _USETEXTURE_ON
+  m_LightmapFlags: 0
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BackgroundCubemap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _CloudsCubemap:
+        m_Texture: {fileID: 8900000, guid: ee7bf433ad404fe4cb5e19b8a93b3bed, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Cubemap:
+        m_Texture: {fileID: 8900000, guid: ae71550a4c81f73409f14f4d6eca2c0f, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _CubemapBG:
+        m_Texture: {fileID: 8900000, guid: b8d891a789549494aaa157c0edc53a12, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MoonTexture:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Normal:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _PatternCubemap:
+        m_Texture: {fileID: 8900000, guid: 3845b30ba2fbdee44a85e5ead4dd2974, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _PatternOverlay:
+        m_Texture: {fileID: 8900000, guid: 1f3407b97870a2e46864ac55deec53b0, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _SkyPatternOverlay:
+        m_Texture: {fileID: 8900000, guid: b8d891a789549494aaa157c0edc53a12, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Spherical:
+        m_Texture: {fileID: 2800000, guid: 61c0b9c0523734e0e91bc6043c72a490, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _StarsCubemap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Sun:
+        m_Texture: {fileID: 2800000, guid: 19982f8bf5fa2ed42b65ac271d4f0279, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _SunTexture:
+        m_Texture: {fileID: 2800000, guid: dd566660fc358aa4098080e42ca0db56, type: 3}
+        m_Scale: {x: 0, y: 0}
+        m_Offset: {x: 1, y: 1}
+    - _Tex:
+        m_Texture: {fileID: 2800000, guid: 623f215c9cf5dc04aa628d4dd7b6bd73, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Texture:
+        m_Texture: {fileID: 2800000, guid: 12726e6bff222df4cbbe3ebde547c297, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _TextureSample0:
+        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
+        m_Scale: {x: 4.46, y: 5.19}
+        m_Offset: {x: 0, y: 0}
+    - _TextureSample1:
+        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
+        m_Scale: {x: 1.46, y: -1.61}
+        m_Offset: {x: 1.05, y: 3.12}
+    - _TextureSample2:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _TopTexture0:
+        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _TwinklingTexture:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _scaledTexture:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _tex:
+        m_Texture: {fileID: 2800000, guid: 12726e6bff222df4cbbe3ebde547c297, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _texcoord:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _texture:
+        m_Texture: {fileID: 2800000, guid: 64e7766099ad46747a07014e44d0aea1, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Floats:
+    - _BackgroundCat: 1
+    - _BackgroundCubemapSpace: 0
+    - _BackgroundExposure: 1
+    - _BackgroundMode: 0
+    - _Banner: 1
+    - _BumpScale: 1
+    - _CloudHeight: 0
+    - _CloudsCat: 1
+    - _CloudsHeight: 0.1
+    - _CloudsLitbySun: 1
+    - _CloudsRotation: 10
+    - _CloudsRotationSpeed: 1
+    - _Contrast: 0.477
+    - _Contrsat: 1
+    - _Cutoff: 0
+    - _DetailNormalMapScale: 1
+    - _DisableCloudsRotation: 0
+    - _DisableDirectionLight: 1
+    - _DisableRotation: 0
+    - _DstBlend: 0
+    - _Enable1Twinkling: 0
+    - _EnableBuiltinFog: 0
+    - _EnableClouds: 1
+    - _EnableCloudsRotation: 0
+    - _EnableDirectionLight: 1
+    - _EnableFogMessage: 0
+    - _EnableMoon: 0
+    - _EnablePatternOverlay: 0
+    - _EnableSkyPatternOverlay: 0
+    - _EnableStars: 0
+    - _EnableStarsRotation: 0
+    - _EnableStarsTwinkling: 0
+    - _EnableSun: 1
+    - _EnableSunMask: 0
+    - _EnableSunMoon: 1
+    - _EnableSunMoonMask: 1
+    - _EnableTwinkling: 0
+    - _EqHeight: 0.419
+    - _EquatorHeight: 0.275
+    - _EquatorSmoothness: 0.741
+    - _Exposure: 0
+    - _Fade: 0.463
+    - _Float0: 2.7
+    - _Float1: 0
+    - _Float2: 0
+    - _Float3: 8.91
+    - _Float4: -1
+    - _Float5: -0.2
+    - _Float6: 1
+    - _FogCat: 1
+    - _FogFill: 0.273
+    - _FogHeight: 0.165
+    - _FogIntensity: 0
+    - _FogSmoothness: 0.47
+    - _GlossMapScale: 1
+    - _Glossiness: 0.5
+    - _GlossyReflections: 1
+    - _Keyword0: 0
+    - _Metallic: 0
+    - _Mode: 0
+    - _MoonCat: 1
+    - _MoonIntensity: 1
+    - _MoonSize: 0.5
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _PatternCat: 1
+    - _PatternContrast: 0.2
+    - _RoatationSpeed: 0.4
+    - _Rotation: 0
+    - _RotationSpeed: 0.5
+    - _SkyPatternContrast: 0.477
+    - _SkyPatternOverlay: 0
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _StarsAmount: 3
+    - _StarsCat: 1
+    - _StarsHeightMask: 0
+    - _StarsIntensity: 0
+    - _StarsLayer: 1
+    - _StarsRotation: 360
+    - _StarsRotationSpeed: 0.5
+    - _StarsSize: 0
+    - _StarsSunMask: 0
+    - _SunCat: 1
+    - _SunIntensity: 2.33
+    - _SunRadiusB: 0
+    - _SunRadoisA: 0.463
+    - _SunSize: 0.864
+    - _ToggleSwitch0: 0
+    - _TwinklingContrast: 0
+    - _TwinklingSpeed: 0
+    - _UVSec: 0
+    - _UseCUBEMAP: 1
+    - _UseEnvironmentGradient: 1
+    - _UseSkyPatternOverlay: 0
+    - _UseTexture: 1
+    - _WaveScale: 0
+    - _WaveSpeed: 0
+    - _ZWrite: 1
+    - __dirty: 0
+    - _adf: 0
+    - _angle: 145
+    - _fresnell: 0
+    - _mip: 0
+    m_Colors:
+    - _CloudLightColor: {r: 1, g: 1, b: 1, a: 1}
+    - _CloudShadowColor: {r: 0.33239606, g: 0.46899295, b: 0.85294116, a: 1}
+    - _CloudsLightColor: {r: 0.9338235, g: 0.9338235, b: 0.9338235, a: 1}
+    - _CloudsShadowColor: {r: 0.4625865, g: 0.49787903, b: 0.9117647, a: 1}
+    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _Color0: {r: 0, g: 0.5054344, b: 1, a: 0}
+    - _Color1: {r: 1, g: 1, b: 1, a: 0}
+    - _Color2: {r: 0.059472326, g: 0.25068596, b: 0.8088235, a: 0}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+    - _Eq: {r: 1, g: 0.6769777, b: 0.330882, a: 0}
+    - _EquatorColor: {r: 1, g: 0.956522, b: 0.8632076, a: 0}
+    - _Ground: {r: 0.4779411, g: 0.43111518, b: 0.23545504, a: 0}
+    - _GroundColor: {r: 0.3679245, g: 0.3679245, b: 0.3679245, a: 0}
+    - _MoonColor: {r: 1, g: 1, b: 1, a: 1}
+    - _Sky: {r: 0.6691177, g: 0.29519898, b: 0.29519898, a: 0}
+    - _SkyColor: {r: 0.4462442, g: 0.5670902, b: 0.8679245, a: 0}
+    - _Skycol: {r: 0.27941146, g: 0.64219046, b: 1, a: 0}
+    - _SunColor: {r: 1, g: 0.85071, b: 0.66176474, a: 1}
+    - _Tint: {r: 1, g: 1, b: 1, a: 0}
+    - _Vector1: {r: 0, g: 1, b: 0, a: 0}
+    - _water: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+  m_BuildTextureStacks: []
 --- !u!1001 &1590871030
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -451761,7 +451761,7 @@ PrefabInstance:
     - target: {fileID: 3450098086302837850, guid: 3b07d6594636ab04d9c1fac04c1cde7e,
         type: 3}
       propertyPath: controllerMode.weightLeaning
-      value: 1
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 3450098086302837850, guid: 3b07d6594636ab04d9c1fac04c1cde7e,
         type: 3}
@@ -452023,7 +452023,7 @@ PrefabInstance:
     - target: {fileID: 4988978072042319893, guid: 3b07d6594636ab04d9c1fac04c1cde7e,
         type: 3}
       propertyPath: lean
-      value: 1
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4988978072042319893, guid: 3b07d6594636ab04d9c1fac04c1cde7e,
         type: 3}
@@ -485743,6 +485743,7 @@ GameObject:
   m_Component:
   - component: {fileID: 2074345914}
   - component: {fileID: 2074345915}
+  - component: {fileID: 2074345916}
   m_Layer: 0
   m_Name: Tracker
   m_TagString: Untagged
@@ -485789,11 +485790,23 @@ MonoBehaviour:
   frontWheelTracker: {fileID: 84544592}
   legDesiredPosition: {fileID: 60126616}
   legTracker: {fileID: 1305795377}
-  calibrateHmd: 1
+  calibrateHmd: 0
   lookStraightHud: {fileID: 2881557508374759591, guid: f8ecadb74c91cdb439abf3faa8590bb7,
     type: 3}
   hmdTracker: {fileID: 1042236301}
   bikeTransform: {fileID: 1689915699}
+--- !u!114 &2074345916
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2074345913}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 8f30b24ad73f45ab8a1b1c483d0f5a7a, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!1001 &2074468741
 PrefabInstance:
   m_ObjectHideFlags: 0

+ 8 - 0
Assets/Scripts/Controller/Bicycle/RbBicycleController.cs

@@ -15,6 +15,9 @@ namespace Controller.Bicycle
         private float currentLeaningAngle;
         private float currentSpeedSensed;
         private float currentSpeedAdjusted;
+        
+        //private float previousSpeedAdjusted;
+        //private float maxDifToPreviousSpeedDueToGradientPerSecond = 2f;
 
         [Header("Slope Impact")] public bool adjustSpeedToSlope = true;
 
@@ -93,6 +96,7 @@ namespace Controller.Bicycle
 
         private void AdjustSpeedToGradientIfNeeded()
         {
+            //previousSpeedAdjusted = currentSpeedAdjusted;
             var bikeAngle = rbTransform.localRotation.eulerAngles.x;
             if (!adjustSpeedToSlope || Mathf.Abs(bikeAngle) <= THRESHOLD_GRADIENT_ZERO)
             {
@@ -111,6 +115,10 @@ namespace Controller.Bicycle
 
             var gradientDeg = -bikeAngle;
             var gradient = Mathf.Tan(gradientDeg * Mathf.Deg2Rad);
+
+            //var maxDif = maxDifToPreviousSpeedDueToGradientPerSecond * Time.deltaTime;
+            //var dif = Math.Abs(currentSpeedSensed)
+            
             currentSpeedAdjusted = gradient < 0
                 ? currentSpeedSensed * 1.5f
                 : BicyclePhysics.SpeedAtGradientForSpeedAtFlat(currentSpeedSensed, rigidBody.mass,

+ 3 - 3
Assets/Scripts/SicknessReduction/Haptic/VibrationController.cs

@@ -25,21 +25,21 @@ namespace SicknessReduction.Haptic
             //as soon as we have a cadence, we want the motors to vibrate
             if (!initialCyclePublished)
             {
-                Debug.Log($"Sending cycle {CYCLE}");
+                //Debug.Log($"Sending cycle {CYCLE}");
                 await Broker.Publish(TOPIC_CYCLE, $"{CYCLE}");
                 initialCyclePublished = true;
             }
             //if the cadence changes to 0, we have to switch off vibration
             if (c == 0)
             {
-                Debug.Log($"Sending cycle {CYCLE}");
+                //Debug.Log($"Sending cycle {CYCLE}");
                 await Broker.Publish(TOPIC_CYCLE, "0");
                 previousCadence = c;
             }
             //as soon as we have cadence again, we want to switch on vibration again, and then immediately set cadence again
             else if (previousCadence == 0)
             {
-                Debug.Log($"Sending cycle {CYCLE}");
+                //Debug.Log($"Sending cycle {CYCLE}");
                 await Broker.Publish(TOPIC_CYCLE, $"{CYCLE}");
                 PublishCadence(c);
             }

+ 44 - 0
Assets/Scripts/Tracking/IdentifyTrackers.cs

@@ -0,0 +1,44 @@
+using System;
+using System.Diagnostics;
+using System.Text;
+using UnityEngine;
+using Valve.VR;
+using Debug = UnityEngine.Debug;
+
+namespace Tracking
+{
+    public class IdentifyTrackers : MonoBehaviour
+    {
+        
+        private void OnEnable() {
+            SteamVR_Events.DeviceConnected.Listen(OnDeviceConnected);
+        }
+        
+        private void OnDeviceConnected(int index, bool connected)
+        {
+            if (index < 0) return;
+            if(connected) {
+                if(OpenVR.System != null) {
+                    //lets figure what type of device got connected
+                    ETrackedDeviceClass deviceClass = OpenVR.System.GetTrackedDeviceClass((uint)index);
+                    ETrackedPropertyError error = ETrackedPropertyError.TrackedProp_UnknownProperty;
+                    StringBuilder serialNumberBuilder = new StringBuilder();
+                    var result = OpenVR.System.GetStringTrackedDeviceProperty((uint)index,
+                        ETrackedDeviceProperty.Prop_ControllerType_String, serialNumberBuilder, 32, ref error);
+                    
+                    
+                    if(deviceClass == ETrackedDeviceClass.Controller) {
+                        Debug.Log("Controller got connected at index:" + index);
+                    } else if(deviceClass == ETrackedDeviceClass.GenericTracker) {
+                        Debug.Log("Tracker got connected at index:" + index);
+                        Debug.Log("With serial number:" + serialNumberBuilder.ToString());
+                    }
+                }
+                else
+                {
+                    Debug.LogWarning("No VR System");
+                }
+            }
+        }
+    }
+}

+ 3 - 0
Assets/Scripts/Tracking/IdentifyTrackers.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 8f30b24ad73f45ab8a1b1c483d0f5a7a
+timeCreated: 1616411857

+ 3 - 0
SteamVR.csproj

@@ -455,6 +455,9 @@
  <Reference Include="UnityEditor.WindowsStandalone.Extensions">
  <HintPath>C:/Program Files/Unity/Hub/Editor/2020.1.12f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
  </Reference>
+ <Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
+ <HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
+ </Reference>
  <Reference Include="DotNetZip">
  <HintPath>C:/Users/student/Desktop/VRCyling/Assets/NuGet/Editor/DotNetZip.dll</HintPath>
  </Reference>

+ 3 - 0
SteamVR_Editor.csproj

@@ -281,6 +281,9 @@
  <Reference Include="UnityEditor.WindowsStandalone.Extensions">
  <HintPath>C:/Program Files/Unity/Hub/Editor/2020.1.12f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
  </Reference>
+ <Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
+ <HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
+ </Reference>
  <Reference Include="DotNetZip">
  <HintPath>C:/Users/student/Desktop/VRCyling/Assets/NuGet/Editor/DotNetZip.dll</HintPath>
  </Reference>

+ 3 - 0
SteamVR_Input_Editor.csproj

@@ -283,6 +283,9 @@
  <Reference Include="UnityEditor.WindowsStandalone.Extensions">
  <HintPath>C:/Program Files/Unity/Hub/Editor/2020.1.12f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
  </Reference>
+ <Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
+ <HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
+ </Reference>
  <Reference Include="DotNetZip">
  <HintPath>C:/Users/student/Desktop/VRCyling/Assets/NuGet/Editor/DotNetZip.dll</HintPath>
  </Reference>

+ 3 - 0
SteamVR_Windows_EditorHelper.csproj

@@ -262,6 +262,9 @@
  <Reference Include="UnityEditor.WindowsStandalone.Extensions">
  <HintPath>C:/Program Files/Unity/Hub/Editor/2020.1.12f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
  </Reference>
+ <Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
+ <HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/16.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
+ </Reference>
  <Reference Include="DotNetZip">
  <HintPath>C:/Users/student/Desktop/VRCyling/Assets/NuGet/Editor/DotNetZip.dll</HintPath>
  </Reference>

BIN
obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache