Correct PoseMsg length

This commit is contained in:
Pascal Serrarens 2025-06-06 09:14:52 +02:00
parent 690426eb69
commit d5c301fa86

View File

@ -14,7 +14,7 @@ namespace RoboidControl {
/// <summary>
/// The length of the message
/// </summary>
public const byte length = 4 + 4 + 4;
public byte length = 4 + 4 + 4;
/// <summary>
/// The network ID of the thing
/// </summary>
@ -108,12 +108,12 @@ namespace RoboidControl {
if ((this.poseType & Pose_Position) != 0)
this.position = LowLevelMessages.ReceiveSpherical(buffer, ref ix);
if ((this.poseType & Pose_Orientation) != 0)
//this.orientation = SwingTwist.FromQuat32(LowLevelMessages.ReceiveQuat32(buffer, ref ix));
this.orientation = LowLevelMessages.ReceiveSwingTwist(buffer, ref ix);
if ((this.poseType & Pose_LinearVelocity) != 0)
this.linearVelocity = LowLevelMessages.ReceiveSpherical(buffer, ref ix);
this.linearVelocity = LowLevelMessages.ReceiveSpherical(buffer, ref ix);
if ((this.poseType & Pose_AngularVelocity) != 0)
this.angularVelocity = LowLevelMessages.ReceiveSpherical(buffer, ref ix);
this.length = ix;
}
/// @copydoc Passer::RoboidControl::IMessage::Serialize
@ -133,7 +133,6 @@ namespace RoboidControl {
if ((poseType & Pose_Position) != 0)
LowLevelMessages.SendSpherical(buffer, ref ix, this.position);
if ((poseType & Pose_Orientation) != 0)
//LowLevelMessages.SendQuat32(buffer, ref ix, this.orientation);
LowLevelMessages.SendSwingTwist(buffer, ref ix, this.orientation);
if ((poseType & Pose_LinearVelocity) != 0)
LowLevelMessages.SendSpherical(buffer, ref ix, this.linearVelocity);