Exemple #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);
 }
Exemple #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);
     }
 }
 public MotionSensorChangedEventArgs(TripleShort gyro, TripleShort acc)
 {
     Gyro = gyro;
     Acc  = acc;
 }
Exemple #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;
 }