Changeset b094d6c in orbit for iOS/Orbit/Orbit/controllers


Ignore:
Timestamp:
12/31/13 02:45:27 (9 years ago)
Author:
Steve Castellotti <sc@…>
Branches:
master, Servo
Children:
16249e0
Parents:
67d9807
Message:
  • Fine-tuning of Throttle/Yaw/Pitch? thresholds and range of settings
  • Inverted calculations for Yaw so that left on the slider rotates left/counter-clockwise (when viewed from above) and vice versa
Location:
iOS/Orbit/Orbit/controllers
Files:
2 edited

Legend:

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

    r67d9807 rb094d6c  
    1818 
    1919double defaultControlThrottle = 0.8; 
    20 double defaultControlYaw = 0.78; 
     20double defaultControlYaw = 0.47; // 0.78 is the actual setting required, but .47 is the inverse (1.25 - 0.78) 
    2121double defaultControlPitch = 0.31; 
    2222 
  • iOS/Orbit/Orbit/controllers/AdvancedViewController.m

    r67d9807 rb094d6c  
    9191- (void) adjustValues 
    9292{ 
    93    NSLog(@"DEBUG: yaw:%f pitch:%f", yaw.value, pitch.value); 
    94    [signalConverter setYaw:[self yawValue]throttle:[self throttleValue] pitch:[self pitchValue]]; 
     93   [signalConverter setControlSettings:[self yawValue]throttle:[self throttleValue] pitch:[self pitchValue]]; 
    9594} 
    9695 
    9796- (int) yawValue 
    9897{ 
    99    return round(yaw.value * 100); 
     98   // We subtract the current Yaw position from the maximum slider value 
     99   // because smaller values instruct the helicopter to spin to the right 
     100   // (clockwise if looking down from above) whereas intuitively moving 
     101   // the slider to the left should cause it to spin left 
     102    
     103   return round((yaw.maximumValue - yaw.value) * 100); 
    100104} 
    101105 
     
    126130   throttle.value = defaultControlThrottle; 
    127131   pitch.value = defaultControlPitch; 
    128    yaw.value = defaultControlYaw - 0.3; 
     132   yaw.value = defaultControlYaw - 0.5; 
    129133   [self adjustValues]; 
    130134    
     
    207211         if (((newYaw > yaw.value) && (newYaw - yaw.value > titleSensorMinimumThreshold)) || 
    208212             ((newYaw < yaw.value) && (yaw.value - newYaw > titleSensorMinimumThreshold))) { 
     213             
    209214            yaw.value = newYaw; 
    210215         } 
Note: See TracChangeset for help on using the changeset viewer.