Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void) updateVirtualStick
- {
- // In rollPitchVelocity mode, the pitch property in DJIVirtualStickFlightControlData represents the Y direction velocity.
- // The roll property represents the X direction velocity.
- DJIVirtualStickFlightControlData ctrlData = {0};
- ctrlData.pitch = self.mYVelocity;
- ctrlData.roll = self.mXVelocity;
- ctrlData.yaw = self.mYaw;
- ctrlData.verticalThrottle = self.mThrottle;
- WeakRef(target);
- if (self.flightController && self.flightController.isVirtualStickControlModeAvailable) {
- [self.flightController sendVirtualStickFlightControlData:ctrlData withCompletion:^(NSError * _Nullable error) {
- WeakReturn(target);
- if (error) {
- NSLog(@"Send Control Data error!");
- }
- else
- {
- NSLog(@"Send Control Data succeeded!");
- }
- }];
- }
- else{
- NSLog(@"Virtual Stick Control Mode not Availabe!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement