diff --git a/Unity/DifferentialDrive.cs b/Unity/DifferentialDrive.cs index 2d2c53a..3ea68bf 100644 --- a/Unity/DifferentialDrive.cs +++ b/Unity/DifferentialDrive.cs @@ -125,7 +125,6 @@ namespace RoboidControl.Unity { // Use smoothing to emulate motor inertia rb.velocity = 0.9f * rb.velocity + 0.1f * forwardSpeed * transform.forward; - Debug.Log(rb.velocity); rb.angularVelocity = 0.9f * rb.angularVelocity + 0.1f * turningSpeed * Vector3.up; } } diff --git a/src/Participants/ParticipantUDP.cs b/src/Participants/ParticipantUDP.cs index 4c1e14c..5ea154c 100644 --- a/src/Participants/ParticipantUDP.cs +++ b/src/Participants/ParticipantUDP.cs @@ -107,7 +107,7 @@ namespace RoboidControl { /// The interval in milliseconds for publishing (broadcasting) data on the local network /// public ulong publishIntervalMS = 3000; // = 3 seconds - public ulong sendUpdateIntervalMS = 100; // for object updates + public ulong sendUpdateIntervalMS = 100; // = 0.1 seconds for object updates //public byte[] buffer = new byte[1024]; @@ -219,8 +219,8 @@ namespace RoboidControl { // this.Send(participant, poseMsg); // BinaryMsg binaryMsg = new(thing.owner.networkId, thing); // this.Send(participant, binaryMsg); - participant.Send(new PoseMsg(thing.owner.networkId, thing)); - participant.Send(new BinaryMsg(thing.owner.networkId, thing)); + // participant.Send(new PoseMsg(thing.owner.networkId, thing)); + // participant.Send(new BinaryMsg(thing.owner.networkId, thing)); } this.nextSendUpdate = currentTimeMS + this.sendUpdateIntervalMS; } diff --git a/src/Things/Motor.cs b/src/Things/Motor.cs index 23dbbd3..cb1c8b6 100644 --- a/src/Things/Motor.cs +++ b/src/Things/Motor.cs @@ -40,7 +40,8 @@ namespace RoboidControl { return data; } public override void ProcessBinary(byte[] data) { - this.targetSpeed = (float)(sbyte)data[0] / 127; + this._targetSpeed = (float)(sbyte)data[0] / 127; + updateQueue.Enqueue(new CoreEvent(BinaryMsg.Id)); } }