Compatibility

This commit is contained in:
Pascal Serrarens 2025-05-28 12:35:19 +02:00
parent 7f3698ecaa
commit 63b5a75618
7 changed files with 19 additions and 20 deletions

View File

@ -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);
}
};
}
}
#endif

View File

@ -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;
}

View File

@ -190,19 +190,19 @@ namespace RoboidControl.Unity {
SkinnedMeshRenderer[] meshRenderers = parentTransform.GetComponentsInChildren<SkinnedMeshRenderer>();
#if pHUMANOID4
if (parentThing.objectType == 7) {
HumanoidControl hc = parentThing.gameObject.GetComponent<HumanoidControl>();
if (hc == null)
hc = parentThing.gameObject.AddComponent<HumanoidControl>();
// if (parentThing.objectType == 7) {
// HumanoidControl hc = parentThing.gameObject.GetComponent<HumanoidControl>();
// if (hc == null)
// hc = parentThing.gameObject.AddComponent<HumanoidControl>();
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) {

View File

@ -38,7 +38,7 @@ namespace RoboidControl.Unity {
GameObject gameObj = Instantiate(prefab);
Wheel component = gameObj.GetComponent<Wheel>();
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<SiteServer>();
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 {
;
}

View File

@ -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 {

View File

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using LinearAlgebra;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
namespace RoboidControl {

View File

@ -1,6 +1,4 @@
using NUnit.Framework;
namespace RoboidControl {
/// @brief An Incremental Encoder measures the rotations of an axle using a rotary