示例#1
0
 public override bool Equals(object obj)
 {
     if (obj == null)
     {
         return(false);
     }
     if (GetType() == obj.GetType())
     {
         TripleShort other = (TripleShort)obj;
         return(x == other.x && y == other.y && z == other.z);
     }
     return(false);
 }
示例#2
0
 private MotionSensorSample ParseMessage(byte[] bytes)
 {
     try
     {
         var message = new IndexedESenseMessage();
         message.Decode(bytes);
         var readings = message.DataAsShortArray();
         var gyro     = new TripleShort(readings[0], readings[1], readings[2]);
         var acc      = new TripleShort(readings[3], readings[4], readings[5]);
         return(new MotionSensorSample(gyro, acc, message.PacketIndex));
     }
     catch (Exception)
     {
         return(null);
     }
 }
示例#3
0
 public MotionSensorChangedEventArgs(TripleShort gyro, TripleShort acc)
 {
     Gyro = gyro;
     Acc  = acc;
 }
示例#4
0
 /// <summary>
 /// Construct a new MotionSensorSample.
 /// </summary>
 /// <param name="gyro">Sensor reading of the gyroscope</param>
 /// <param name="acc">Sensor reading of the acceleromter</param>
 /// <param name="id">Consecutive sample id</param>
 public MotionSensorSample(TripleShort gyro, TripleShort acc, byte id)
 {
     Gyro     = gyro;
     Acc      = acc;
     SampleId = id;
 }