public override void Deserialize(byte[] serializedMessage, ref int currentIndex) { //translation translation = new Messages.geometry_msgs.Vector3(serializedMessage, ref currentIndex); //rotation rotation = new Messages.geometry_msgs.Quaternion(serializedMessage, ref currentIndex); }
public override byte[] Serialize(bool partofsomethingelse) { List <byte[]> pieces = new List <byte[]>(); //translation if (translation == null) { translation = new Messages.geometry_msgs.Vector3(); } pieces.Add(translation.Serialize(true)); //rotation if (rotation == null) { rotation = new Messages.geometry_msgs.Quaternion(); } pieces.Add(rotation.Serialize(true)); // combine every array in pieces into one array and return it int __a_b__f = pieces.Sum((__a_b__c) => __a_b__c.Length); int __a_b__e = 0; byte[] __a_b__d = new byte[__a_b__f]; foreach (var __p__ in pieces) { Array.Copy(__p__, 0, __a_b__d, __a_b__e, __p__.Length); __a_b__e += __p__.Length; } return(__a_b__d); }
public override void Randomize() { Random rand = new Random(); //translation translation = new Messages.geometry_msgs.Vector3(); translation.Randomize(); //rotation rotation = new Messages.geometry_msgs.Quaternion(); rotation.Randomize(); }
public Quaternion(Messages.geometry_msgs.Quaternion shallow) : this(shallow.x, shallow.y, shallow.z, shallow.w) { }