Changeset ac59750 in orbit for iOS


Ignore:
Timestamp:
12/31/13 01:35:20 (7 years ago)
Author:
Steve Castellotti <sc@…>
Branches:
master, Servo
Children:
395ea1a
Parents:
9a24f48
Message:
  • referenceTiltX and Y processing added
Location:
iOS/Orbit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • iOS/Orbit/Orbit/controllers/AdvancedViewController.m

    r9a24f48 rac59750  
    150150      [_switchTiltSensorControlThrottle setOn:NO animated:YES]; 
    151151      [_switchTiltSensorControlThrottle setEnabled:NO]; 
     152      referenceTiltX = 0; 
     153                referenceTiltY = 0; 
    152154   } 
    153155    
     
    169171   // http://nscookbook.com/2013/03/ios-programming-recipe-19-using-core-motion-to-access-gyro-and-accelerometer/ 
    170172    
     173    
     174    
     175   // TODO Add routing to smooth out changes 
     176   // Abrupt movements is breaking signal transmission 
     177    
     178    
     179    
    171180   if ([_switchTiltSensorControl isOn]) { 
    172181       
     
    180189         //   NSLog(@"DEBUG: tiltX:%f tiltY:%f", tiltX, tiltY); 
    181190          
     191         if (referenceTiltX == 0) { 
     192            referenceTiltX = tiltX; 
     193            referenceTiltY = tiltY; 
     194         } 
     195          
    182196         double newYaw = defaultControlYaw + (tiltX - referenceTiltX); 
    183197         double newPitch = defaultControlPitch - (tiltY - referenceTiltY); 
Note: See TracChangeset for help on using the changeset viewer.