Create placeholder motors when they are not found
This commit is contained in:
parent
87241a0279
commit
5759412f70
@ -139,8 +139,12 @@ namespace RoboidControl {
|
|||||||
byte ix = 0;
|
byte ix = 0;
|
||||||
byte leftWheelId = data[ix++];
|
byte leftWheelId = data[ix++];
|
||||||
this.leftWheel = this.owner.Get(leftWheelId) as Motor;
|
this.leftWheel = this.owner.Get(leftWheelId) as Motor;
|
||||||
|
this.leftWheel ??= new Motor(this) { id = leftWheelId };
|
||||||
|
|
||||||
byte rightWheelId = data[ix++];
|
byte rightWheelId = data[ix++];
|
||||||
this.rightWheel = this.owner.Get(rightWheelId) as Motor;
|
this.rightWheel = this.owner.Get(rightWheelId) as Motor;
|
||||||
|
this.rightWheel ??= new Motor(this) { id = rightWheelId };
|
||||||
|
|
||||||
this._wheelRadius = LowLevelMessages.ReceiveFloat16(data, ref ix);
|
this._wheelRadius = LowLevelMessages.ReceiveFloat16(data, ref ix);
|
||||||
//this._wheelSeparation = LowLevelMessages.ReceiveFloat16(data, ref ix);
|
//this._wheelSeparation = LowLevelMessages.ReceiveFloat16(data, ref ix);
|
||||||
this.updateQueue.Enqueue(new CoreEvent(BinaryMsg.Id));
|
this.updateQueue.Enqueue(new CoreEvent(BinaryMsg.Id));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user