- Timestamp:
- 12/31/13 02:45:27 (9 years ago)
- Branches:
- master, Servo
- Children:
- 16249e0
- Parents:
- 67d9807
- Location:
- iOS/Orbit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
iOS/Orbit/Orbit/SignalConverter.h
r6db346c rb094d6c 46 46 - (BOOL) isVolumeMax; 47 47 - (BOOL) isAudioJackPlugged; 48 - (void) set Yaw:(int)y throttle:(int)t pitch:(int)p;48 - (void) setControlSettings:(int)y throttle:(int)t pitch:(int)p; 49 49 - (void) playTestSound; 50 50 - (void) stopTestSound; -
iOS/Orbit/Orbit/SignalConverter.m
r6db346c rb094d6c 285 285 } 286 286 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; 289 293 yaw = y; 290 throttle = t;291 294 pitch = p; 292 295 -
iOS/Orbit/Orbit/controllers/AdvancedViewController.h
r67d9807 rb094d6c 18 18 19 19 double defaultControlThrottle = 0.8; 20 double defaultControlYaw = 0. 78;20 double defaultControlYaw = 0.47; // 0.78 is the actual setting required, but .47 is the inverse (1.25 - 0.78) 21 21 double defaultControlPitch = 0.31; 22 22 -
iOS/Orbit/Orbit/controllers/AdvancedViewController.m
r67d9807 rb094d6c 91 91 - (void) adjustValues 92 92 { 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]]; 95 94 } 96 95 97 96 - (int) yawValue 98 97 { 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); 100 104 } 101 105 … … 126 130 throttle.value = defaultControlThrottle; 127 131 pitch.value = defaultControlPitch; 128 yaw.value = defaultControlYaw - 0. 3;132 yaw.value = defaultControlYaw - 0.5; 129 133 [self adjustValues]; 130 134 … … 207 211 if (((newYaw > yaw.value) && (newYaw - yaw.value > titleSensorMinimumThreshold)) || 208 212 ((newYaw < yaw.value) && (yaw.value - newYaw > titleSensorMinimumThreshold))) { 213 209 214 yaw.value = newYaw; 210 215 } -
iOS/Orbit/Orbit/en.lproj/MainStoryboard.storyboard
r67d9807 rb094d6c 82 82 </label> 83 83 <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"/> 85 85 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> 86 86 <connections> … … 114 114 <nil key="highlightedColor"/> 115 115 </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"> 117 117 <rect key="frame" x="20" y="20" width="280" height="30"/> 118 118 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> … … 147 147 <nil key="highlightedColor"/> 148 148 </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"/> 151 151 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> 152 152 <connections>
Note: See TracChangeset
for help on using the changeset viewer.