diff --git a/LinearAlgebra/test/DirectionTest.cs b/LinearAlgebra/test/DirectionTest.cs index e31af4c..3cebe1a 100644 --- a/LinearAlgebra/test/DirectionTest.cs +++ b/LinearAlgebra/test/DirectionTest.cs @@ -1,3 +1,4 @@ +#if !UNITY_5_6_OR_NEWER using NUnit.Framework; namespace LinearAlgebra.Test { @@ -14,4 +15,5 @@ namespace LinearAlgebra.Test { Assert.True(r); } }; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Unity/RelativeEncoder.cs b/Unity/RelativeEncoder.cs index 521878c..475a85c 100644 --- a/Unity/RelativeEncoder.cs +++ b/Unity/RelativeEncoder.cs @@ -56,7 +56,7 @@ namespace RoboidControl.Unity { // Normalize angles to range [-180..180) // Note: it is not possible to track rotation speeds higher than 180 degrees per frame because of representation limitations of Quaternions - float deltaAngle = Angle.Normalize(deltaRotation.eulerAngles.x); + float deltaAngle = Angle.Degrees(deltaRotation.eulerAngles.x).inDegrees; this.rotationSpeed = deltaAngle / Time.deltaTime; } diff --git a/Unity/Thing.cs b/Unity/Thing.cs index 43476eb..8947915 100644 --- a/Unity/Thing.cs +++ b/Unity/Thing.cs @@ -190,19 +190,19 @@ namespace RoboidControl.Unity { SkinnedMeshRenderer[] meshRenderers = parentTransform.GetComponentsInChildren(); #if pHUMANOID4 - if (parentThing.objectType == 7) { - HumanoidControl hc = parentThing.gameObject.GetComponent(); - if (hc == null) - hc = parentThing.gameObject.AddComponent(); + // if (parentThing.objectType == 7) { + // HumanoidControl hc = parentThing.gameObject.GetComponent(); + // if (hc == null) + // hc = parentThing.gameObject.AddComponent(); - foreach (SkinnedMeshRenderer meshRenderer in meshRenderers) { - if (meshRenderer.rootBone != null) { - Debug.Log("Found a skinned mesh with bones"); - hc.RetrieveBonesFrom(meshRenderer.rootBone); - break; - } - } - } + // foreach (SkinnedMeshRenderer meshRenderer in meshRenderers) { + // if (meshRenderer.rootBone != null) { + // Debug.Log("Found a skinned mesh with bones"); + // hc.RetrieveBonesFrom(meshRenderer.rootBone); + // break; + // } + // } + // } #endif parentTransform.localScale = Vector3.one; if (meshRenderers.Length > 0) { diff --git a/Unity/Wheel.cs b/Unity/Wheel.cs index 53b7820..41d427f 100644 --- a/Unity/Wheel.cs +++ b/Unity/Wheel.cs @@ -38,7 +38,7 @@ namespace RoboidControl.Unity { GameObject gameObj = Instantiate(prefab); Wheel component = gameObj.GetComponent(); if (component != null) - component.core = new RoboidControl.Thing(RoboidControl.Thing.Type.UncontrolledMotor, false); + component.core = new RoboidControl.Thing(RoboidControl.Thing.Type.UncontrolledMotor); return component; } else { @@ -49,7 +49,8 @@ namespace RoboidControl.Unity { SiteServer participant = FindAnyObjectByType(); RoboidControl.Thing core = participant.coreParticipant.Get(thingId); if (core == null) - core = new(participant.coreParticipant, RoboidControl.Thing.Type.UncontrolledMotor, thingId, false); + //core = new(participant.coreParticipant, RoboidControl.Thing.Type.UncontrolledMotor, thingId, false); + core = RoboidControl.Thing.CreateRemote(participant.coreParticipant, RoboidControl.Thing.Type.UncontrolledMotor, thingId); else { ; } diff --git a/src/Participant.cs b/src/Participant.cs index a936b87..74c3773 100644 --- a/src/Participant.cs +++ b/src/Participant.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Collections.Concurrent; using System.Net; using System.Net.Sockets; -using System.Reflection.Metadata; namespace RoboidControl { diff --git a/src/Thing.cs b/src/Thing.cs index b9f9b29..72a54b1 100644 --- a/src/Thing.cs +++ b/src/Thing.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Collections.Concurrent; using LinearAlgebra; -using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection; namespace RoboidControl { diff --git a/src/Things/RelativeEncoder.cs b/src/Things/RelativeEncoder.cs index d3bc8b7..aee9d7c 100644 --- a/src/Things/RelativeEncoder.cs +++ b/src/Things/RelativeEncoder.cs @@ -1,6 +1,4 @@ -using NUnit.Framework; - namespace RoboidControl { /// @brief An Incremental Encoder measures the rotations of an axle using a rotary