improved motion control

This commit is contained in:
True Zhuanjia
2026-06-21 15:29:40 +08:00
parent f4b161ed06
commit adb5091dc2
4 changed files with 87 additions and 48 deletions
@@ -2015,17 +2015,18 @@ static NSString* VLTerminationHintForErrorCode(int errorCode) {
[self reConfigStreamViewRealtime];
}
/*
- (NSMutableDictionary *)startGyroUpdate:(OnScreenWidgetView *)sender yawFactor:(CGFloat)yawFactor pitchFactor:(CGFloat)pitchFactor rollFactor:(CGFloat)rollFactor{
NSMutableDictionary* gyroControlPreviousStatus = [NSMutableDictionary dictionary];
if(!_motionHandler.gyroControlStarted) [gyroControlPreviousStatus setObject:sender forKey:@"gyroControlStarter"];
if(!_motionHandler.motionControlStarted) [gyroControlPreviousStatus setObject:sender forKey:@"gyroControlStarter"];
[gyroControlPreviousStatus setObject:@(_motionHandler.widgetYawFactor) forKey:@"previousYawFactor"];
[gyroControlPreviousStatus setObject:@(_motionHandler.widgetPitchFactor) forKey:@"previousPitchFactor"];
[gyroControlPreviousStatus setObject:@(_motionHandler.widgetRollFactor) forKey:@"previousRollFactor"];
_motionHandler.widgetYawFactor = yawFactor;
_motionHandler.widgetPitchFactor = pitchFactor;
_motionHandler.widgetRollFactor = rollFactor;
[_motionHandler startGyroUpdate];
[_motionHandler startMotionUpdate];
return gyroControlPreviousStatus;
}
@@ -2033,8 +2034,8 @@ static NSString* VLTerminationHintForErrorCode(int errorCode) {
- (NSMutableDictionary*)start:(CGFloat)yawFactor pitchFactor:(CGFloat)pitchFactor rollFactor:(CGFloat)rollFactor{
NSMutableDictionary* gyroControlPreviousStatus = [NSMutableDictionary dictionary];
if(!_motionHandler.gyroControlStarted){
[gyroControlPreviousStatus setObject:@(_motionHandler.gyroControlStarted) forKey:@"gyroStarted"];
if(!_motionHandler.motionControlStarted){
[gyroControlPreviousStatus setObject:@(_motionHandler.motionControlStarted) forKey:@"gyroStarted"];
}
[gyroControlPreviousStatus setObject:@(_motionHandler.widgetYawFactor) forKey:@"previousYawFactor"];
[gyroControlPreviousStatus setObject:@(_motionHandler.widgetPitchFactor) forKey:@"previousPitchFactor"];
@@ -2043,10 +2044,11 @@ static NSString* VLTerminationHintForErrorCode(int errorCode) {
_motionHandler.widgetYawFactor = yawFactor;
_motionHandler.widgetPitchFactor = pitchFactor;
_motionHandler.widgetRollFactor = rollFactor;
[_motionHandler startGyroUpdate];
[_motionHandler startMotionUpdate];
return gyroControlPreviousStatus;
}
*/
- (void)startAccelUpdate{
[_motionHandler startAccelUpdate];