54
54
import org .droidplanner .services .android .core .drone .variables .GuidedPoint ;
55
55
import org .droidplanner .services .android .core .drone .variables .calibration .AccelCalibration ;
56
56
import org .droidplanner .services .android .core .drone .variables .calibration .MagnetometerCalibrationImpl ;
57
+ import org .droidplanner .services .android .core .firmware .FirmwareType ;
57
58
import org .droidplanner .services .android .core .gcs .follow .Follow ;
58
59
import org .droidplanner .services .android .core .gcs .follow .FollowAlgorithm ;
59
60
import org .droidplanner .services .android .core .helpers .coordinates .Coord2D ;
@@ -257,12 +258,14 @@ public static FootPrint getProxyCameraFootPrint(Footprint footprint) {
257
258
MathUtils .coord2DToLatLong (footprint .getVertexInGlobalFrame ()));
258
259
}
259
260
260
- public static FollowAlgorithm .FollowModes followTypeToMode (FollowType followType ) {
261
+ public static FollowAlgorithm .FollowModes followTypeToMode (MavLinkDrone drone , FollowType followType ) {
261
262
final FollowAlgorithm .FollowModes followMode ;
262
263
263
264
switch (followType ) {
264
265
case ABOVE :
265
- followMode = FollowAlgorithm .FollowModes .ABOVE ;
266
+ followMode = (drone .getFirmwareType () == FirmwareType .ARDU_SOLO )
267
+ ? FollowAlgorithm .FollowModes .SPLINE_ABOVE
268
+ : FollowAlgorithm .FollowModes .ABOVE ;
266
269
break ;
267
270
268
271
case LEAD :
@@ -271,7 +274,9 @@ public static FollowAlgorithm.FollowModes followTypeToMode(FollowType followType
271
274
272
275
default :
273
276
case LEASH :
274
- followMode = FollowAlgorithm .FollowModes .LEASH ;
277
+ followMode = (drone .getFirmwareType () == FirmwareType .ARDU_SOLO )
278
+ ? FollowAlgorithm .FollowModes .SPLINE_LEASH
279
+ : FollowAlgorithm .FollowModes .LEASH ;
275
280
break ;
276
281
277
282
case CIRCLE :
@@ -286,14 +291,6 @@ public static FollowAlgorithm.FollowModes followTypeToMode(FollowType followType
286
291
followMode = FollowAlgorithm .FollowModes .RIGHT ;
287
292
break ;
288
293
289
- case SPLINE_LEASH :
290
- followMode = FollowAlgorithm .FollowModes .SPLINE_LEASH ;
291
- break ;
292
-
293
- case SPLINE_ABOVE :
294
- followMode = FollowAlgorithm .FollowModes .SPLINE_ABOVE ;
295
- break ;
296
-
297
294
case GUIDED_SCAN :
298
295
followMode = FollowAlgorithm .FollowModes .GUIDED_SCAN ;
299
296
break ;
@@ -315,6 +312,7 @@ public static FollowType followModeToType(FollowAlgorithm.FollowModes followMode
315
312
switch (followMode ) {
316
313
default :
317
314
case LEASH :
315
+ case SPLINE_LEASH :
318
316
followType = FollowType .LEASH ;
319
317
break ;
320
318
@@ -335,15 +333,8 @@ public static FollowType followModeToType(FollowAlgorithm.FollowModes followMode
335
333
break ;
336
334
337
335
case ABOVE :
338
- followType = FollowType .ABOVE ;
339
- break ;
340
-
341
- case SPLINE_LEASH :
342
- followType = FollowType .SPLINE_LEASH ;
343
- break ;
344
-
345
336
case SPLINE_ABOVE :
346
- followType = FollowType .SPLINE_ABOVE ;
337
+ followType = FollowType .ABOVE ;
347
338
break ;
348
339
349
340
case GUIDED_SCAN :
@@ -918,7 +909,7 @@ public static void enableFollowMe(DroneManager droneMgr, Handler droneHandler, F
918
909
if (droneMgr == null )
919
910
return ;
920
911
921
- final FollowAlgorithm .FollowModes selectedMode = CommonApiUtils .followTypeToMode (followType );
912
+ final FollowAlgorithm .FollowModes selectedMode = CommonApiUtils .followTypeToMode (droneMgr . getDrone (), followType );
922
913
923
914
if (selectedMode != null ) {
924
915
final Follow followMe = droneMgr .getFollowMe ();
0 commit comments