Enabling Gimbal Synchronization on M300
1065 4 2020-10-21
Uploading and Loding Picture ...(0/1)
o(^-^)o
fans7c8aba9d
lvl.2

United States
Offline

Hello,

I'm trying to synchronize the gimbals for the DJI M300 with an H20T in Slot 1 and Wingsland Z15 Spotlight in Slot 2.

Referencing the SDK I'm using startMultiGimbalAttitudeSynchronizationWithParam:completion to start synchronization.

When I call the function with the parameters 0 and 1 to synchonize left and right gimbals.  

        gimbal.startMultiGimbalAttitudeSynchronization(withParam: [0, 1]) { (error) in
            if let error = error {
                print(error)
            }
        }


the function returns an Error


Error Domain=DJISDKCacheErrorDomain Code=-2012 "Too Many Arguments(code:-2012)" UserInfo={NSLocalizedDescription=Too Many Arguments(code:-2012)}


Thanks!


2020-10-21
Use props
想养一条边牧
lvl.3
Flight distance : 1155 ft
Hong Kong
Offline

The correct way is  gimbal.startMultiGimbalAttitudeSynchronization(withParam: [1, 1,0]). It's a NSArray with three prameter, "1" means choosed, otherwise give "0".
2020-10-22
Use props
fans7c8aba9d
lvl.2

United States
Offline

想养一条边牧 Posted at 10-22 02:01
The correct way is  gimbal.startMultiGimbalAttitudeSynchronization(withParam: [1, 1,0]). It's a NSArray with three prameter, "1" means choosed, otherwise give "0".

Thanks! I tried passing parameters gimbal.startMultiGimbalAttitudeSynchronization(withParam: [1,1,0])  and  gimbal.startMultiGimbalAttitudeSynchronization(withParam: [1,1,1])  . I'm still seeing the -2012 error for Too Many Arguments.
2020-10-22
Use props
想养一条边牧
lvl.3
Flight distance : 1155 ft
China
Offline

I'm not sure the Swift, it works with my OC code below, maybe you can try to convert to the Swift.
DJIGimbal* gimbal = [DemoComponentHelper fetchGimbal];
    NSArray* test = @[@[@(1),@(1),@(0)]];
    [gimbal startMultiGimbalAttitudeSynchronizationWithParam:test completion:^(NSError * _Nullable error) {
        if(error){
            ShowResult(@"%@",error.localizedDescription);
        }else{
            ShowResult(@"startMultiGimbalAttitudeSynchronizationWithParam:1,1,0 success");
        }
    }];
2020-10-23
Use props
fans7c8aba9d
lvl.2

United States
Offline

想养一条边牧 Posted at 10-23 04:01
I'm not sure the Swift, it works with my OC code below, maybe you can try to convert to the Swift.
DJIGimbal* gimbal = [DemoComponentHelper fetchGimbal];
    NSArray* test = @[@[@(1),@(1),@(0)]];

Thanks converting the array to Swift did the trick turned out is was a double array of values. For those who are looking this is the swift version of what you need to send over.

let test = [[NSNumber(value: 1), NSNumber(value: 1), NSNumber(value: 0)]]
2020-10-23
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules