Skip to main content

Realization of flight controler parameter setting function

1. Overview

With the Mobile SDK, you'll be able to set different flight parameters. This tutorial aims to help you gain a basic understanding of how to use aircraft APIs provided by the Mobile SDK.

The procedure for setting camera parameters consists of two steps:

1. Call AutelFlyController or other derived classes through the SDK

2. Set flight parameters Note: The aircraft flight functionality can only be implemented after you integrate the SDK into your device. For details, see SDK guides for beginners.

2. Implement the Functionality

2.1 Obtain the Product Object During SDK Integration

This step is performed during SDK integration. The following code example only shows that the BaseProduct object is obtained from Autel.setProductConnectListener.

Autel.setProductConnectListener(new ProductConnectListener() {
@Override
public void productConnected(BaseProduct product) {
// BaseProduct product
getApplicationContext().setCurrentProduct(product);
}
@Override
public void productDisconnected() {

}
});

2.2 Use the Product Object in Activity

The following sections use the Evo2FlyControllerActivity.java file as an example. The steps of using the product object in other classes are similar.

2.2.1 Convert the Product Object into an Evo2FlyController Instance (mController object)

    private Evo2FlyController mController;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
BaseProduct product = getCurrentProduct();
if (null != product) {
mController = ((Evo2Aircraft) product).getFlyController();
}
if (null == mController) {
setContentView(R.layout.xxxx);
return;
}
}

2.2.2 Call the Method of the mController Object

The following code example shows how to call the activation method of the mController object to activate a device. The way to call other methods of this object is similar.

    /**
* Activates the device
*
* @param view
*/
public void activation(View view) {
mController.activation(new CallbackWithTwoParams<Boolean, String>() {
@Override
public void onSuccess(Boolean data1, String data2) {
logOut("Activate:" + data1 + " message: " + data2);
}

@Override
public void onFailure(AutelError error) {
logOut("Activation failure:" + error.getDescription());
}
});
}

3. Set Parameters:

Setting flight parameters involve many APIs and parameters, which are all listed in the subsequent chapters and sections. For APIs and fields that have already been mentioned, they will not be listed again.

3.1 AutelFlyController.java API

Note: This API is used to control the flight.

/**
* This interface is used to provide flight control functions.
*/

public interface AutelFlyController {
/**
* Sets the listener for the flight control warning state to monitor the real-time data.
* @param listener the listener will be cancelled when the callback is null.
*/
void setWarningListener(CallbackWithTwoParams<ARMWarning, MagnetometerState> listener);

/**
* Sets the listener for calibrating the compass to monitor the real-time data.
* @param listener the listener will be cancelled when the callback is null.
*/
void setCalibrateCompassListener(final CallbackWithOneParam<CalibrateCompassStatus> listener);

/**
* Sets beginner mode so it's either enabled or disabled.
* @param enable whether to enable beginner mode.
* @param callback the callback when set beginner mode to be enabled or disabled.
*/
void setBeginnerModeEnable(boolean enable, CallbackWithNoParam callback);

/**
* Checks if beginner mode is enabled.
* @param callback the callback of turning on/off beginner mode.
*/
void isBeginnerModeEnable(CallbackWithOneParam<Boolean> callback);

/**
* Sets the max altitude for the aircraft.
* @param value the altitude limit, XStar's maximum flight altitude ranges from 30 meters to 800 meters.
* @param callback the callback when set the max altitude for the aircraft.
*/
void setMaxHeight(double value, CallbackWithNoParam callback);

/**
* Gets the max altitude of the aircraft.
* @param callback the callback when get the max altitude of the aircraft.
*/
void getMaxHeight(CallbackWithOneParam<Float> callback);

/**
* Sets the max distance of the aircraft.
* @param value the distance limit, XStar's maximum flight distance ranges from 30 meters to 500 meters.
* @param callback the callback when set the max distance for the aircraft.
*/
void setMaxRange(double value, CallbackWithNoParam callback);

/**
* Gets the max distance of the aircraft.
* @param callback the callback when get the max distance of the aircraft.
*/
void getMaxRange(CallbackWithOneParam<Float> callback);

/**
* Sets the go-home altitude for the aircraft.
* @param value the go home altitude, XStar's go home altitude ranges from 30 meters to 200 meters.
* @param callback the callback when set the go-home altitude for the aircraft.
*/
void setReturnHeight(double value, CallbackWithNoParam callback);

/**
* Gets the go-home altitude of the aircraft.
* @param callback the callback when get the go-home altitude of the aircraft.
*/
void getReturnHeight(CallbackWithOneParam<Float> callback);

/**
* Sets the max horizontal speed for the aircraft.
* 设置无人机最大水平速度。
* @param value the horizontal speed limit, XStar's maximum horizontal speed ranges from 0 m/s to 15 m/s.
* @param callback the callback when set the max horizontal speed for the aircraft.
*/
void setMaxHorizontalSpeed(double value, CallbackWithNoParam callback);

/**
* Gets the horizontal speed limit of the aircraft.
* @param callback the callback when get the horizontal speed limit of the aircraft.
*/
void getMaxHorizontalSpeed(CallbackWithOneParam<Float> callback);

/**
* Sets attitude mode so it's either enabled or disabled..
* @param enable whether to enable attitude mode.
* @param callback the callback when set attitude mode to be enabled or disabled.
*/
void setAttitudeModeEnable(boolean enable, CallbackWithNoParam callback);

/**
* Checks if attitude mode is enabled.
* @param callback the callback of turning on/off attitude mode.
*/
void isAttitudeModeEnable(CallbackWithOneParam<Boolean> callback);

/**
* Sets the LED indicator state located on the aircraft.
* @param lamp the enum of the LED indicator state.
* @param callback the callback when set the LED indicator state located on the aircraft.
*/
void setLedPilotLamp(LedPilotLamp lamp, CallbackWithNoParam callback);

/**
* Gets the LED indicator state located on the aircraft.
* @param callback the callback when get the LED indicator state located on the aircraft.
*/
void getLedPilotLamp(CallbackWithOneParam<LedPilotLamp> callback);

/**
* Starts the compass calibration.
* @param callback the callback when start the compass calibration.
*/
void startCalibrateCompass(CallbackWithOneParam<CalibrateCompassStatus> callback);

/**
* Takes off the aircraft with one press on the remote control.
* Note: it is only available when the aircraft is landed and is in GPS mode.
* @param callback the callback when take off the aircraft with one press on the remote control.
*/
void takeOff(CallbackWithNoParam callback);

/**
* Makes the aircraft go home.
* Note:
* This is available when the aircraft is not landing or landed.
* Also, there must be GPS signal, valid home point, normal compass and running motors.
* @param callback the callback when make the aircraft go home.
*/
void goHome(CallbackWithNoParam callback);

/**
* Land the aircraft..
* Note:
* This is available when the aircraft has taken off.
* @param callback the callback when make the aircraft land descent.
*/
void land(CallbackWithNoParam callback);

/**
* Cancels the land operation.
* Note:
* This is available when the aircraft is landing.
* @param callback the callback when cancel the land operation.
*/
void cancelLand(CallbackWithNoParam callback);

/**
* Cancels the go home operation and make the aircraft hover.
* Note:
* This is only available when the aircraft is in the go home process.
* @param callback the callback when cancel the go home operation and make the aircraft hover.
*/
void cancelReturn(CallbackWithNoParam callback);

/**
* Sets the current aircraft location as the home point.
* Note:
* This is available only if all the following requirements are met:
* The motors are armed, the aircraft is not in any intelligent mode, the aircraft is not returning to the home point, GPS is valid.
* @param callback the callback when set the current aircraft location as the home point.
*/
void setAircraftLocationAsHomePoint(CallbackWithNoParam callback);

/**
* Sets the current phone location as the home point.
* @param lat the latitude value to be set.
* @param lng the longitude value to be set.
* Note:
* This is available only if all the following requirements are met:
* The motors are armed,the aircraft is not in any intelligent mode, the aircraft is not returning to the home point.
* GPS for the aircraft and phone is valid, the distance between the phone and aircraft is within 5000 meters.
* @param callback the callback when set the current phone location as the home point.
*/
void setLocationAsHomePoint(double lat, double lng, CallbackWithNoParam callback);

/**
* Gets the serial number of the aircraft.
* @param callback the callback when get the serial number of the aircraft.
*/
void getSerialNumber(CallbackWithOneParam<String> callback);

/**
* Gets the version information of the aircraft.
* @param callback the callback when get the version information of the aircraft.
*/
void getVersionInfo(CallbackWithOneParam<FlyControllerVersionInfo> callback);

/**
* Returns the parameter range manager of the flight control.
*
* @return the parameter range manager of the flight control.
*/
FlyControllerParameterRangeManager getParameterRangeManager();

/**
* Converts to ReactiveX interface.
*
* @return ReactiveX interface.
*/
RxAutelFlyController toRx();

}

1: ARMWarning

/**
* The warning value of the aircraft.
*/
public enum ARMWarning {
/**
* IMU loss.
*/
IMU_LOSS(0x01, "IMU loss"),
/**
* Critical battery.
*/
CRITICAL_BATTERY(0x02, "Critical battery"),
/**
* Baro loss.
*/
BARO_LOSS(0x03, "Baro loss"),
/**
* Red zone.
*/
RED_ZONE(0x04, "RedZone"),
/**
* IOC error.
*/
IOC_ERROR(0x05, "IOC error"),
/**
* Beginner NO GPS.
*/
BEGINNER_NO_GPS(0x06, "Beginner NO GPS"),
/**
* Disarm tilt over 45deg.
*/
DISARM_TILT_OVER_45DEG(0x07, "Disarm tilt over 45deg"),
/**
* Disarm IMU loss.
*/
DISARM_IMU_LOSS(0x08, " Disarm IMU loss"),
/**
* IMU is warming up.
*/
IMU_IS_WARMING_UP(0x09, "IMU is warming up"),
/**
* Magnetometer is calibrating.
*/
MAGNETOMETER_IS_CALIBRATING(0xA, "Magnetometer is calibrating"),
/**
* Multiple sensors error.
*/
MULTIPLE_SENSORS_ERROR(0xB, "Multiple sensors error"),
/**
* Gimbal is not ready.
*/
GIMBAL_IS_NOT_READY(0xC, "Gimbal is not ready."),
/**
* Upgrade is ongoing.
*/
UPGRADE_IS_GOING(0xD, "upgrade is ongoing."),
/**
* Normal state.
*/
NORMAL(0x00, "normal"),
/**
* Unknown state.
*/
UNKNOWN(-1, "unknown");
}

2: MagnetometerState

/**
* The magnetometer state.
*/
public enum MagnetometerState {
/**
*
* Magnetic interference error, the aircraft is not able to keep the correct course (In ATTITUDE mode).
*/
INTERFERENCE_ATTI(-1,"Magnetic interference error, the aircraft is not able to keep the correct course (In ATTITUDE mode)"),
/**
* No magnetic interference, the aircraft still keeps the correct course.
* <p>(If GPS signal is in good condition, the aircraft can fly in GPS mode)
*/
CORRECT(0,"No magnetic interference, the aircraft still keeps the correct course (If GPS signal is in good condition, the aircraft can fly in GPS mode)"),
/**
* Magnetic interference, the aircraft still keeps the correct course.
* (If GPS signal is in good condition, the aircraft can fly in GPS mode)
*/
INTERFERENCE_CAN_KEEP_RIGHT_DIRECTION(1,"Experience magnetic interference, but the aircraft still keeps the correct course"),
/**
* Get continuous magnetic interference error, the aircraft is going to be unable to keep the correct course.
* (First leftTime warning. If GPS has enough satellites, the aircraft can fly in GPS mode)
*/
INTERFERENCE_WARN_FIRST(2,"Experiencing continuous magnetic interference error, the aircraft is going to be unable to keep the correct course.(First leftTime warning. If GPS has enough satellites, the aircraft can fly in GPS mode)"),
/**
* Get continuous magnetic interference error, the aircraft is going to be unable to keep the correct course.
* (Second leftTime warning)
*/
INTERFERENCE_WARN_SECOND(3, "Experiencing continuous magnetic interference error, the aircraft is going to be unable to keep the correct course (Second leftTime warning)"),

/**
* The magnetometer state is unknown.
*/
UNKNOWN(-2, "unknown");
}

3: CalibrateCompassStatus

/**
* The corresponding status of the compass calibration step.
*/
public enum CalibrateCompassStatus {

/**
*
* Compass calibration has not been triggered.
*/
NORMAL (0),
/**
*
* Start the horizontal calibration.
*/
START_HORIZONTAL (1),
/**
*
* Calculate the horizontal calibration.
*/
HORIZONTAL_CALCULATE (2),
/**
* Start the vertical calibration.
*/
START_VERTICAL (3),
/**
*
* Calculate the vertical calibration.
*/
VERTICAL_CALCULATE (4),
/**
* Lateral rotate
*/
LATERAL_ROTATE(9),
/**
* The calibration is successful.
*/
SUCCESS (5),
/**
*
* Failed to calibrate the compass.
*/
FAILED (6),
/**
*
* No GPS to calibrate the compass.
*/
NO_GPS (7),
/**
* Calibration timeout
*/
TIMEOUT(8),
/**
* Unknown status.
*/
UNKNOWN(-1);
}

LedPilotLamp

/**
* The LED light state.
*/
public enum LedPilotLamp {

/**
* All lights are off.
*/
ALL_OFF(0),
/**
* The front LED lights are off, the rear LED lights are on.
*/
BACK_ONLY(1),
/**
* The front LED lights are on, the rear LED lights are off.
*/
FRONT_ONLY(2),
/**
* All lights are on.
*/
ALL_ON(3),
/**
* Photo-shooting led flicker
*/
TAKE_PHOTO_GLINT(4),
/**
* Recording led flicker
*/
START_RECORD_GLINT(8),
/**
* The LED light state is unknown.
*/
UNKNOWN(-1);
}

4: CalibrateCompassStatus

/**
* The corresponding status of the compass calibration step.
*/
public enum CalibrateCompassStatus {

/**
*
* Compass calibration has not been triggered.
*/
NORMAL (0),
/**
*
* Start the horizontal calibration.
*/
START_HORIZONTAL (1),
/**
*
* Calculate the horizontal calibration.
*/
HORIZONTAL_CALCULATE (2),
/**
* Start the vertical calibration.
*/
START_VERTICAL (3),
/**
*
* Calculate the vertical calibration.
*/
VERTICAL_CALCULATE (4),
/**
* Lateral rotate
*/
LATERAL_ROTATE(9),
/**
* The calibration is successful.
*/
SUCCESS (5),
/**
*
* Failed to calibrate the compass.
*/
FAILED (6),
/**
*
* No GPS to calibrate the compass.
*/
NO_GPS (7),
/**
* Calibration timeout
*/
TIMEOUT(8),
/**
* Unknown status.
*/
UNKNOWN(-1);
}

4: FlyControllerVersionInfo API

/**
* This interface is used to save the fly controller firmware version.
*/

public interface FlyControllerVersionInfo {
/**
* Gets the sonar firmware version.
* @return the sonar firmware version.
*/
String getSonarVersion();

/**
* Gets the optical flow firmware version.
* @return the optical flow firmware version.
*/
String getOpticalFlowVersion();

/**
* Gets the flight control firmware version.
* @return the flight control firmware version.
*/
String getFlyControllerVersion();
}

5: FlyControllerParameterRangeManager API

/**
* The manager of the fly controller parameter range.
*/

public interface FlyControllerParameterRangeManager {
/**
* Gets the range of the maximum height that can be set,
* XStar ranges from 30 meters to 800 meters.
* @return the range of the max height that can be set.
*/
RangePair<Float> getHeightRange();

/**
* Gets the range of the max distance,
* XStar ranges from 30 meters to 10000 meters.
* @return the range of the max distance.
*/
RangePair<Float> getRangeOfMaxRange();
/**
* Gets the range of the horizontal speed.
* XStar ranges from 0 meters/second to 15 meters/second.
* @return the range of the horizontal speed.
*/
RangePair<Float> getHorizontalSpeedRange();

/**
* Gets the range of the go home altitude.
* XStar ranges from 30 meters to 200 meters.
* @return the range of the go home altitude.
*/
RangePair<Float> getReturnHeightRange();


}

6: RxAutelFlyController API

/**
* This interface is used to provide flight control functions.
*/

public interface RxAutelFlyController {

/**
* Sets the listener for the flight control warning state to monitor the real-time data.
* @param listener the listener will be cancelled when the callback is null.
*/
void setWarningListener(CallbackWithTwoParams<ARMWarning, MagnetometerState> listener);

/**
* Sets the listener for calibrating the compass to monitor the real-time data.
* @param listener the listener will be cancelled when the callback is null.
*/
void setCalibrateCompassListener(final CallbackWithOneParam<CalibrateCompassStatus> listener);

/**
* Returns an observable object to set beginner mode.
* @param enable whether to enable beginner mode.
* @return an observable object to set beginner mode.
*/
Observable<Boolean> setBeginnerModeEnable(boolean enable);

/**
* Returns an observable object to check if beginner mode is enabled.
* @return an observable object to check if beginner mode is enabled.
*/
Observable<Boolean> isBeginnerModeEnable();

/**
* Returns an observable object to set the max altitude for the aircraft.
* @param value the max altitude, XStar's maximum flight altitude ranges from 30 meters to 800 meters.XStar
* @return an observable object to set the max altitude for the aircraft.
*/
Observable<Boolean> setMaxHeight(double value);

/**
* Returns an observable object to get the max altitude of the aircraft.
* @return an observable object to get the max altitude of the aircraft.
*/
Observable<Float> getMaxHeight();

/**
* Returns an observable object to set the max distance for the aircraft.
* @param value the max distance, XStar's maximum flight distance ranges from 30 meters to 500 meters.
* @return an observable object to set the max distance for the aircraft.
*/
Observable<Boolean> setMaxRange(double value);

/**
* Returns an observable object to get the max distance of the aircraft.
* @return an observable object to get the max distance of the aircraft.
*/
Observable<Float> getMaxRange();

/**
* Returns an observable object to set the go-home altitude for the aircraft.
* @param value the go home altitude, XStar's go home altitude ranges from 30 meters to 200 meters.
* @return an observable object to set the go-home altitude for the aircraft.
*/
Observable<Boolean> setReturnHeight(double value);

/**
* Returns an observable object to get the go-home altitude of the aircraft.
* @return an observable object to get the go-home altitude of the aircraft.
*/
Observable<Float> getReturnHeight();

/**
* Returns an observable object to set the max horizontal speed for the aircraft.
* @param value the max horizontal speed, XStar's maximum horizontal speed ranges from 0 m/s to 15 m/s.XStar
* @return an observable object to set the max horizontal speed for the aircraft.
*/
Observable<Boolean> setMaxHorizontalSpeed(double value);

/**
* Returns an observable object to get the max horizontal speed of the aircraft.
* @return an observable object to get the max horizontal speed of the aircraft.
*/
Observable<Float> getMaxHorizontalSpeed();

/**
* Returns an observable object to set attitude mode.
* @param enable whether to enable attitude mode.
* @return an observable object to set attitude mode.
*/
Observable<Boolean> setAttitudeModeEnable(boolean enable);

/**
* Returns an observable object to check if attitude mode is enabled.
* @return an observable object to check if attitude mode is enabled.
*/
Observable<Boolean> isAttitudeModeEnable();

/**
* Returns an observable object to set the LED indicator state located on the aircraft.
* @param lamp the enum of the LED indicator state.
* @return an observable object to set the LED indicator state located on the aircraft.
*/
Observable<Boolean> setLedPilotLamp(LedPilotLamp lamp);

/**
* Returns an observable object to get the LED indicator state located on the aircraft.
* @return an observable object to get the LED indicator state located on the aircraft.
*/
Observable<LedPilotLamp> getLedPilotLamp();

/**
* Starts the compass calibration.
* @param callback the callback when start the compass calibration.
*/
void startCalibrateCompass(CallbackWithOneParam<CalibrateCompassStatus> callback);

/**
* Returns an observable object to take off the aircraft with one press on the remote control.
* Note: it is only available when the aircraft is landed and is in GPS mode.
* @return an observable object to take off the aircraft with one press on the remote control.
*/
Observable<Boolean> takeOff();

/**
* Returns an observable object to make the aircraft go home.
* This is available when the aircraft is not landing or landed.
* Also, there must be GPS signal, valid home point, normal compass and running motors.
* @return an observable object to make the aircraft go home.
*/
Observable<Boolean> goHome();

/**
* Returns an observable object to make the aircraft descent and land.
* Note:
* This is available when the aircraft has taken off.
* @return an observable object to make the aircraft descent and land.
*/
Observable<Boolean> land();

/**
* Returns an observable object to cancel the land operation.
* Note:
* This is available when the aircraft is landing.
* @return an observable object to cancel the land operation.
*/
Observable<Boolean> cancelLand();

/**
* Returns an observable object to cancel the go home operation and make the aircraft hover.
* Note:
* This is only available when the aircraft is in the go home process.
* @return an observable object to cancel the go home operation and make the aircraft hover.
*/
Observable<Boolean> cancelReturn();

/**
* Returns an observable object to set the current aircraft location as the home point.
* Note:
* This is available if all the following requirements are met:
* The motors are running, the aircraft is not in any intelligent mode, the aircraft is not returning to the home point, GPS is valid.
* @return an observable object to set the current aircraft location as the home point.
*/
Observable<Boolean> setAircraftLocationAsHomePoint();

/**
* Returns an observable object to set the current phone location as the home point.
* @param lat the latitude value to be set.
* @param lng the longitude value to be set.
* <p/>
* Note:
* This is available if all the following requirements are met:
* The motors are running,the aircraft is not in any intelligent mode, the aircraft is not returning to the home point.
* GPS for the aircraft and phone is valid, the distance between the phone and aircraft is within 5000 meters.
* @return an observable object to set the current phone location as the home point.
*/
Observable<Boolean> setLocationAsHomePoint(double lat, double lng);

/**
* Returns an observable object to get the serial number of the aircraft.
* @return an observable object to get the serial number of the aircraft.
*/
Observable<String> getSerialNumber();

/**
* Returns an observable object to get the version information of the aircraft.
* @return an observable object to get the version information of the aircraft.
*/
Observable<FlyControllerVersionInfo> getVersionInfo();
}

3.2 AutelVisual.java API

/**
* This interface is used to manage visual function in the aircraft, including avoidance and tracking.
*/

public interface AutelVisual {
/**
* Sets the listener for the aircraft warn state to monitor the real-time data.
* @param listener the listener will be cancelled when the callback is null.
*/
void setVisualWarnListener(CallbackWithOneParam<VisualWarningInfo> listener);

/**
* Sets the listener for the aircraft radar information to monitor the real-time data.
* @param listener the listener will be cancelled when the callback is null.
*/
void setAvoidanceRadarInfoListener(CallbackWithOneParam<AvoidanceRadarInfo> listener);

/**
* Sets the listener for the visual setting info to monitor the real-time data.
* @param listener the listener will be cancelled when the callback is null.
*/
void setVisualSettingInfoListener(CallbackWithOneParam<VisualSettingInfo> listener);

/**
* Sets the listener for the Viewpoint Coordinate to monitor the real-time data.
* @param listener the listener will be cancelled when the callback is null.
*/
void setViewpointInfoListener(CallbackWithOneParam<ViewPointTargetArea> listener);

/**
* Sets the visual setting item to be enabled or disabled.
* @param switchblade the visual setting switch.
* @param enable whether to enable the visual setting.
* @param callback the callback when set the visual setting items to be enabled or disabled.
*/
void setVisualSettingEnable(VisualSettingSwitchblade switchblade, boolean enable, CallbackWithNoParam callback);

/**
* @param switchblade VisualSettingSwitchblade value to be set.
* @param callback
*/
void setVisualSettingParams(VisualSettingSwitchblade switchblade, int type, CallbackWithNoParam callback);

/**
* Gets the visual setting information.
* @param callback the callback when get the visual setting item information.
*/
void getVisualSettingInfo(CallbackWithOneParam<VisualSettingInfo> callback);

/**
* Sets the mode of Dynamic Track.
* @param followMode the mode of Dynamic Track.
* @param callback the callback when set the mode of Dynamic Track.
*/
void setVisualFollowMode(DynamicTrackMode followMode, CallbackWithNoParam callback);

/**
* Sets the coordinate for Viewpoint.
* @param x raster No.x in horizontal.
* @param y Raster No.y in vertical.
* @param pitch The angle of the gimbal in pitch.
* @param callback the callback when set the coordinate for Viewpoint.
*/
void setVisualViewPointCoordinate(float x, float y, float pitch, CallbackWithNoParam callback);


/**
* Sets the speed for Viewpoint.
* @param speed the speed of Viewpoint.
* @param callback the callback when set the speed for Viewpoint.
*/
void setVisualViewPointSpeed(float speed, CallbackWithNoParam callback);

void setVisualDigitalZoom(int factor, CallbackWithNoParam callback);

/**
* Updates the visual resolution angle.
* @param callback the callback when set the visual resolution angle.
*/
void updateVisualResolutionAngle(CallbackWithNoParam callback);
}

3.2.1 VisualWarningInfo API

/**
* The visual warning information.
*/

public interface VisualWarningInfo {
/**
* Gets the warning state.
* @return the warning state.
*/
VisualWarnState getWarnState();

/**
* Tells whether the visual warning information is valid or not.
* @return the visual warning information is valid or not.
*/

boolean isValid();
}
3.2.1.1:VisualWarnState
/**
* The warning state of the visual system.
*/

public enum VisualWarnState {
/**
* The Failsafe mode is enabled.
*/
FAIL_SAFE(21),
/**
* The ambient light is too low.
*/
ILLUMINATION_DIM(22),
/**
* The ambient light is too bright.
*/
ILLUMINATION_DAZZLING(23),
/**
* The optical flow module is invalid.
*/
OPTICAL_FLOW_INVALIDATE(24),
/**
* The operation has been cancelled by the remote controller.
*/
USER_CANCEL(25),
/**
* The target is missing.
*/
TRACK_TARGET_MISS(26),
/**
* The aircraft is moving around obstacles.
*/
PASSING_AROUND(27),
/**
* Unable to avoid obstacles, the aircraft will hover(The aircraft only can change the direction but not be able to move forward or backward).
*/
UNABLE_PASSING_AROUND_AND_LOCK(28),
/**
* The current altitude is too low; increase the flight altitude.
*/
ADJUST_ALTITUDE(29),
/**
* The aircraft has reached the minimum tracking distance.
*/
DRONE_ARRIVE_MIN_DISTANCE(30),

/**
* The aircraft has reached the maximum tracking distance.
*/
DRONE_ARRIVE_MAX_DISTANCE(31),
/**
* The aircraft has reached the maximum tracking altitude.
*/
DRONE_ARRIVE_MAX_HEIGHT(32),
/**
* The aircraft has reached the minimum tracking altitude.
*/
DRONE_ARRIVE_MIN_HEIGHT(33),
/**
* The tracking target is shaking forward or backward.
*/
TRACKING_FONT_BACK_ROCK(34),
/**
* The unknown error during the tracking.
*/
TRACKING_UNKNOWN_ERROR(35),
/**
* Obstacles detected in the front, carefully limiting the speed.
*/
TRACKING_LIMIT_SPEED(36),
/**
* No way ahead, manual operations required.
*/
TRACKING_MOVE_OTHER_WAY(37),

/**
* Obstacles detected in the rear; the aircraft will hover.
*/
REAR_OBSTACLE_DETECTED(38),

/**
* The visual task has been already paused.
*/
PAUSE_VISUAL_TASK(39),

/**
* Exit the visual task.
*/
EXIT_VISUAL_TASK(40),
/**
* Fly over.
*/
FLY_OVER(41),
/**
* Fly to the left.
*/
LEFT_AROUND(42),
/**
* Fly to the right.
*/
RIGHT_AROUND(43),
/**
* Reach max. distance
*/
ARRIVE_DISTANCE(44),
/**
* Reach max. height
*/
ARRIVE_HEIGHT(45),

/**
* The aircraft is landing; the visual obstacle avoidance is disabled.
*/
START_LADING(46),
/**
* Unable to land because of the unsafe environment.
*/
HAVE_BLOCK(47),
/**
* Unknown obstacles are detected; check the landing environment.
*/
UNKNOWN_OBSTACLE(48),
/**
* Safe to land because of the flat and level ground.
*/
SAFE_LANDING(49),
/**
* Accurate landing, correct the landing location.
*/
ACCURATE_LANDING_REPAIRING(50),
/**
* Safe environment, the aircraft can land.
*/
ENVIRONMENT_SAFE_LANDING(51),

/**
* Move to the safe area to land the aircraft.
*/
MOVE_TO_SAFE_LANDING(52),
/**
* The aircraft landing is canceled by user.
*/
LANDING_CANCEL_BY_USER(53),
/**
* Insufficient safe space, cannot pass
*/
SAFE_SPACE_NOT_ENOUGH(54),
/**
* Move the aircraft to an open area and try again.
*/
MOVE_SAFE_SPACE_TRY_AGAIN(55),
/**
* Visual module abnormal, need to reboot aircraft.
*/
VISUAL_NEED_REBOOT(56),

/**
* The downward vision system parameters are abnormal, Accurate Landing and Landing Protection functions will be affected.
*/
DOWNWARD_VISION_EXCEPTION(60),
/**
* The forward vision system parameters are abnormal.
*/
FONT_SENOR_PARAM_EXCEPTION(61),
/**
* The forward vision modules are abnormal.
*/
FONT_MODEL_EXCEPTION(62),
/**
* The downward vision modules are abnormal.
*/
DOWNWARD_VISION_ABNORMAL(63),
/**
* The forward vision modules and downward vision modules are both abnormal.
*/
FONT_BELOW_BOTH_MODEL_EXCEPTION(64),
/**
* Front visual calibration abnormal
*/
FONT_VISUAL_MODEL_EXCEPTION(65),
/**
* Rear visual calibration abnormal
*/
BACKWARD_VISUAL_MODEL_EXCEPTION(66),
/**
* Downward visual calibration abnormal
*/
DOWNWARD_VISUAL_MODEL_EXCEPTION(67),
/**
* Right visual calibration abnormal
*/
RIGHT_VISUAL_MODEL_EXCEPTION(68),
/**
* Left visual calibration abnormal
*/
LEFT_VISUAL_MODEL_EXCEPTION(69),
/**
* Upward visual calibration abnormal
*/
TOP_VISUAL_MODEL_EXCEPTION(70),
/**
* Multiple visual calibration abnormal
*/
MORE_VISUAL_MODEL_EXCEPTION(71),
/**
* The aircraft has reached the max. height can be tracked
*/
VISUAL_ARRIVE_MAX_HEIGHT(72),
/**
* The aircraft has reached the min. height can be tracked
*/
VISUAL_ARRIVE_MIN_HEIGHT(73),
/**
* The aircraft has reached the min. range can be tracked
*/
VISUAL_ARRIVE_MAX_ZOOM(74),
/**
* The aircraft has reached the max. range can be tracked
*/
VISUAL_ARRIVE_MIN_ZOOM(75),
/**
* Viewpoint flight stopped
*/
VISUAL_STOP_VIEW_POINT(76),
/**
* ATTI Mode, visual function cannot use.
*/
VISUAL_ATTI_MODE(77),
/**
* Exit visual mission
*/
VISUAL_EXIT_BUTTON(78),
/**
* Excessive magnetic flight direction deviation, current visual mission exits
*/
VISUAL_TRACK_EXCEPTION(79),
/**
* The warning state is unknown.
*/
UNKNOWN(-1);
}

3.2.2 AvoidanceRadarInfo API

/**
* The information of the avoidance radar.
* When the value is 65535, it means that the current value is invalid; 65534 means that the current light is dim and the value is invalid
* For EVO: getRear()[0] means rear view TOF data
*/

public interface AvoidanceRadarInfo {

long getTimeStamp();
/**
* Gets the front visual system information. Values from array index 0 to
* index 3 indicate the TOF values. 0 is the initial value; 65535 indicates no obstacles;
* 65534 indicates the light is too weak, unable to get accurate data.
* @return the front visual system information.
*/
float[] getFront();

/**
* Gets the rear visual system information. Value from array index 0 indicates the TOF value for rear
* radar sensor. 0 is the initial value; 65534 indicates the light is too weak, unable to get accurate
* data.
* @return the rear visual system information.
*/
float[] getRear();

/**
* Gets the left visual system information.
* @return the left visual system information.
*/
float[] getLeft();

/**
* Gets the right visual system information.
* @return the right visual system information.
*/
float[] getRight();
/**
* Gets obstacle info of the upward sight direction
*/
float[] getTop();
/**
* Gets obstacle info of the downward sight direction
*/
float[] getBottom();

}
3.2.2.1:VisualSettingInfo
/**
* Tells whether the visual setting item is working.
*/
public interface VisualSettingInfo {
/**
* Tells whether or not the avoidance system is enabled.
* @return true to enable the avoidance system, false to disable the avoidance system.
*/
boolean isAvoidanceSystemEnable();

/**
* Tells whether or not the obstacle avoidance function is enabled during the tracking.
* @return true to enable the obstacle avoidance function, false to disable the obstacle avoidance function.
*/

boolean isAvoidanceEnableWhenTracking();

/**
* Tells whether or not the radar map is enabled.
* @return true to enable the radar map, false to disable the radar map.
*/

boolean isRadarMapEnable();

/**
* Tells whether or not the backward flying is enabled during the tracking.
* @return true to enable the backward flying, false to disable the backward flying.
*/
boolean isPullBackEnableWhenTracking();

/**
* Tells whether or not the landing protection function is enabled.
* @return true to enable the landing protection function, false to disable the landing protection function.
*/

boolean isLandingProtectEnable();

/**
* Tells whether or not the visual positioning is enabled.
* @return true to enable the visual positioning, false to disable the visual positioning.
*/

boolean isVisualLocationEnable();

/**
* Tells whether or not the obstacle detection function is enabled when the aircraft returns to home.
* @return true to enable the obstacle detection function, false to disable the obstacle detection function.
*/

boolean isDetectObstacleEnableWhenReturn();

/**
* Tells whether or not the accurate landing function is enabled.
* @return true to enable the accurate landing function, false to disable the accurate landing function.
*/

boolean isLandingAccuratelyEnable();

/**
* Tells whether or not the horizontal obstacle avoidance function is enabled.
* @return true to enable the horizontal obstacle avoidance function, false to disable the horizontal obstacle avoidance function.
*/

boolean isAvoidInHorizontal();

/**
* Gets the Dynamic Track mode.
* @return the Dynamic Track mode.
*/

DynamicTrackMode getFollowMode();

/**
* Gets the state of the main visual flight mode.
* @return the state of the main visual flight mode.
*/
VisualMainFlyState getVisualMainFlyState();

/**
* Gets the visual warning state.
* @return the visual warning state.
*/
VisualWarnState getVisualWarnState();

/**
* Gets the visual orbit state.
* @return
*/
OrbitModeState getOrbitModeState();

/**
* Tells whether to enable the image mode.
* @return true to enable the image mode, false to disable the image mode.
*/
boolean isImageMode();

/**
* Tells whether visual function is ready.
* @return Tells whether visual function is ready.
*/
boolean isVisualReady();

/**
* Tells whether to enable the calibration mode.
* @return true to enable the calibration mode, false to disable the calibration mode.
*/
boolean isCalibrationMode();

/**
* Tells whether to enable the Viewpoint mode.
* @return true to enable the Viewpoint mode, false to disable the Viewpoint mode.
*/
boolean isPointFlyMode();

/**
* Tells whether to enable the Viewpoint mode inside.
* @return true to enable the Viewpoint mode inside, false to disable the Viewpoint mode inside.
*/
boolean isPointFlyInsideMode();

/**
* Tells whether to enable the gesture recognition mode.
* @return true to enable the gesture recognition mode, false to disable the gesture recognition mode.
*/
boolean isGestureRecognizationMode();

/**
* Tells whether visual function is limited by bad environment
*/
boolean isVisualLimitWhenDark();
/**
* Front left visual sensor abnormal
*/
boolean isVisualLeftFontState();
/**
* Front right visual sensor abnormal
*/
boolean isVisualRightFontState();
/**
* Rear left visual sensor abnormal
*/
boolean isVisualLeftNearState();
/**
* Rear right visual sensor abnormal
*/
boolean isVisualRightNearState();
/**
* Downward left visual sensor abnormal
*/
boolean isVisualLeftBottomState();
/**
* Downward right visual sensor abnormal
*/
boolean isVisualRightBottomState();
/**
* Left right visual sensor abnormal
*/
boolean isVisualLeftRightState();
/**
* Right right visual sensor abnormal
*/
boolean isVisualRightRightState();
/**
* Left left visual sensor abnormal
*/
boolean isVisualLeftLeftState();
/**
* Right left visual sensor abnormal
*/
boolean isVisualRightLeftState();
/**
* Upward left visual sensor abnormal
*/
boolean isVisualLeftTopState();
/**
* Upward right visual sensor abnormal
*/
boolean isVisualRightTopState();
/**
* Front left visual sensor abnormal
*/
boolean isVisualCalibrationValid();
/**
* Current visual tracking status
*/
VisualTrackState getVisualTrackState();
/**
* Gets current downward visual led status
*/
AuxiliaryLedState getAuxiliaryLedState();

/**
* Gets the viewpoint speed.
* @return The viewpoint speed.
*/
int getSpeed();
}
1: DynamicTrackMode
/**
* The mode of Dynamic Track.
*/

public enum DynamicTrackMode {
/**
* The Dynamic Track mode is stop.
*/
STOP_MODE(0),
/**
* The Dynamic Track mode is following mode.
*/
COMMON_MODE(1),
/**
* The Dynamic Track mode is parallel.
*/
PARALLEL_MODE(2),
/**
* The Dynamic Track mode is tripod.
*/
LOCKED_MODE(3),
/**
* The Dynamic Track mode is unknown.
*/
UNKNOWN(-1);
}
2: VisualMainFlyState
/**
* Visual main flight status
*/

public enum VisualMainFlyState {
FAULT(0),
NORMAL(1),
PAUSE(2),
UNKNOWN(-1);
}
3: VisualWarnState
/**
* The warning state of the visual system.
*/

public enum VisualWarnState {
/**
* The Failsafe mode is enabled.
*/
FAIL_SAFE(21),
/**
* The ambient light is too low.
*/
ILLUMINATION_DIM(22),
/**
* The ambient light is too bright.
*/
ILLUMINATION_DAZZLING(23),
/**
* The optical flow module is invalid.
*/
OPTICAL_FLOW_INVALIDATE(24),
/**
* The operation has been cancelled by the remote controller.
*/
USER_CANCEL(25),
/**
* The target is missing.
*/
TRACK_TARGET_MISS(26),
/**
* The aircraft is moving around obstacles.
*/
PASSING_AROUND(27),
/**
* Unable to avoid obstacles, the aircraft will hover(The aircraft only can change the direction but not be able to move forward or backward).
*/
UNABLE_PASSING_AROUND_AND_LOCK(28),
/**
* The current altitude is too low; increase the flight altitude.
*/
ADJUST_ALTITUDE(29),
/**
* The aircraft has reached the minimum tracking distance.
*/
DRONE_ARRIVE_MIN_DISTANCE(30),

/**
* The aircraft has reached the maximum tracking distance.
*/
DRONE_ARRIVE_MAX_DISTANCE(31),
/**
* The aircraft has reached the maximum tracking altitude.
*/
DRONE_ARRIVE_MAX_HEIGHT(32),
/**
* The aircraft has reached the minimum tracking altitude.
*/
DRONE_ARRIVE_MIN_HEIGHT(33),
/**
* The tracking target is shaking forward or backward.
*/
TRACKING_FONT_BACK_ROCK(34),
/**
* The unknown error during the tracking.
*/
TRACKING_UNKNOWN_ERROR(35),
/**
* Obstacles detected in the front, carefully limiting the speed.
*/
TRACKING_LIMIT_SPEED(36),
/**
* No way ahead, manual operations required.
*/
TRACKING_MOVE_OTHER_WAY(37),

/**
* Obstacles detected in the rear; the aircraft will hover.
*/
REAR_OBSTACLE_DETECTED(38),

/**
* The visual task has been already paused.
*/
PAUSE_VISUAL_TASK(39),

/**
* Exit the visual task.
*/
EXIT_VISUAL_TASK(40),
/**
* Fly over.
*/
FLY_OVER(41),
/**
* Fly to the left.
*/
LEFT_AROUND(42),
/**
* Fly to the right.
*/
RIGHT_AROUND(43),
/**
* Reach max. distance
*/
ARRIVE_DISTANCE(44),
/**
* Reach max. height
*/
ARRIVE_HEIGHT(45),

/**
* The aircraft is landing; the visual obstacle avoidance is disabled.
*/
START_LADING(46),
/**
* Unable to land because of the unsafe environment.
*/
HAVE_BLOCK(47),
/**
* Unknown obstacles are detected; check the landing environment.
*/
UNKNOWN_OBSTACLE(48),
/**
* Safe to land because of the flat and level ground.
*/
SAFE_LANDING(49),
/**
* Accurate landing, correct the landing location.
*/
ACCURATE_LANDING_REPAIRING(50),
/**
* Safe environment, the aircraft can land.
*/
ENVIRONMENT_SAFE_LANDING(51),

/**
* Move to the safe area to land the aircraft.
*/
MOVE_TO_SAFE_LANDING(52),
/**
* The aircraft landing is canceled by user.
*/
LANDING_CANCEL_BY_USER(53),
/**
* Insufficient safe space, cannot pass
*/
SAFE_SPACE_NOT_ENOUGH(54),
/**
* Move the aircraft to an open area and try again.
*/
MOVE_SAFE_SPACE_TRY_AGAIN(55),
/**
* Visual module abnormal, need to reboot aircraft.
*/
VISUAL_NEED_REBOOT(56),

/**
* The downward vision system parameters are abnormal, Accurate Landing and Landing Protection functions will be affected.
*/
DOWNWARD_VISION_EXCEPTION(60),
/**
* The forward vision system parameters are abnormal.
*/
FONT_SENOR_PARAM_EXCEPTION(61),
/**
* The forward vision modules are abnormal.
*/
FONT_MODEL_EXCEPTION(62),
/**
* The downward vision modules are abnormal.
*/
DOWNWARD_VISION_ABNORMAL(63),
/**
* The forward vision modules and downward vision modules are both abnormal.
*/
FONT_BELOW_BOTH_MODEL_EXCEPTION(64),
/**
* Front visual calibration abnormal
*/
FONT_VISUAL_MODEL_EXCEPTION(65),
/**
* Rear visual calibration abnormal
*/
BACKWARD_VISUAL_MODEL_EXCEPTION(66),
/**
* Downward visual calibration abnormal
*/
DOWNWARD_VISUAL_MODEL_EXCEPTION(67),
/**
* Right visual calibration abnormal
*/
RIGHT_VISUAL_MODEL_EXCEPTION(68),
/**
* Left visual calibration abnormal
*/
LEFT_VISUAL_MODEL_EXCEPTION(69),
/**
* Upward visual calibration abnormal
*/
TOP_VISUAL_MODEL_EXCEPTION(70),
/**
* Multiple visual calibration abnormal
*/
MORE_VISUAL_MODEL_EXCEPTION(71),
/**
* The aircraft has reached the max. height can be tracked
*/
VISUAL_ARRIVE_MAX_HEIGHT(72),
/**
* The aircraft has reached the min. height can be tracked
*/
VISUAL_ARRIVE_MIN_HEIGHT(73),
/**
* The aircraft has reached the min. range can be tracked
*/
VISUAL_ARRIVE_MAX_ZOOM(74),
/**
* The aircraft has reached the max. range can be tracked
*/
VISUAL_ARRIVE_MIN_ZOOM(75),
/**
* Viewpoint flight stopped
*/
VISUAL_STOP_VIEW_POINT(76),
/**
* ATTI Mode, visual function cannot use.
*/
VISUAL_ATTI_MODE(77),
/**
* Exit visual mission
*/
VISUAL_EXIT_BUTTON(78),
/**
* Excessive magnetic flight direction deviation, current visual mission exits
*/
VISUAL_TRACK_EXCEPTION(79),
/**
* The warning state is unknown.
*/
UNKNOWN(-1);
}
4: OrbitModeState
/**
* The warning state of the visual system.
*/

public enum OrbitModeState {
/**
* Idle
*/
IDLE(0),
/**
* In detection
*/
DETECTION(1),
/**
* In orbit tracking
*/
TRACKING(2),
/**
* The warning state is unknown.
*/
UNKNOWN(-1);
}
5: VisualTrackState
/**
* The warning state of the visual system.
*/

public enum VisualTrackState {
/**
* Visual tracking disable.
*/
IDLE(0),
/**
* Visual target detecting.
*/
DETECTION(1),
/**
* Visual target tracking.
*/
TRACKING(2),
/**
* The warning state is unknown.
*/
UNKNOWN(-1);
}
6: AuxiliaryLedState
/**
* The warning state of the visual system.
*/

public enum AuxiliaryLedState {
/**
* Disabled
*/
OFF(0),
/**
* Enabled
*/
OPEN(1),
/**
* Automatic
*/
AUTO(2),
/**
* Flashes every 1 second
*/
FLASHING_MODE_1(3),
/**
* Flashes every 2 seconds
*/
FLASHING_MODE_2(4),
/**
* The warning state is unknown.
*/
UNKNOWN(-1);
}

3.2.3 ViewPointTargetArea API

/**
* The target area of Viewpoint.
*/

public class ViewPointTargetArea {
/**
* The flight mode of Viewpoint (including the indoors and outdoors).
*/
public int flightMode;
/**
* The ratio of the X coordinate value of the current point on Viewpoint screen to the maximum X coordinate value of the screen
*/
public float xRatio;
/**
* The ratio of the Y coordinate value of the current point on Viewpoint screen to the maximum Y coordinate value of the screen
*/
public float yRatio;
/**
* Top sight line of the gimbal under Viewpoint flight
*/
public float topLine;
/**
* Horizontal sight line of the gimbal under Viewpoint flight
*/
public float horizonLine;
/**
* Bottom sight line of the gimbal under Viewpoint flight
*/
public float bottomLine;
/**
* The Viewpoint flight is going on.
*/
public int pointFlyOnGoing;
}

3.2.4 VisualSettingSwitchblade

/**
* This enum contains the switch status of the visual settings.
*/
public enum VisualSettingSwitchblade {

/**
* Obstacle avoidance function.
*/
AVOIDANCE_SYSTEM(0x01),

/**
* Move left or right to avoid the obstacles.
*/
VIEWPOINT_AVOIDANCE(0x03),

/**
* Avoid the obstacles automatically during the tracking.
*/
TRACKING_AVOIDANCE(0x04),

/**
* Show the radar map of the avoidance.
*/
RADAR_MAP(0x05),

/**
* Move backwards during the tracking.
*/
TRACKING_PULL_BACK(0x06),

/**
* Use radar, obstacle avoidance to protect the aircraft during the landing.
*/
LANDING_PROTECT(0x07),

/**
* The Go-Home Obstacle Detection switch.
*/
RETURN_TO_HOME_AVOIDANCE(0x08),
/**
* The location of the visual function.
*/
VISUAL_LOCATION(0x09),
/**
* The aircraft will land as close as possible to the take-off point.
*/
LANDING_ACCURATELY(0x0A),
/**
* Set the viewpoint coordinate.
*/
SET_VIEW_POINT_COORD(0x0B),
/**
* Set the viewpoint speed.
*/
SET_VIEW_POINT_SPEED(0x0C),
/**
* Start or stop the viewpoint mission.
*/
VIEW_POINT_FLIGHT_TASK(0x0D),
/**
* Set the GESTURE mode.
*/
GESTURE_RECOGNITION_MODE(0x13),
/**
* Set the viewpoint mode.
*/
VIEW_POINT_FLIGHT_MODE(0x15),
/**
* Force to land the aircraft.
*/
FORCE_LANDING(0x17),
/**
* Rotate the aircraft direction.
*/
TRACKING_AIRCRAFT_ROTATE(0x18),
/**
* Set the Dynamic Track mode.
*/
VISUAL_TRACKING_MODE(0x0F),
/**
* Set the RESOLUTION ANGLE.
*/
VISUAL_SET_RESOLUTION_ANGLE(0x19),
/**
* Visual SOA switch
*/
VISUAL_SOA(0x20),
/**
* Visual flight mission suspended
*/
VISUAL_PAUSE_TASK(0x1A),
/**
* Visual tracking
*/
VISUAL_TRACKING(0x1B),
/**
* Set up visual tracking area
*/
VISUAL_TRACKING_AREA(0x1C),
/**
* Visual bottom led
*/
VISUAL_BOTTOM_LED(0x1D),
/**
* Adjust height
*/
VISUAL_ADJUST_HEIGHT(0x21),
/**
* Adjust zoom
*/
VISUAL_ADJUST_ZOOM(0x22),
/**
* Control controller rotate
*/
VISUAL_CONTROLLER_ROTATE(0x23),
/**
* Visual orbit mode
*/
VISUAL_ORBIT_MODEL(0x24),
/**
* Target object coordinate setting in visual orbit mode
*/
VISUAL_ORBIT_MODEL_TARGET(0x25),
/**
* Parameter (height, radius, speed) setting in visual orbit mode
*/
VISUAL_ORBIT_MODEL_HEIGHT_RADIUS(0x26),
/**
* Reset yaw in visual orbit mode
*/
VISUAL_ORBIT_MODEL_RESET_YAW(0x27),
/**
* Adjust zoom in visual orbit mode
*/
VISUAL_DIGITAL_ZOOM(0x28),
/**
* Adjust speed in visual orbit mode
*/
VISUAL_ADJUST_SPEED(0x29),
/**
* Unknown state.
*/
UNKNOWN(-1);
}

3.2.5 DynamicTrackMode

/**
* The mode of Dynamic Track.
*/

public enum DynamicTrackMode {
/**
* The Dynamic Track mode is stop.
*/
STOP_MODE(0),
/**
* The Dynamic Track mode is following mode.
*/
COMMON_MODE(1),
/**
* The Dynamic Track mode is parallel.
*/
PARALLEL_MODE(2),
/**
* The Dynamic Track mode is tripod.
*/
LOCKED_MODE(3),
/**
* The Dynamic Track mode is unknown.
*/
UNKNOWN(-1);
}

3.3 Evo2Visual.java API

Note: This API is used to manage visual functionalities, including avoiding obstacles and tracking. This API is inherited from the AutelVisual.java API (which will be detailed later).

/**
* This interface is used to manage visual function in the aircraft, including avoidance and tracking.
*/

public interface Evo2Visual extends AutelVisual {


/**
* Sets the tracking mode
*
* @param trackingAction TrackingAction value to be set
* @param callback the callback when set tracking mode.
*/
void setTrackingMode(TrackingAction trackingAction, CallbackWithNoParam callback);

/**
* Detected object info submit
*
* @param callback the listener will be cancelled when the callback is null.
*/
void setTrackingTargetListener(CallbackWithTwoParams<List<TrackingGoalArea>, Boolean> callback);

/**
* Listens for the event of revolving around a target area using Visual Intelligence.
*/
void setOrbitTargetListener(CallbackWithOneParam<TrackTargetArea> callback);

/**
* Set Viewpoint action (including enter, pause, stop, exit)
*
* @param action ViewpointAction value to be set.
* @param callback the callback when set Viewpoint action (including enter, pause, stop, exit).
*/
void setViewpointAction(ViewpointAction action, CallbackWithNoParam callback);


/**
* @param x raster No.x in horizontal.
* @param y Raster No.y in vertical.
* @param callback the callback when set the coordinate for Viewpoint.
*/
void setVisualViewPointCoordinate(float x, float y, CallbackWithNoParam callback);

/**
* Set camera resolution of Viewpoint flight
*/
void setVisualResolution();

}

3.3.1 TrackingAction

/**
* Several states of tracking action
*/
public enum TrackingAction {
EXIT(0),
ENTER(1),
STOP(2),
/**
* The current tracking status is unknown.
*/
UNKNOWN(-1);
}

3.3.2 TrackingGoalArea API

/**
* The area data of the tracking target.
*/
public interface TrackingGoalArea {

/**
* Gets the specific ID of the tracking target.
* @return the specific ID of the tracking target.
*/
int getId();

/**
* Gets the No.X of the tracking point, which is located in the top left corner of the tracking rectangle.
* @return the No.X of the tracking point.
*/
float getAreaXRatio();

/**
* Gets the No.Y of the tracking point, which is located in the top left corner of the tracking rectangle.
* @return the No.Y of the tracking point.
*/
float getAreaYRatio();

/**
* Gets the width of the tracking area.
* @return the width of the tracking area.
*/
float getWidthRatio();

/**
* Gets the height of the tracking area.
* @return the height of the tracking area.
*/
float getHeightRatio();

int getStatus();

float getDistance();

/**
* Target type
*/
TargetType getTargetType();

/**
* Recognition accuracy
* @return Recognition accuracy
*/
float getConfidence();

/**
* Target info
* @return Target info
*/
List<Integer> getTargetInfo();

/**
* Target object
* @return Target object
*/
int getObjId();

/**
* Gets the current time stamp.
* @return the current time stamp.
*/
long getTimestamp();
}
1: TargetType
/**
* Target 0:Background 1:Animal 2:Boat 3:Car 4:Person 5:Rider 6:Vehicle
* 7:DetectAndSelectPerson 8:Take_Photo 9:StartOrStopRecording 10:VehicleLP 11:LicensePlate
*/

public enum TargetType {
/**
* Background
*/
Background(0),
/**
* Animal
*/
Animal(1),
/**
* Boat
*/
Boat(2),
/**
* Car
*/
Car(3),
/**
* Person
*/
Person(4),
/**
* Rider
*/
Rider(5),
/**
* Vehicle
*/
Vehicle(6),
/**
* Gesture detected, lock target or unlock target.
*/
DetectAndSelectPerson(7),
/**
* Photo gesture
*/
Take_Photo(8),
/**
* Start or stop recording gesture
*/
StartOrStopRecording(9),
/**
* Detected vehicle with license plate
*/
VehicleLP(10),
/**
* license plate
*/
LicensePlate(11),
/**
* The current tracking status is unknown.
*/
UNKNOWN(-1);
}

3.3.3 TrackTargetArea

/**
* The data of the target.
*/
public class TrackTargetArea extends TargetArea {

/**
* The state of tracking
*/
public TrackingState trackingState;
/**
* Timestamp
*/
public long timeStamp;

}
1: TrackingState
public enum TrackingState {
FAILED(0),
SUCCESS(1),
STOP(3),
LOW_CREDIBILITY(5),
NO_SIGNIFICANT_GOAL(8),
/**
* The current tracking status is unknown.
*/
UNKNOWN(-1);
}

3.3.4 ViewpointAction

public enum ViewpointAction {
EXIT(0),
ENTER(1),
PAUSE(2),
STOP(3),
/**
* The current tracking status is unknown.
*/
UNKNOWN(-1);
}

3.4 Evo2FlyController.java API

/**
* This interface is used to provide flight control functions for EVO.
*/
public interface Evo2FlyController extends AutelFlyController, Evo2Visual {

/**
* Listens for the reported status of the time-lapse photography mission
* @param infoListener
*/
void setTimelapseStatusListener(CallbackWithOneParam<TimelapseMissionInfo> infoListener);

/**
* Listens for the reported GGA data
* @param infoListener
*/
void setRtkGGAListener(CallbackWithOneParam<byte[]> infoListener);
/**
* Listens for the reported RTK information
* @param infoListener the listener will be cancelled when the callback is null.
*/
void setRtkInfoListener(CallbackWithOneParam<RTKInternal> infoListener);

/**
* Listens for the reported mission breakpoint
* @param infoListener the listener will be cancelled when the callback is null.
*/
void setBreakPointMissionListener(CallbackWithOneParam<RealTimeInfo> infoListener);


/**
* Sets the listener for the flight control to monitor the real-time data.
*
* @param listener the listener will be cancelled when the callback is null.
*/
void setFlyControllerInfoListener(final CallbackWithOneParam<EvoFlyControllerInfo> listener);

/**
*
* Sets the listener for the flight control to monitor parameter variation
* @param listener the listener will be cancelled when the callback is null
*/
void setFlyControllerParameterChangedListener(final CallbackWithTwoParams<FmuParameterEvent, Float> listener);

// /**
// * Sets the landing gear state for the aircraft.
// * @param landingGearState the state of the landing gear.
// * @param callbackWithOneParam the callback when set the landing gear state for the aircraft.
// */
// void setLandingGearState(LandingGearState landingGearState, CallbackWithNoParam callbackWithOneParam);

/**
* Changes the aircraft to the arm mode.
*
* @param callback the callback when change the aircraft to the arm mode.
*/
void droneArmed(CallbackWithNoParam callback);

/**
* Changes the aircraft to the disarm mode.
*
* @param callback the callback when change the aircraft to the disarm mode.
*/
void droneDisarmed(CallbackWithNoParam callback);

/**
* Returns the parameter range manager of the flight control.
*
* @return the parameter range manager of the flight control.
*/
EvoFlyControllerParameterRangeManager getParameterRangeManager();

/**
* Set aircraft heading direction
* direct -100 ~ 100 negative number indicates counterclockwise rotation speed; positive number indicates clockwise rotation speed
* Sets aircraft heading di
* @param direct Range from -100 to 100, 0 indicates front, negative number indicates counterclockwise rotation speed; positive number indicates clockwise rotation speed
* @param callback the callback when set heading direction for the aircraft.
*/
void setAircraftHeadingDirection(int direct, CallbackWithNoParam callback);

/**
* Set Takeoff mode
*
* @param boatMode the enum values of the BoatMode
*/
void setBoatMode(BoatMode boatMode, CallbackWithNoParam callback);
/**
* get Boat mode
* @return Boat mode
*/
void getBoatMode(CallbackWithOneParam<BoatMode> callback);
/**
* Whether support takeoff under Boat mode
*
* @return Whether support takeoff under Boat mode
*/
boolean isSupportBoatMode();
/**
* Configures the tripod mode parameters
* @param params TripodParams to be set
* @param callback: returns the configuration result of tripod mode parameters
*/
void setTripodParams(TripodParams params, CallbackWithNoParam callback);
/**
* Configures the time-lapse photography parameters
* @param params MotionDelayParams to be set
* @param callback: returns the configuration result of time-lapse photography parameters
*/
void setMotionDelayParams(MotionDelayParams params, CallbackWithNoParam callback);

/**
* Cancels the current mission.
* @param type 0- hover,1-go home
* @param cancelCallback the callback when cancel the mission.
*/
void cancelMission(int type,CallbackWithNoParam cancelCallback);

/**
* Checks whether the No Fly Zone data needs to be updated
* @param country: the value is a file name for a temporary No Fly Zone and a country name for a permanent No Fly Zone
* @param md5: MD5 value of the file
* @param callback
*/
void checkNFZ(String country,String md5,CallbackWithOneParam<Boolean> callback);

/**
* Uploads the file data to the flightcontroller
* @param filePath: file path
* @param type: file type
* @param callback: returns the file upload progress
*/
void uploadFileData(String filePath, FileDataType type, CallbackWithOneParamProgress<Float> callback);


/**
* Sets the throttle sensitivity
* @param value: throttle sensitivity value
* @param callback: returns the configuration result of the throttle sensitivity
*/
void setGasPedalSensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* reset Exp relative params
*/
void resetExpParams();

/**
* Obtains the throttle sensitivity value
* @param callback: returns the throttle sensitivity value
*/
void getGasPedalSensitivity(CallbackWithOneParam<Float> callback);

/**
* Sets the attitude sensitivity
* @param value: attitude sensitivity value
* @param callback: returns the configuration result of the attitude sensitivity
*/
void setATTISensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* Obtains the attitude sensitivity value
* @param callback: returns the attitude sensitivity value
*/
void getATTISensitivity(CallbackWithOneParam<Float> callback);

/**
* Sets the brake sensitivity
* @param value: brake sensitivity value
* @param callback: returns the configuration result of the brake sensitivity
*/
void setBrakeSensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* Obtains the brake sensitivity value
* @param callback: returns the brake sensitivity value
*/
void getBrakeSensitivity(CallbackWithOneParam<Float> callback);

/**
* Sets the yaw sensitivity
* @param value: yaw sensitivity value
* @param callback: returns the configuration result of the yaw sensitivity
*/
void setYawStrokeSensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* Obtains the yaw sensitivity value
*
* @param callback: returns the yaw sensitivity value
*/
void getYawStrokeSensitivity(CallbackWithOneParam<Float> callback);

/**
* Sets the pitch sensitivity and Roll sensitivity
* @param value: pitch sensitivity and Roll sensitivity
* @param callback: returns the configuration result of the pitch sensitivity and Roll sensitivity
*/
void setPitchAndRollSenCoefficient(float value,CallbackWithOneParam<Boolean> callback);

/**
* Sets the pitch sensitivity
* @param value
* @param callback
*/
void setPitchSensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* Sets the Roll sensitivity
* @param value
* @param callback
*/
void setRollSensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* Obtains the pitch sensitivity and Roll sensitivity
*
* @param callback: returns the pitch sensitivity and Roll sensitivity
*/
void getPitchAndRollSenCoefficient(CallbackWithOneParam<Float> callback);

/**
* Obtains the pitch sensitivity
* @param callback
*/
void getPitchSensitivity(CallbackWithOneParam<Float> callback);

/**
* Obtains the Roll sensitivity
* @param callback
*/
void getRollSensitivity(CallbackWithOneParam<Float> callback);

/**
* Calibrates the IMU
*/
void startCalibrationIMU(CallbackWithTwoParams<CalibrateIMUStep, CalibrateIMUStatus> callback);

/**
* Converts to ReactiveX interface.
*
* @return ReactiveX interface.
*/
RxEvo2FlyController toRx();

/**
* Obtains the third-party account information
* @param authInfoCallbackWithOneParam: returns the third-party account information
*/
void getRtkAuthInfo(CallbackWithOneParam<AuthInfo> authInfoCallbackWithOneParam);

/**
* Configures whether to use RTK locating results
* @param isUsed
* @param callback: returns whether to use the RTK locating results
*/
void setUseRTK(boolean isUsed, CallbackWithNoParam callback);

/**
* Obtains whether to use the RTK locating results
* @param callback: returns the result of whether to use the RTK locating information or not
*/
void getUseRTK(CallbackWithOneParam<Boolean> callback);

/**
* Sets the RTK coordinate type
* @param coordinateSystem RtkCoordinateSystem to be set
* @param callback: returns the configuration result (whether the configuration succeeded or failed)
*/
void setRtkCoordinateSys(RtkCoordinateSystem coordinateSystem, CallbackWithNoParam callback);

/**
* Configures the RTK data receiving method
* @param recvType
* @param callback: returns the configuration result (whether the configuration succeeded or failed)
*/
void setRtkRecvType(int recvType, CallbackWithNoParam callback);

/**
* Obtains the RTK coordinate type
*
* @param callback: returns the RTK coordinate type
*/
void getRtkCoordinateSys(CallbackWithOneParam<RtkCoordinateSystem> callback);

/**
* Obtains the RTK data receiving method
* @param callback: returns the RTK data receiving method
*/
void getRtkRecvType(CallbackWithOneParam<RTKSignalType> callback);

void setActivateState(int value, CallbackWithNoParam callback);

void getImuModelID(CallbackWithOneParam<Long> callback);
/**
* Sends the RTK differential data obtained from the third party
* @param data: differential data
*/
void sendRtkData(byte[] data);

void setBaseStationLocation(AutelCoordinate3D coordinate3D,CallbackWithNoParam callback);

}

3.4.1 TimelapseMissionInfo

public class TimelapseMissionInfo {
public int missionType;
public CruiserMode cruiserMode;
}
1: CruiserMode
public enum CruiserMode {
DISABLE(0), CAN_ABLE(1), ON(2),UNKNOWN(-1);
}

3.4.2 RTKInternal

/**
* RTK parameter information
*/
public class RTKInternal {
/**
* Solution status, 0-Solved, 1-Insufficient observation data, 2-Unable to converge, 4-The trace of the covariance matrix exceeds the maximum value
*/
public int solSta;
/**
* Position type is explained as follows
* 0 - No solution; 1 - Position is specified by FIX POSITION command; 2 - Not supported temporarily; 8 - Speed is derived from real-time Doppler information; 16 - Single point positioning; 17 - Pseudorange difference decomposition; 18 - SBAS positioning; 32 - L1 floating point solution; 33 - Deionized floating point solution; 34 - Narrow lane floating point solution; 48 - L1 fixed solution; 49 - Wide lane fixed solution; 50 - Narrow lane fixed solution; 52 - Pure inertial navigation positioning solution; 53 - Inertial navigation and single point positioning combined solution; 54 - Inertial navigation and pseudo-range differential positioning combined solution; 55 - Inertial navigation and carrier phase differential floating point solution combined solution; 56 - Inertial navigation and carrier phase difference fixed solution combined solution
* posType == 16, the type is single; posType>16 && posType<47, the type is float; posType>47, the type is fix
*/
public int posType;
/**
* Latitude
*/
public double latitude;
/**
* Longitude
*/
public double longitude;
/**
* Altitude
*/
public double altitude;
/**
* Latitude standard deviation
*/
public double latSigma;
/**
* Longitude standard deviation
*/
public double lonSigma;
/**
* Altitude standard deviation
*/
public double altSigma;
/**
* Number of satellites tracked
*/
public int sVs;
/**
* Number of satellites used in solution
*/
public int solnSVs;
/**
* Number of gps satellites
*/
public int gpsSta;
/**
* Number of beidou satellites
*/
public int beidouSta;
/**
* Number of glonass satellites
*/
public int glonassSta;
/**
* Number of galileo satellites
*/
public int galileoSta;
/**
* Whether RTK is in position,N/A
*/
public int inPos;
/**
* Whether to use RTK positioning,N/A
*/
public boolean rtkUsed;
/**
* fix status,N/A
*/
public int fixSat;
/**
* Location type,N/A
*/
public DroneLocationType locationType;
/**
* RTK signal type,N/A
*/
public RTKSignalType signalType;
/**
* RTK coordinate system,N/A
*/
public int coordinateSys;
}
1: DroneLocationType
public enum  DroneLocationType {
GNSS(0),RTK(1),UNKNOWN(-1);
}
2: RTKSignalType
/**
* RTK signal type
*/
public enum RTKSignalType {

/**
* None
*/
NONE(0),
/**
* Station RTK
*/
RTK_M_STATION(1),
/**
* Net RTK
*/
RTK_NET(3),
/**
* Custom RTK
*/
RTK_CUSTOM(4),

/**
* Unknown status.
*/
UNKNOWN(-1);
}

3.4.3 RealTimeInfo

/**
* The real-time information of the mission.
*/

public interface RealTimeInfo {
}

3.4.4 EvoFlyControllerInfo

/**
* The fly controller information of EVO.
*/

public interface EvoFlyControllerInfo {
/**
* Gets the GPS information.
* @return the GPS information.
*/
EvoGpsInfo getGpsInfo();

/**
* Gets the IMU state information.
* @return the IMU state information.
*/
ImuStateInfo getImuStateInfo();

/**
* Gets the attitude information.
* @return the attitude information.
*/
EvoAttitudeInfo getAttitudeInfo();

/**
* Gets the local coordinate information.
* @return the local coordinate information.
*/
LocalCoordinateInfo getLocalCoordinateInfo();

/**
* Gets the fly controller status information.
* @return the fly controller status information.
*/
FlyControllerStatus getFlyControllerStatus();

BaseStationInfo getBaseStationInfo();

BaseStationLocation getBaseStationLocation();
}
1: EvoGpsInfo API
/**
* This interface is used to save GPS information.
*/

public interface EvoGpsInfo {
/**
* Gets the latitude information.
* @return the latitude information.
*/
double getLatitude();

/**
* Gets the longitude information.
* @return the longitude information.
*/
double getLongitude();

/**
* Gets the altitude information.
* @return the altitude information.
*/

double getAltitude();
/**
* Gets the fix type. 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
* @return the fix type.
*/
int getFixType();

/**
* Gets the number of visible satellites.
* @return the number of visible satellites.
*/
int getSatellitesVisible();
}
2: ImuStateInfo API
/**
* The IMU information of the aircraft.
*/
public interface ImuStateInfo {
/**
* Gets the accelerometer of the X axis, unit: m/s2.
* @return the accelerometer of the X axis, unit: m/s2.
*/
float getXAccelerometer();
/**
* Gets the accelerometer of the Y axis, unit: m/s2.
* @return the accelerometer of the Y axis, unit: m/s2.
*/
float getYAccelerometer();
/**
* Gets the accelerometer of the Z axis, unit: m/s2.
* @return the accelerometer of the Z axis, unit: m/s2.
*/
float getZAccelerometer();

/**
* Gets the gyroscope acceleration of the X axis, unit: rad/sec.
* @return the gyroscope acceleration of the X axis, unit: rad/sec.
*/
float getXGyroscope();

/**
* Gets the gyroscope acceleration of the Y axis, unit: rad/sec.
* @return the gyroscope acceleration of the Y axis, unit: rad/sec.
*/
float getYGyroscope();

/**
* Gets the gyroscope acceleration of the Z axis, unit: rad/sec.
* @return the gyroscope acceleration of the Z axis, unit: rad/sec.
*/
float getZGyroscope();

/**
* Gets the accelerometer1 of the X axis, unit: m/s2.
* @return the accelerometer1 of the X axis, unit: m/s2.
*/
float getXAccelerometer1();

/**
* Gets the accelerometer1 of the Y axis, unit: m/s2.
* @return the accelerometer1 of the Y axis, unit: m/s2.
*/
float getYAccelerometer1();

/**
* Gets the accelerometer1 of the Z axis, unit: m/s2.
* @return the accelerometer1 of the Z axis, unit: m/s2.
*/
float getZAccelerometer1();

/**
* Gets the gyroscope acceleration1 of the X axis, unit: rad/sec.
* @return the gyroscope acceleration1 of the X axis, unit: rad/sec.
*/
float getXGyroscope1();

/**
* Gets the gyroscope acceleration1 of the Y axis, unit: rad/sec.
* @return the gyroscope acceleration1 of the Y axis, unit: rad/sec.
*/
float getYGyroscope1();

/**
* Gets the gyroscope acceleration1 of the Z axis, unit: rad/sec.
* @return the gyroscope acceleration1 of the Z axis, unit: rad/sec.
*/
float getZGyroscope1();

/**
* Gets the magnetometer of the X axis, unit: Gauss.
* @return the magnetometer of the X axis, unit: Gauss.
*/
float getXMagnetometer();

/**
* Gets the magnetometer of the Y axis, unit: Gauss.
* @return the magnetometer of the Y axis, unit: Gauss.
*/
float getYMagnetometer();

/**
* Gets the magnetometer of the Z axis, unit: Gauss.
* @return the magnetometer of the Z axis, unit: Gauss.
*/
float getZMagnetometer();

/**
* Gets the absolute pressure in millibar.
* @return the absolute pressure in millibar.
*/
float getAbsolutePressure();

/**
* Gets the temperature in degrees celsius.
* @return the temperature in degrees celsius.
*/
float getTemperature();

/**
* Gets the field updated information.
* @return the field updated information.
*/
int getFieldsUpdated();
}
3: EvoAttitudeInfo
/**
* The attitude information of EVO.
*
*/

public interface EvoAttitudeInfo extends AttitudeInfo {
/**
* Gets the speed of the roll axis.
* @return the speed of the roll axis.
*/
double getRollSpeed();

/**
* Gets the speed of the pitch axis.
* @return the speed of the pitch axis.
*/
double getPitchSpeed();

/**
* Gets the speed of the yaw axis.
* @return the speed of the yaw axis.
*/
double getYawSpeed();
}
4: AttitudeInfo
/**
* This interface is used to save the current flight control data, including roll, pitch and yaw.
*/
public interface AttitudeInfo {


/**
* Gets the roll data (Z axis attitude).
* Default unit: ANGLE
* @return the roll data (Z axis attitude).
*/
double getRoll();

/**
* Gets the pitch data (X axis attitude).
* Default unit: ANGLE
* @return the pitch data (X axis attitude).
*/
double getPitch();

/**
* Gets the yaw data (Y axis attitude).
* Default unit: ANGLE
* @return the yaw data (Y axis attitude).
*/
double getYaw();
}
5: LocalCoordinateInfo
/**
* The local coordinate information for EVO.
*/

public interface LocalCoordinateInfo extends AltitudeAndSpeedInfo {
/**
* Gets the latitude information of current aircraft location.
* @return the latitude information of current aircraft location.
*/
double getLatitude();

/**
* Gets the longitude information of current aircraft location.
* @return the longitude information of current aircraft location.
*/

double getLongitude();

/**
* Gets the home point latitude information.
* @return the home point latitude information.
*/

double getHomeLatitude();

/**
* Gets the home point longitude information.
* @return the home point longitude information.
*/

double getHomeLongitude();

/**
* Gets the home point altitude information.
* @return the home point altitude information.
*/

double getHomeAltitude();

/**
* Gets the distance information.
* The unit of return value is meter
* @return the distance information.
*/

int getDistance();

/**
* Gets the yaw axis of the home point.
* @return the yaw axis of the home point.
*/

float getHomeYaw();

/**
* Gets the home point enabled flag.
* @return the home point enabled flag.
*/

int getHomeEnable();

/**
* Gets the home point coordinate.
* @return the home point coordinate.
*/

int getHomeCoordinate();
}
6: AltitudeAndSpeedInfo
/**
* This interface is used to save the current altitude and speed data.
*/
public interface AltitudeAndSpeedInfo {


/**
* Gets the current flight altitude.
* The unit of return value is meters.
* @return the current flight altitude.
*/
float getAltitude();

/**
* Gets the fly speed of X axis.
* The unit of return value is meters per second.
* @return the fly speed of X axis.
*/
float getXSpeed();

/**
* Gets the fly speed of Y axis.
* The unit of return value is meters per second.
* @return the fly speed of Y axis.
*/
float getYSpeed();

/**
* Gets the fly speed of Z axis.
* The unit of return value is meters per second.
* @return the fly speed of Z axis.
*/
float getZSpeed();

/**
* Gets the horizontal speed.
* The unit of return value is meters per second.
* @return the horizontal speed.
*/
float getSpeed();
}
7: LocalCoordinateInfo
/**
* The local coordinate information for EVO.
*/

public interface LocalCoordinateInfo extends AltitudeAndSpeedInfo {
/**
* Gets the latitude information of current aircraft location.
* @return the latitude information of current aircraft location.
*/
double getLatitude();

/**
* Gets the longitude information of current aircraft location.
* @return the longitude information of current aircraft location.
*/

double getLongitude();

/**
* Gets the home point latitude information.
* @return the home point latitude information.
*/

double getHomeLatitude();

/**
* Gets the home point longitude information.
* @return the home point longitude information.
*/

double getHomeLongitude();

/**
* Gets the home point altitude information.
* @return the home point altitude information.
*/

double getHomeAltitude();

/**
* Gets the distance information.
* The unit of return value is meter
* @return the distance information.
*/

int getDistance();

/**
* Gets the yaw axis of the home point.
* @return the yaw axis of the home point.
*/

float getHomeYaw();

/**
* Gets the home point enabled flag.
* @return the home point enabled flag.
*/

int getHomeEnable();

/**
* Gets the home point coordinate.
* @return the home point coordinate.
*/

int getHomeCoordinate();
}
8: FlyControllerStatus API
/**
* This interface is used to save the flight status: flight mode, main flight status.
*/
public interface FlyControllerStatus {
/**
* Gets the main flight status.
* @return a MainFlyState enum.
*/
MainFlyState getMainFlyState();

/**
* Gets ESC error code
* Get ESC error code
*/
ARMWarning getArmErrorCode();

/**
* Gets the flight mode.
* @return a FlyMode enum.
*/
FlyMode getFlyMode();

/**
* Tells whether the aircraft reaches the max altitude.
* @return the aircraft reaches the max altitude or not.
*/
boolean isReachMaxHeight();

/**
* Tells whether the aircraft reaches the max distance.
* @return the aircraft reaches the max distance or not.
*/
boolean isReachMaxRange();

/**
* Tells whether the GPS signal is available.
* @return the GPS signal is available or not.
*/
boolean isGpsValid();

/**
* Tells whether the Home Point is valid.
* @return the Home Point is valid or not.
*/
boolean isHomePointValid();

/**
* Tells whether the compass data are valid.
* @return the compass data are valid or not.
*/
boolean isCompassValid();

/**
* Tells whether the remote controller loses the signal.
* @return the remote controller loses the signal or not.
*/
boolean isFlightControllerLostRemoteControllerSignal();

/**
* Tells whether the flight controller is overheated.
* @return the flight controller is overheated or not.
*/
boolean isFlightControllerOverHeated();

/**
* Tells whether the take-off button is valid.
* @return the take-off button is valid or not.
*/
boolean isOneClickTakeOffValid();

/**
* Tells whether the take-off is valid.
* @return the take-off is valid or not.
*/
boolean isTakeOffValid();

/**
* Tells whether the aircraft is warming up.
* @return the aircraft is warming up or not.
*/
boolean isWarmingUp();

/**
* Tells whether the home point is accurate or not.
* @return the home point is accurate or not.
*/
boolean isHomePointLocationAccurate();

/**
* Tells whether to hold for ten seconds before go home.
* @return true to enable the pending, false to disable the pending.
*/
boolean isGoHomePending();

/**
* Gets the no-fly zone warning.
* @return the no-fly zone warning.
*/
FlyLimitAreaWarning getFlyLimitAreaWarning();

/**
* Tells whether the stick is reaching the limitation or not.
* @return if true, the stick is reaching the limitation.
*/
boolean isStickLimited();

/**
* Tells whether the aircraft is almost reach the maximum distance or not.
* @return true to enable the flight range limitation, false to disable the flight range limitation.
*/
boolean isNearRangeLimit();

/**
* Whether the wind is too high.
* @return Whether the wind is too high.
*/
boolean isWindTooHigh();

/**
* Whether to support RTK
* @return
*/
boolean isSupportRtk();
}
a: MainFlyState
/**
* The value of the main flight control state.
*/
public enum MainFlyState {
/**
* The main flight state is unknown.
*/
UNKNOWN(0),
/**
* The main flight state is ATTITUDE.
*/
ATTITUDE(1),
/**
* The main flight state is GPS.
*/
GPS(2),
/**
* The main flight state is IOC.
*/
IOC(3),
/**
* The main flight state is Starpoint.
*/
STAR_POINT(4);
}
b: FlyMode
/**
* The value of the fly mode parameter.
*/
public enum FlyMode {

/**
* Turn off the motors.
*/
DISARM(0),
/**
* The motors are spinning but the aircraft is still on the ground.
*/
MOTOR_SPINNING(1),
/**
* The aircraft is landing.
*/
LANDING(2),
/**
* The aircraft is taking off, including two methods: using the takeoff button or pushing the command stick.
*/
TAKEOFF(3),
/**
* The aircraft is flying in ATTITUDE mode.
*/
ATTI_FLIGHT(4),
/**
* The aircraft is flying in GPS mode.
*/
GPS_FLIGHT(5),
/**
* The aircraft is flying in IOC mode
*/
IOC(6),
/**
* The aircraft goes home by manually triggering.
*/
NORMAL_GO_HOME(7),
/**
* The aircraft goes home triggered by the low battery protection.
*/
LOW_BATTERY_GO_HOME(8),
/**
* The aircraft's go home function is triggered because the current flight range is not supported by the current remaining battery.
*/
EXCEED_RANGE_GO_HOME(9),
/**
* The aircraft hovers in the air after losing the remote controller signal (No GPS signal).
* The aircraft will keep in ATTI mode for 5s after losing remote controller signal,if the remote controller signal is not resumed, it will automatically land on the ground.
*/
RC_LOST_GO_HOME(10),
/**
* Hover when go home
*/
GO_HOME_HOVER(11),
/**
* The aircraft is in Waypoint mode.
*/
WAYPOINT_MODE(12),
/**
* The aircraft pauses in Waypoint mode.
*/
WAYPOINT_MODE_HOLD(13),
/**
* The aircraft goes home in autopilot mission.
* Autopilot mission includes Waypoint mission, Orbit mission and Follow mission.
*/
MISSION_GO_HOME(14),
/**
* The aircraft is in Follow mode.
*/
FOLLOW_FOLLOW(15),
/**
* The aircraft is in Orbit mode.
*/
ORBIT_ORBIT(16),
/**
* The aircraft hovers in Follow mode.
*/
FOLLOW_HOLD(17),
/**
* The aircraft hovers in Orbit mode.
* Only happened when the GPS signal is very weak. If no replies after 15s, the aircraft will exit Orbit mode.
*/
ORBIT_HOLD(18),

/**
* Tripod mode
*/
TRIPOD(30),
/**
* Image stabilization mode
*/
PHOTOGRAPHER(31),
/**
* Rectangle mission
*/
RECTANGLE(32),
/**
* Hover in Rectangle Mission
*/
RECTANGLE_HOLD(33),
/**
* Polygon mission
*/
POLYGON(34),
/**
* Hover in Polygon Mission
*/
POLYGON_HOLD(35),
/**
* Motion delay mode mission in progress
*/
MOTION_DELAY(36),
/**
* Motion delay mode mission paused
*/
MOTION_DELAY_PAUSE(37),

OBLIQUE_MISSION(38),

OBLIQUE_MISSION_PAUSE(39),

/**
* The Dynamic Track mode is common.
*/
TRACK_COMMON_MODE(200),
/**
* The Dynamic Track mode is parallel.
*/
TRACK_PARALLEL_MODE(201),
/**
* The Dynamic Track mode is tripod.
*/
TRACK_LOCKED_MODE(202),
/**
* Indoor point flight
*/
POINT_FLY_INSIDE(203),

/**
* Outdoor point flight
*/
POINT_FLY_OUTSIDE(204),


/**
* The fly mode is unknown.
*/
UNKNOWN(-1);
}
c: FlyLimitAreaWarning
/**
* The warning value of the flight restricted area.
*/
public enum FlyLimitAreaWarning {
/**
* The aircraft has no warning.
*/
NORMAL(0, "normal"),
/**
* The aircraft is flying near the airport.
*/
AIRPORT_VICINITY(1, "The aircraft is flying near the airport"),
/**
* The aircraft is flying in the height restricted area.
*/
AIRPORT_HEIGHT_RESTRICTED_AREAS(2, "The aircraft is flying in the height restricted area"),
/**
* The aircraft reached the max altitude of height restricted area.
*/
AIRPORT_HEIGHT_RESTRICT_MAXHEIGHT(3, "The aircraft reached the max altitude of height restricted area"),
/**
* The aircraft is flying in the no fly zone.
*/
AIRPORT_NO_FLY_ZONES(4, "The aircraft is flying in the no fly zone"),
/**
* The aircraft is flying in the no fly zone.
*/
AIRPORT_NO_FLY_ZONES_CAUTIOUS(5, "The aircraft is cautious flying in the no fly zone"),
/**
* Unknown state.
*/
UNKNOWN(-1, "unknown");
}
9: BaseStationInfo API
public interface BaseStationInfo {

int getBaseStationBattery();

int getBaseStationRtkSignal();

int getBaseStationGpsCount();
}
10: BaseStationLocation API
public interface BaseStationLocation {

double getLatitude();

double getLongitude();

double getHeight();

int getStatus();

int getPosType();
}

This is the end of the tutorial.