-
Notifications
You must be signed in to change notification settings - Fork 6
/
ControlBoardBase.java
1030 lines (788 loc) · 32 KB
/
ControlBoardBase.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package com.andruav.controlBoard;
import com.andruav.AndruavEngine;
import com.andruav.event.fcb_event.Event_FCB_RemoteControlSettings;
import com.andruav.andruavUnit.AndruavUnitBase;
import com.andruav.Constants;
import com.andruav.EmergencyBase;
import com.andruav.notification.PanicFacade;
import com.andruav.controlBoard.shared.common.FlightMode;
import com.andruav.controlBoard.shared.missions.MohemmaMapBase;
import com.andruav.protocol.R;
/**
* Represents A Generic <b>Flight Control Board</b>. Status in this board are Andruav Status, and inherited classes have to map their specific status to this Shared Generic Representation.
* <br>
* <a href="http://diydrones.com/profiles/blogs/andruav-towards-a-shared-data-model">see this topic [Andruav - Towards a Shared Data Model]</a>
* <br><br>Created by M.Hefny on 04-Apr-15.
*/
public class ControlBoardBase {
public static final int CONST_CHANNEL_1_ROLL = 0;
public static final int CONST_CHANNEL_2_PITCH = 1;
public static final int CONST_CHANNEL_3_THROTTLE = 2;
public static final int CONST_CHANNEL_4_YAW = 3;
public static final int CONST_CHANNEL_5_AUX1 = 4;
public static final int CONST_CHANNEL_6_AUX2 = 5;
public static final int CONST_CHANNEL_7_AUX3 = 6;
public static final int CONST_CHANNEL_8_AUX4 = 7;
protected final Object telemetryBytesObject = new Object();
protected AndruavUnitBase mAndruavUnitBase;
protected boolean isRCFailsafe = false;
protected int hasGyro = Constants.UNKNOWN;
protected int hasAcc = Constants.UNKNOWN;
protected int hasBaro = Constants.UNKNOWN;
protected int hasMag = Constants.UNKNOWN;
protected int hasGPS = Constants.UNKNOWN;
protected int hasSonar = Constants.UNKNOWN;
protected int hasGyroEnabled = Constants.UNKNOWN;
protected int hasAccEnabled = Constants.UNKNOWN;
protected int hasBaroEnabled = Constants.UNKNOWN;
protected int hasMagEnabled = Constants.UNKNOWN;
protected int hasGPSEnabled = Constants.UNKNOWN;
protected int hasSonarEnabled = Constants.UNKNOWN;
protected int hasGyroHealthy = Constants.UNKNOWN;
protected int hasAccHealthy = Constants.UNKNOWN;
protected int hasBaroHealthy = Constants.UNKNOWN;
protected int hasMagHealthy = Constants.UNKNOWN;
protected int hasGPSHealthy = Constants.UNKNOWN;
protected int hasSonarHealthy = Constants.UNKNOWN;
protected boolean rcChannelBlock = false;
public boolean do_RCChannelBlocked()
{
return rcChannelBlock;
}
public void do_RCChannelBlocked(final boolean block)
{
if ((rcChannelBlock != block))
{ // a change happend
if (block)
{ // Software Remote from Andruav GCS and GamePads are released.
sendRCChannels(Event_FCB_RemoteControlSettings.RC_SUB_ACTION_RELEASED, null, false);
sendRCChannels(Event_FCB_RemoteControlSettings.RC_SUB_ACTION_RELEASED, null, false);
sendRCChannels(Event_FCB_RemoteControlSettings.RC_SUB_ACTION_RELEASED, null, false);
AndruavEngine.notification().Speak("Blocked");
}
else
{
AndruavEngine.notification().Speak("Unblocked");
}
}
rcChannelBlock = block;
this.mAndruavUnitBase.setisGCSBlockedFromBoard(block);
}
// ATTITUDE
/***
* (rad, -pi..+pi)
*/
protected double PitchAngle;
protected double PitchPerUnit;
/***
* (rad, -pi..+pi)
*/
protected double RollAngle;
protected double RollPerUnit;
/***
* (rad, -pi..+pi)
*/
protected float Heading;
protected float HeadingPerUnit;
protected float HeadingOffset;
protected double yaw;
protected double YawPerUnit;
/***
* in cm
*/
protected double Altitude;
protected double AltitudePerUnit=1.0;
/***
* in cm / s
*/
protected int Vario;
protected int VarioPerUnit;
protected short gps_fixType; // 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
protected double vehicle_gps_lng;
protected double vehicle_gps_lat;
protected double vehicle_gps_alt; // (RELATIVE TO GROUND) Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL maxAltitude in addition to the WGS84 maxAltitude.
protected double gps_groundspeed; // GPS ground speed (m/s). If unknown, set to: UINT16_MAX
protected int gps_satCount;
protected double airspeed;
protected double verticalspeed;
protected double gps_lnglat_scale = 1.0; // to avoid divide by zero
protected double gps_alt_scale = 1.0; // to avoid divide by zero
protected double gps_groundspeed_scale=1.0; // GPS ground speed (m/s). If unknown, set to: UINT16_MAX
protected double airspeed_scale=1.0; // GPS ground speed (m/s). If unknown, set to: UINT16_MAX
protected double verticalspeed_scale=1.0; // GPS ground speed (m/s). If unknown, set to: UINT16_MAX
/////////////////////////// HOME LOCATION
/**
* GPS Longitude <b>HOME</b> location
*/
protected double home_gps_lng;
public double getHome_gps_lng () {
return home_gps_lng;
}
/**
* GPS Latitude <b>HOME</b> location
*/
protected double home_gps_lat;
public double getHome_gps_lat () {
return home_gps_lat;
}
/**
* GPS Latitude <b>HOME</b> location
*/
protected double home_gps_alt;
public double getHome_gps_alt () {
return home_gps_alt;
}
// BEGIN LEADER SWARM VARIABLES
protected boolean followMeOn = false;
protected double leader_drone_pos_time = 0;
protected double leader_drone_velocity = 0;
protected double leader_drone_lng_old = Constants.INVALID_GPS_LOCATION;
protected double leader_drone_lat_old = Constants.INVALID_GPS_LOCATION;
protected double leader_drone_lng = Constants.INVALID_GPS_LOCATION;
protected double leader_drone_lat = Constants.INVALID_GPS_LOCATION;
protected double leader_drone_alt = Constants.INVALID_GPS_LOCATION;
protected double leader_dist;
protected double leader_bearing;
// END
protected double target_gps_lng;
public double getTarget_gps_lng() {
return target_gps_lng;
}
protected double target_gps_lat;
public double getTarget_gps_lat() {
return target_gps_lat;
}
protected double target_gps_alt;
public double getTarget_gps_alt() {
return target_gps_alt;
}
////////////////////////////////////////////////////////////////////////////////////////
// Sensors Status
public int getHasGyro() {
return hasGyro;
}
public void setHasGyro(int hasGyro) {
if (hasGyro != this.hasGyro)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasGyro = hasGyro;
}
public int getHasAcc() {
return hasAcc;
}
public void setHasAcc(int hasAcc) {
if (hasGyro != this.hasGyro)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasAcc = hasAcc;
}
public int getHasBaro() {
return hasBaro;
}
public void setHasBaro(int hasBaro) {
if (hasGyro != this.hasGyro)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasBaro = hasBaro;
}
public int getHasMag() {
return hasMag;
}
public void setHasMag(int hasMag) {
if (hasGyro != this.hasGyro)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasMag = hasMag;
}
public int getHasGPS() {
return hasGPS;
}
public void setHasGPS(int hasGPS) {
if (hasGyro != this.hasGyro)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasGPS = hasGPS;
}
public int getHasSonar() {
return hasSonar;
}
public void setHasSonar(int hasSonar) {
if (hasGyro != this.hasGyro)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasSonar = hasSonar;
}
public int getHasGyroEnabled() {
return hasGyroEnabled;
}
public void setHasGyroEnabled(int hasGyroEnabled) {
if (hasGyroEnabled != this.hasGyroEnabled)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasGyroEnabled = hasGyroEnabled;
}
public int getHasAccEnabled() {
return hasAccEnabled;
}
public void setHasAccEnabled(int hasAccEnabled) {
if (hasAccEnabled != this.hasAccEnabled)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasAccEnabled = hasAccEnabled;
}
public int getHasMagEnabled() {
return hasMagEnabled;
}
public void setHasMagEnabled(int hasMagEnabled) {
if (hasMagEnabled != this.hasMagEnabled)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasMagEnabled = hasMagEnabled;
}
public int getHasBaroEnabled() {
return hasBaroEnabled;
}
public void setHasBaroEnabled(int hasBaroEnabled) {
if (hasBaroEnabled != this.hasBaroEnabled)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasBaroEnabled = hasBaroEnabled;
}
public int getHasGPSEnabled() {
return hasGPSEnabled;
}
public void setHasGPSEnabled(int hasGPSEnabled) {
if (hasGPSEnabled != this.hasGPSEnabled)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasGPSEnabled = hasGPSEnabled;
}
public int getHasSonarEnabled() {
return hasSonarEnabled;
}
public void setHasSonarEnabled(int hasSonarEnabled) {
if (hasSonarEnabled != this.hasSonarEnabled)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasSonarEnabled = hasSonarEnabled;
}
public int getHasGyroHealthy() {
return hasGyroHealthy;
}
public void setHasGyroHealthy(int hasGyroHealthy) {
if (hasGyroHealthy != this.hasGyroHealthy)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasGyroHealthy = hasGyroHealthy;
}
public int getHasAccHealthy() {
return hasAccHealthy;
}
public void setHasAccHealthy(int hasAccHealthy) {
if (hasAccHealthy != this.hasAccHealthy)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasAccHealthy = hasAccHealthy;
}
public int getHasMagHealthy() {
return hasMagHealthy;
}
public void setHasMagHealthy(int hasMagHealthy) {
if (hasGyro != this.hasGyro)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasMagHealthy = hasMagHealthy;
}
public int getHasBaroHealthy() {
return hasBaroHealthy;
}
public void setHasBaroHealthy(int hasBaroHealthy) {
if (hasBaroHealthy != this.hasBaroHealthy)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasBaroHealthy = hasBaroHealthy;
}
public int getHasGPSHealthy() {
return hasGPSHealthy;
}
public void setHasGPSHealthy(int hasGPSHealthy) {
if (hasGPSHealthy != this.hasGPSHealthy)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasGPSHealthy = hasGPSHealthy;
}
public int getHasSonarHealthy() {
return hasSonarHealthy;
}
public void setHasSonarHealthy(int hasSonarHealthy) {
if (hasSonarHealthy != this.hasSonarHealthy)
{
mAndruavUnitBase.sensorStatusAlertActive = true;
}
this.hasSonarHealthy = hasSonarHealthy;
}
/***
* Power Variable
* <br>10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
*/
protected double pow_battery_voltage ;
/***
* Power Variable
* <br>Consumed charge, in 1 milliampere hours 1 mAh, -1: autopilot does not provide mAh consumption estimate
*/
protected double pow_battery_current;
/***
* Power Variable
* <br>Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
*/
private double pow_battery_remaining;
/***
* Current desired roll in degrees
*/
protected double nav_roll;
public double getNavRoll () { return nav_roll * RollPerUnit;}
/***
* Current desired pitch in degrees
*/
protected double nav_pitch;
public double getNavPitch () { return nav_pitch * PitchPerUnit;}
/***
* Current desired heading in degrees
*/
protected double nav_bearing;
public double getNavBearing () { return nav_bearing * YawPerUnit;}
/***
* Bearing to current MISSION/target in degrees
*/
protected double target_bearing;
public double getNavTargetBearing () { return target_bearing * YawPerUnit;}
/***
* Distance to active MISSION in meters
*/
protected double wp_dist_old;
protected double wp_dist;
public double getNavWayPointDistance () { return wp_dist;}
/***
* Current altitude error in meters
*/
protected double alt_error;
public double getNavAltError () { return alt_error / gps_alt_scale;}
public double getPowerBatteryVoltage () {
return pow_battery_voltage;
}
public double getBatteryCurrent() {
return pow_battery_current;
}
public double getBatteryRemaining () {
return pow_battery_remaining;
}
public void setBatteryRemaining (final double remaining) {
pow_battery_remaining = remaining;
final int minBattery = AndruavEngine.getPreference().getBattery_min_value();
if ((minBattery > 0) && (remaining < minBattery))
{
final EmergencyBase emergencyBase = AndruavEngine.getEmergency();
if (emergencyBase != null)
{
emergencyBase.triggerBatteryEmergency(true);
}
}
else
{
final EmergencyBase emergencyBase = AndruavEngine.getEmergency();
if (emergencyBase != null) {
emergencyBase.triggerBatteryEmergency(false);
}
}
}
public double getPitch ()
{
return PitchAngle * PitchPerUnit;
}
public double getRoll ()
{
return RollAngle * RollPerUnit;
}
public float getHeading ()
{
return HeadingOffset + (Heading * HeadingPerUnit);
}
public double getYAW ()
{
return yaw * YawPerUnit;
}
/***
* 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @return
*/
public short getGPSfixType ()
{
return gps_fixType;
}
/***
* Longitude (WGS84), in degrees * 1E7
* @return
*/
public double getGPSLongitude()
{
return vehicle_gps_lng / gps_lnglat_scale;
}
/***
* Latitude (WGS84), in degrees * 1E7
* @return
*/
public double getGPSLatitude()
{
return vehicle_gps_lat / gps_lnglat_scale;
}
/***
* Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL maxAltitude in addition to the WGS84 maxAltitude.
* @return
*/
public double getGPSAlt()
{
return vehicle_gps_alt / gps_alt_scale;
}
public double getGPSGroundSpeed()
{
return gps_groundspeed / gps_groundspeed_scale;
}
/***
*
* @return
*/
public int getGPSSatCount ()
{
return gps_satCount;
}
public double getAltitude ()
{
return Altitude / AltitudePerUnit;
}
// single exception handler
protected int bexceptionexecute = 5;
/***
* This is advanced feature aims to avoid unnecessary traffic between Drone & CGS in case Telemetry is enabled.
*/
protected boolean mOptimizeTraffic = false;
protected boolean isArmed = false;
protected boolean isFlying = false;
/***
* Used to enable event listeners for some instances.
* Mainly in version 1.0.40 -first time to be used- :
* it is used to activate the owner -myself- instance.
* @param bActivate
*/
public void ActivateListener (boolean bActivate)
{
}
/***
* Returns a text description for the board
* @return
*/
public String getFCBDescription()
{
return "";
}
public ControlBoardBase(AndruavUnitBase andruavUnitBase)
{
mAndruavUnitBase = andruavUnitBase;
}
/**
* Deattach this class from AndruavWe7da and disconnect it from FCB.
*/
public void Release ()
{
}
public void setOptimizeTraffic (boolean enable)
{
mOptimizeTraffic = enable;
}
public boolean getOptimizeTraffic ()
{
return mOptimizeTraffic;
}
/***
* Define a fly control mode
* @param flightControl {@link FlightMode}
*/
public void setFlightControl (int flightControl, final IControlBoard_Callback lo7Ta7akom_callback)
{
return ;
}
public boolean isArmed ()
{
return false;
}
/***
* Switching to different flying modes
* Please note that if MW or other Drones does not support some of these modes you can either override
* this function or for example use do_FBWA to call do_Manual internally from the MW class.
*
* @param flightMode Generic Flying Mode Parameter {@link FlightMode}
*/
public void do_Mode(final int flightMode, final IControlBoard_Callback iControlBoard_callback)
{
switch (flightMode)
{
case FlightMode.CONST_FLIGHT_CONTROL_RTL:
do_RTL(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_SMART_RTL:
do_Smart_RTL(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_ALT_HOLD:
do_ALT_Hold(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_FOLLOW_ME:
case FlightMode.CONST_FLIGHT_CONTROL_GUIDED:
do_Guided(iControlBoard_callback);
break;
//case FlightMode.CONST_FLIGHT_CONTROL_CIRCLE:
// do_Circle(null);
// break;
case FlightMode.CONST_FLIGHT_CONTROL_LOITER:
do_Loiter(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_AUTO:
do_Auto(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_FBWA:
do_FBWA(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_FBWB:
do_FBWB(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_CRUISE:
do_Cruise(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_MANUAL:
do_Manual(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_ACRO:
do_Acro(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_STABILIZE:
break;
case FlightMode.CONST_FLIGHT_CONTROL_BRAKE:
do_Brake(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_POSTION_HOLD:
do_POS_Hold(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_HOLD:
do_Brake(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_TAKEOFF:
do_TakeOff(iControlBoard_callback);
break;
case FlightMode.CONST_FLIGHT_CONTROL_SURFACE:
do_Surface(iControlBoard_callback);
break;
}
}
public void do_ARM (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_arm));
}
public void do_Disarm (boolean emergencyDisarm,final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_disarm));
}
public void do_ChangeAltitude (final double altitude,final IControlBoard_Callback ILo7Ta7Akom__callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_takeoff));
}
public void do_TakeOff (final IControlBoard_Callback ILo7Ta7Akom__callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_takeoff));
}
public void do_FBWA (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_fbwa));
}
public void do_FBWB (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_fbwa));
}
/**
* HOLD, Break is the same ... review Mapping Logic
* @param lo7Ta7akom_callback
*/
public void do_Brake(final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_brake));
}
public void do_Hold(final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_hold));
}
public void do_Cruise (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_cruise));
}
public void do_Auto (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_auto));
}
public void do_Loiter (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_loiter));
}
public void do_RTL (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_rtl));
}
public void do_FollowMe (final double slave_drone_lng,final double slave_drone_lat, final double slave_drone_alt,
final double leader_drone_lng, final double leader_drone_lat, final double leader_drone_alt, final double leader_linear_speed)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_followme));
}
public void do_Smart_RTL(final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_smart_rtl));
}
public void do_FollowMe ()
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_followme));
}
public void do_Guided (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_guided));
}
public void do_Manual (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_manual));
}
public void do_Acro (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_acro));
}
public void do_POS_Hold (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_pos_hold));
}
public void do_ALT_Hold (final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_alt_hold));
}
public void do_CircleHere (final double lng, final double lat, final double altitude, final double radius, final int turns, final IControlBoard_Callback lo7Ta7akom_callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_circle));
}
public void do_FlytoHere (final double lng, final double lat, final double alt,double xVel, double yVel, double zVel, final double yaw, final double yaw_rate)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_guided));
}
public void do_Land (final IControlBoard_Callback ILo7Ta7Akom__callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_land));
}
public void do_Surface (final IControlBoard_Callback ILo7Ta7Akom__callback)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_surface));
}
public void do_Yaw (final double targetAngle, final double turnRate, final boolean isClockwise, final boolean isRelative)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_yaw));
}
public boolean is_RTL() throws Exception {
throw new Exception("Not Implemented Function");
}
public boolean is_MANUAL () throws Exception {
throw new Exception("Not Implemented Function");
}
public boolean is_GUIDED() throws Exception {
throw new Exception("Not Implemented Function");
}
public void do_SetCurrentMission (final int missionItemNumber)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_mission));
}
public void do_ClearHomeLocation()
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_mission));
}
public void do_ClearMission()
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_mission));
}
public void do_SetHomeLocation(final double longitude, final double latitude, final double altitude)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_mission));
}
public void do_SendMission(MohemmaMapBase mohemmaMapBase){
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_mission));
}
public void doPutMissionintoFCB (final String missionText)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_mission_write));
}
public void do_ReadMission()
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_mission));
}
/***
*
* Only Speed is used when calling 3DR .. relative will be used in Andruav layer.
* @param speed -1 means no change .... unit is m/s
* @param isGroundSpeed used only in fixed wings
* @param throttle used in fixed wings and rover - ignored in quadcopter
* @param isRelative
*/
public void do_SetNavigationSpeed (double speed, boolean isGroundSpeed, double throttle, boolean isRelative)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do));
}
public void do_TriggerCamera ()
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_triggercamera));
}
/***
*
* @param pitch in degrees or lat, depending on mount mode
* @param roll in degrees or lon depending on mount mode
* @param yaw in degrees or alt (in cm) depending on mount mode
* @param isAbsolute
*/
public void do_GimbalCtrl (double pitch, double roll, double yaw, boolean isAbsolute)
{
PanicFacade.cannotDoAutopilotAction(AndruavEngine.getPreference().getContext().getString(R.string.andruav_error_autopilot_cannot_do_gimbal));
}