Changeset b094d6c in orbit for iOS


Ignore:
Timestamp:
12/31/13 02:45:27 (6 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
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • iOS/Orbit/Orbit/SignalConverter.h

    r6db346c rb094d6c  
    4646- (BOOL) isVolumeMax; 
    4747- (BOOL) isAudioJackPlugged; 
    48 - (void) setYaw:(int)y throttle:(int)t pitch:(int)p; 
     48- (void) setControlSettings:(int)y throttle:(int)t pitch:(int)p; 
    4949- (void) playTestSound; 
    5050- (void) stopTestSound; 
  • iOS/Orbit/Orbit/SignalConverter.m

    r6db346c rb094d6c  
    285285} 
    286286 
    287 - (void) setYaw:(int)y throttle:(int)t pitch:(int)p 
    288 { 
     287- (void) setControlSettings:(int)y throttle:(int)t pitch:(int)p 
     288{ 
     289     
     290    NSLog(@"DEBUG: Signal Converter: throttle:%d yaw:%d pitch:%d", t, y, p); 
     291     
     292    throttle = t; 
    289293    yaw = y; 
    290     throttle = t; 
    291294    pitch = p; 
    292295     
  • 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         } 
  • iOS/Orbit/Orbit/en.lproj/MainStoryboard.storyboard

    r67d9807 rb094d6c  
    8282                                    </label> 
    8383                                    <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.80000000000000004" minValue="0.25" maxValue="1.25" id="mKS-gr-qpn" userLabel="Throttle"> 
    84                                         <rect key="frame" x="20" y="16" width="280" height="30"/> 
     84                                        <rect key="frame" x="18" y="20" width="280" height="30"/> 
    8585                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> 
    8686                                        <connections> 
     
    114114                                        <nil key="highlightedColor"/> 
    115115                                    </label> 
    116                                     <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.78000000000000003" minValue="0.25" maxValue="1.25" id="8k8-7Y-hWH" userLabel="Yaw"> 
     116                                    <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.46999999999999997" minValue="0.029999999999999999" maxValue="1.25" id="8k8-7Y-hWH" userLabel="Yaw"> 
    117117                                        <rect key="frame" x="20" y="20" width="280" height="30"/> 
    118118                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> 
     
    147147                                        <nil key="highlightedColor"/> 
    148148                                    </label> 
    149                                     <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.31" minValue="0.0" maxValue="0.63" id="pE4-wd-89x" userLabel="Throttle"> 
    150                                         <rect key="frame" x="20" y="16" width="280" height="30"/> 
     149                                    <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.31" minValue="0.01" maxValue="0.62" id="pE4-wd-89x" userLabel="Throttle"> 
     150                                        <rect key="frame" x="20" y="20" width="280" height="30"/> 
    151151                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> 
    152152                                        <connections> 
Note: See TracChangeset for help on using the changeset viewer.