Skip to main content

飞机参数设置功能实现

1. 概述

使⽤Mobile SDK 设定飞行参数,可以选择很多不同的参数设置,本教程旨在帮助您基本了解MobileSDK 飞机相关接⼝的使⽤。

我们将分2个步骤:

1,从SDK调起 AutelFlyController (或者其他派生类)

2,飞机参数设置。 注:飞行功能要基于SDK集成之后,首要参考SDK入门文档。

2. 功能实现

2.1 从SDK集成过程中Autel获取product 对象

此处在SDK集成时候做的,我们只是告知开发者BaseProduct对象的来处(Autel.setProductConnectListener中)

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

}
});

2.2 Activity中使用product对象

Evo2FlyControllerActivity.java文件为例,其他的雷同。

2.2.1 将product 转换成Evo2FlyController类型的实例(即mController对象)

    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 具体调用mController对象方法

以激活设备功能为代表,其他方法雷同。

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

@Override
public void onFailure(AutelError error) {
logOut("激活失败 : " + error.getDescription());
}
});
}

3. 参数设置

参数设置会涉及到很多接口和参数,以下全部会列举出来。已经出现的接口和字段表,如果重复就不在列举。

3.1 AutelFlyController.java 接口

说明:该接口用于提供飞行控制功能。

/**
* 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.
* 设置无人机LED指示灯状态。
* @param lamp the enum of the LED indicator state. LED指示灯状态的枚举值。
* @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.
* 获取无人机LED指示灯状态。
* @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.
* 遥控器一键无人机起飞。
* <p/>
* Note: it is only available when the aircraft is landed and is in GPS mode.
* 注意:只有当无人机处于GPS模式且已降落时才可用。
* @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.
* 返回可观察对象以控制无人机返航。
* <p>
* Note:
* <p/>
* This is available when the aircraft is not landing or landed.
* 当飞机没有着陆或降落时,此项可用。
* <p/>
* Also, there must be GPS signal, valid home point, normal compass and running motors.
* 此外,必须有GPS信号,有效的返航点,正常的指南针和运行的电机。
* @param callback the callback when make the aircraft go home. 控制无人机返航的可观察对象。
*/
void goHome(CallbackWithNoParam callback);

/**
* Land the aircraft..
* 返回可观察对象控制无人机下降并着陆。
* <p/>
* Note:
* <p/>
* This is available when the aircraft has taken off.
* 当无人机起飞时此项可用。
* @param callback the callback when make the aircraft land descent.
*/
void land(boolean isCancel,CallbackWithNoParam callback);

/**
* Cancels the land operation.
* 返回可观察对象以取消降落操作。
* <p/>
* Note:
* <p/>
* 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.
* 返回可观察对象来取消返航操作并控制无人机盘旋。
* <p/>
* Note:
* <p/>
* 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);


/**
* When performing the Waypoint Mission, the emergency action is performed
* 当执行航点动作的时候,执行应急动作
* <p/>
* Note:
* <p/>
*
* @param callback .
*/
void doEmergencyAction(EmergencyAction action, CallbackWithNoParam callback);

/**
* Sets the current aircraft location as the home point.
* 返回可观察对象以将当前无人机位置设置为返航点。
* <p/>
* Note:
* <p/>
* This is available only if all the following requirements are met:
* 如果满足以下所有要求,则此项可用:
* <p/>
* The motors are armed, the aircraft is not in any intelligent mode, the aircraft is not returning to the home point, GPS is valid.
* 电机正在运转,无人机没有处于任何智能模式,无人机没有回返航点,GPS有效。
* @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.要设置的经度值。
* <p/>
* Note: 注意
* <p/>
* This is available only if all the following requirements are met:
* 如果满足以下所有要求,则此项可用:
* <p/>
* The motors are armed,the aircraft is not in any intelligent mode, the aircraft is not returning to the home point.
* 电机正在运转,无人机没有处于任何智能模式,无人机没有回返航点效。
* <p/>
* GPS for the aircraft and phone is valid, the distance between the phone and aircraft is within 5000 meters.
* 无人机和手机的GPS有效,手机和无人机之间的距离在5000米以内。
* @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();

/**
* 获取上升速度
*
* @param callback
*/
void getMaxVZUp(CallbackWithOneParam<Float> callback);

/**
* 设置上升速度
*
* @param callback
*/
void setMaxVZUP(float value, CallbackWithNoParam callback);

/**
* 获取下降速度
*
* @param callback
*/
void getMaxVZDown(CallbackWithOneParam<Float> callback);

/**
* 设置下降速度
*
* @param callback
*/
void setMaxVZDown(float value, CallbackWithNoParam callback);

/**
* 获取50米范围内是否上升到返航高度返航
*
* @param callback
*/
void getRiseToPthh(CallbackWithOneParam<Integer> callback);

/**
* 设置50米范围内是否上升到返航高度返航
*
* @param callback
*/
void setRiseToPthh(int value, CallbackWithNoParam callback);
}

字段表1:ARMWarning

/**
* The warning value of the aircraft.
* 无人机的告警值。
*/
public enum ARMWarning {
/**
* IMU loss.
* IMU异常。
*/
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错误。
*/
IOC_ERROR(0x05, "IOC error"),
/**
* Beginner NO GPS.
* 新手无GPS。
*/
BEGINNER_NO_GPS(0x06, "Beginner NO GPS"),
/**
* Disarm tilt over 45deg.
* 就绪状态下倾斜超过45度。
*/
DISARM_TILT_OVER_45DEG(0x07, "Disarm tilt over 45deg"),
/**
* Disarm IMU loss.
* 就绪状态IMU损失。
*/
DISARM_IMU_LOSS(0x08, " Disarm IMU loss"),
/**
* IMU is warming up.
* IMU正在预热。
*/
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)
* (如果GPS信号处于良好状态,无人机可在GPS模式下飞行)</p>
*/
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.
* 磁干扰下,无人机仍保持正确的航向。
* <p>
* (If GPS signal is in good condition, the aircraft can fly in GPS mode)
* (如果GPS信号处于良好状态,无人机可在GPS模式下飞行)
* </p>
*
*/
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.
* 由于连续磁干扰误差,无人机将无法保持正确的航向。
* <p>
* (First leftTime warning. If GPS has enough satellites, the aircraft can fly in GPS mode)
* (首次剩余时间告警。 如果GPS有足够的卫星,无人机可以在GPS模式下飞行。
* </p>
*
*/
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.
* 由于连续磁干扰误差,无人机将无法保持正确的航向。
* <p>
* (Second leftTime warning)
* (第二次次剩余时间告警)
* </p>
*/
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.
* 指南针校准无GPS
*/
NO_GPS (7),
/**
* Calibration timeout
* 校准超时。
*/
TIMEOUT(8),
/**
* Unknown status.
* 未知状态。
*/
UNKNOWN(-1);
}

字段表:LedPilotLamp

/**
* The LED light state.
* LED灯状态。
*/
public enum LedPilotLamp {

/**
* All lights are off.
* 所有灯已关闭。
*/
ALL_OFF(0),
/**
* The front LED lights are off, the rear LED lights are on.
* 前LED灯关闭,后LED灯打开。
*/
BACK_ONLY(1),
/**
* The front LED lights are on, the rear LED lights are off.
* 前LED灯打开,后LED灯关闭。
*/
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.
* LED灯状态未知。
*/
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.
* 指南针校准无GPS
*/
NO_GPS (7),
/**
* Calibration timeout
* 校准超时。
*/
TIMEOUT(8),
/**
* Unknown status.
* 未知状态。
*/
UNKNOWN(-1);
}

接口4:FlyControllerVersionInfo

/**
* 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

/**
* The manager of the fly controller parameter range.
* 飞行控制器参数范围管理器。
*/

public interface FlyControllerParameterRangeManager {
/**
* Gets the range of the maximum height that can be set,
* 获取可设置的最大高度范围,
* <p>
* XStar ranges from 30 meters to 800 meters.
* XStar范围从30米到800米。
* @return the range of the max height that can be set.可设置的最大高度范围。
*/
RangePair<Float> getHeightRange();

/**
* Gets the range of the max distance,
* 获取最大距离的范围,
* <p>
* XStar ranges from 30 meters to 10000 meters.
* XStar的范围从30米到10000米。
* @return the range of the max distance.最大距离的范围,
*/
RangePair<Float> getRangeOfMaxRange();
/**
* Gets the range of the horizontal speed.
* 获取水平速度的范围。
* <p>
* XStar ranges from 0 meters/second to 15 meters/second.
* XStar范围从0米/秒到15米/秒。
* @return the range of the horizontal speed.水平速度的范围。
*/
RangePair<Float> getHorizontalSpeedRange();

/**
* Gets the range of the go home altitude.
* 获取返航高度的范围。
* <p>
* XStar ranges from 30 meters to 200 meters.
* XStar范围从30米到200米。
* @return the range of the go home altitude.返航高度的范围。
*/
RangePair<Float> getReturnHeightRange();


}

接口6:RxAutelFlyController

/**
* 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最大飞行高度范围是30米到800米。
* @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.XStar最大飞行距离范围是30米到500米。
* @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.XStar返航高度范围是30米到200米。
* @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最大水平速度范围是0 m/s到15 m/s。
* @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.
* 返回可观察的对象以设置无人机LED指示灯状态。
* @param lamp the enum of the LED indicator state.LED指示灯状态的枚举值。
* @return an observable object to set the LED indicator state located on the aircraft.设置无人机LED指示灯状态的可观察对象。
*/
Observable<Boolean> setLedPilotLamp(LedPilotLamp lamp);

/**
* Returns an observable object to get the LED indicator state located on the aircraft.
* 返回可观察对象以获取无人机LED指示灯状态。
* @return an observable object to get the LED indicator state located on the aircraft.获取无人机LED指示灯状态的可观察对象。
*/
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.
* 返回可观察对象以遥控器一键无人机起飞。
* <p/>
* Note: it is only available when the aircraft is landed and is in GPS mode.
* 注意:只有当无人机处于GPS模式且已降落时才可用。
* @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.
* 返回可观察对象以控制无人机返航。
* <p>
* Note:
* <p/>
* This is available when the aircraft is not landing or landed.
* 当飞机没有着陆或降落时,此项可用。
* <p/>
* Also, there must be GPS signal, valid home point, normal compass and running motors.
* 此外,必须有GPS信号,有效的返航点,正常的指南针和运行的电机。
* @return an observable object to make the aircraft go home.控制无人机返航的可观察对象。
*/
Observable<Boolean> goHome();

/**
* Returns an observable object to make the aircraft descent and land.
* 返回可观察对象控制无人机下降并着陆。
* <p/>
* Note:
* <p/>
* 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.
* 返回可观察对象以取消降落操作。
* <p/>
* Note:
* <p/>
* 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.
* 返回可观察对象来取消返航操作并控制无人机盘旋。
* <p/>
* Note:
* <p/>
* 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.
* 返回可观察对象以将当前无人机位置设置为返航点。
* <p/>
* Note:
* 注意:
* <p/>
* This is available if all the following requirements are met:
* 如果满足以下所有要求,则此项可用:
* <p/>
* The motors are running, the aircraft is not in any intelligent mode, the aircraft is not returning to the home point, GPS is valid.
* 电机正在运转,无人机没有处于任何智能模式,无人机没有回返航点,GPS有效。
* @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:
* 注意
* <p/>
* This is available if all the following requirements are met:
* 如果满足以下所有要求,则此项可用:
* <p/>
* The motors are running,the aircraft is not in any intelligent mode, the aircraft is not returning to the home point.
* 电机正在运转,无人机没有处于任何智能模式,无人机没有回返航点效。
* <p/>
* GPS for the aircraft and phone is valid, the distance between the phone and aircraft is within 5000 meters.
* 无人机和手机的GPS有效,手机和无人机之间的距离在5000米以内。
* @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接口

/**
* 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 type 根据不同的命令ID填充对应的指令
* @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);

/**
* 开始环绕延时的拍照
*/
void startOrbitTimeTakePhoto(final CallbackWithNoParam callback);
}

3.2.1 接口VisualWarningInfo

/**
* 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.
* Failsafe模式启用。
*/
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.
* ATTI模式下,视觉功能不能使用。
*/
VISUAL_ATTI_MODE(77),
/**
* Exit visual mission
* 退出视觉任务
*/
VISUAL_EXIT_BUTTON(78),
/**
* Excessive magnetic flight direction deviation, current visual mission exits
* 磁航向偏差过大,当前视觉任务退出
*/
VISUAL_TRACK_EXCEPTION(79),

/**
* 磁航向偏差过大,指向飞行异常退出
*/
VISUAL_VIEWPOINT_EXCEPTION(80),
/**
* 磁航向偏差过大,环绕退出
*/
EXCESSIVE_MAGNETIC_COURSE_DEVIATION_TOO_LARGE(81),
/**
* 距离过近,请调整目标位置后重试
*/
DISTANCE_CLOSE_ADJUST_TARGET(82),
/**
* 初始化失败,请保持目标静止
*/
INIT_FAILED_TARGET_STILL(83),
/**
* 正在测算距离,请保持目标静止
*/
CALCULATING_THE_TARGET_DISTANCE_TARGET_STILL(84),
/**
* 初始化成功,开始执行任务
*/
INIT_SUC_EXECUTING_MISSION(85),
/**
* 目标丢失,请重新框选目标
*/
TARGET_LOSS(86),
/**
* 目标纹理过弱,请重新框选目标
*/
TARGET_TEXTURE_TOO_WEAK(87),
/**
* GPS信号弱,无法执行任务
*/
GPS_TOO_WEAK(88),
/**
* 目标过小,请重新框选目标
*/
TARGET_TOO_SMALL(89),
/**
* 飞行器运动方向有障碍物,请移到空旷区后重试
*/
MOTION_OBSTACLE_WARNING_90(90),
/**
* 初始化失败,请重试
*/
INIT_FAILED(91),
/**
* 云台异常
*/
GIMBAL_INIT_FAILED(92),
/**
* 飞机温度过高,已停止追踪。
*/
AIRPLANE_TEMPERATURE_TOO_HIGH(93),

/**
* The warning state is unknown.
* 告警状态未知。
*/
UNKNOWN(-1);
}

3.2.2 接口AvoidanceRadarInfo

/**
* 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
* value为65535时,表示当前值无效;65534表示当前光线弱,值无效
* For EVO: getRear()[0] means rear view TOF data
* 对于EVO:getRear()[0]表示后视TOF数据
*/

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;
* 获取前方视觉系统信息。数组索引0到索引3的值指示TOF值。 0为初始值;65535表示无障碍物;
* 65534 indicates the light is too weak, unable to get accurate data.
* 65534表示光线太弱,无法得到准确的数据。
* @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.
* 获取后方视觉系统信息。数组索引0的值指示用于后方雷达传感器的TOF值。0是初始值;65534表示光线太弱,无法得到准确数据。
* @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. 启用避让系统为true,禁用避让系统为false。
*/
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. 启用障碍物避让功能为true,禁用障碍物避让功能为false。
*/

boolean isAvoidanceEnableWhenTracking();

/**
* Tells whether or not the radar map is enabled.
* 说明雷达地图是否启用。
* @return true to enable the radar map, false to disable the radar map.启用雷达地图为true,禁用雷达地图则为false。
*/

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.启用向后飞行为true,禁用向后飞行则为false。
*/
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.启用降落保护功能为true,禁用降落保护功能为false。
*/

boolean isLandingProtectEnable();

/**
* Tells whether or not the visual positioning is enabled.
* 说明视觉定位是否启用。
* @return true to enable the visual positioning, false to disable the visual positioning.启用视觉定位为true,禁用视觉定位为false。
*/

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.启用障碍物检测功能为true,禁用障碍物检测功能为false。
*/

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.启用准确降落功能为true,禁用准确降落功能为false。
*/

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.启用水平障碍物避让功能为true,禁用水平障碍物避让功能为false。
*/

boolean isAvoidInHorizontal();

// /**
// * Gets the viewpoint limit speed.
// *
// * @return the viewpoint limit speed.
// */
//
// float getViewPointSpeedLimit();

/**
* Gets the Dynamic Track mode.
* 获取动态跟踪模式。
* @return the Dynamic Track mode.动态跟踪模式。
*/

DynamicTrackMode getFollowMode();

// /**
// * Gets the view point target area.
// *
// * @return the view point target area.
// */
// ViewPointTargetArea getViewPointTargetArea();

/**
* 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.启用图像模式为true,禁用图像模式为false。
*/
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.启用校准模式为true,禁用校准模式为false。
*/
boolean isCalibrationMode();

/**
* Tells whether to enable the Viewpoint mode.
* 说明指向飞行模式是否启用。
* @return true to enable the Viewpoint mode, false to disable the Viewpoint mode.启用指向飞行模式为true,禁用指向飞行模式为false。
*/
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.启用指向飞行室内模式为true,禁用指向飞行室内模式为false。
*/
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.启用手势识别模式为true,禁用手势识别模式为false。
*/
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();

TimeLapseOrbitState getTimeLapseOrbitState();

/**
* Gets the viewpoint speed.
* 获取指向飞行速度。
* @return The viewpoint speed.指向飞行速度。
*/
int getSpeed();

/*********标定状态********/
boolean isStereoCalibFrontError();

boolean isStereoCalibRearError();

boolean isStereoCalibBottomError();

boolean isStereoCalibRightError();

boolean isStereoCalibLeftError();

boolean isStereoCalibTopError();
}
字段表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.
* Failsafe模式启用。
*/
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.
* ATTI模式下,视觉功能不能使用。
*/
VISUAL_ATTI_MODE(77),
/**
* Exit visual mission
* 退出视觉任务
*/
VISUAL_EXIT_BUTTON(78),
/**
* Excessive magnetic flight direction deviation, current visual mission exits
* 磁航向偏差过大,当前视觉任务退出
*/
VISUAL_TRACK_EXCEPTION(79),

/**
* 磁航向偏差过大,指向飞行异常退出
*/
VISUAL_VIEWPOINT_EXCEPTION(80),
/**
* 磁航向偏差过大,环绕退出
*/
EXCESSIVE_MAGNETIC_COURSE_DEVIATION_TOO_LARGE(81),
/**
* 距离过近,请调整目标位置后重试
*/
DISTANCE_CLOSE_ADJUST_TARGET(82),
/**
* 初始化失败,请保持目标静止
*/
INIT_FAILED_TARGET_STILL(83),
/**
* 正在测算距离,请保持目标静止
*/
CALCULATING_THE_TARGET_DISTANCE_TARGET_STILL(84),
/**
* 初始化成功,开始执行任务
*/
INIT_SUC_EXECUTING_MISSION(85),
/**
* 目标丢失,请重新框选目标
*/
TARGET_LOSS(86),
/**
* 目标纹理过弱,请重新框选目标
*/
TARGET_TEXTURE_TOO_WEAK(87),
/**
* GPS信号弱,无法执行任务
*/
GPS_TOO_WEAK(88),
/**
* 目标过小,请重新框选目标
*/
TARGET_TOO_SMALL(89),
/**
* 飞行器运动方向有障碍物,请移到空旷区后重试
*/
MOTION_OBSTACLE_WARNING_90(90),
/**
* 初始化失败,请重试
*/
INIT_FAILED(91),
/**
* 云台异常
*/
GIMBAL_INIT_FAILED(92),
/**
* 飞机温度过高,已停止追踪。
*/
AIRPLANE_TEMPERATURE_TOO_HIGH(93),
/**
* 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),

FOLLOW(3),
/**
* 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

/**
* 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
* 指向飞行屏幕上当前点的X坐标值与屏幕的最大X坐标值之比 
*/
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
* 指向飞行屏幕上当前点的Y坐标值与屏幕的最大Y坐标值之比
*/
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
* 视觉SOA开关
*/
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
* 视觉Orbit模式
*/
VISUAL_ORBIT_MODEL(0x24),
/**
* Target object coordinate setting in visual orbit mode
* 视觉Orbit模式下目标物体坐标设置
*/
VISUAL_ORBIT_MODEL_TARGET(0x25),
/**
* Parameter (height, radius, speed) setting in visual orbit mode
* 视觉Orbit模式下参数(高度、半径、速度)设置
*/
VISUAL_ORBIT_MODEL_HEIGHT_RADIUS(0x26),
/**
* Reset yaw in visual orbit mode
* 视觉Orbit模式下航向回中
*/
VISUAL_ORBIT_MODEL_RESET_YAW(0x27),
/**
* Adjust zoom in visual orbit mode
* 视觉Orbit模式调节变焦
*/
VISUAL_DIGITAL_ZOOM(0x28),
/**
* Adjust speed in visual orbit mode
* 视觉Orbit模式调节速度
*/
VISUAL_ADJUST_SPEED(0x29),

/**
* 短片状态设置
*/
VISUAL_STATE(0x2A),

/**
* 短片目标坐标设置
*/
VISUAL_TARGET(0x2B),

/**
* 通知视觉开始/退出环绕延时拍照
*/
VISUAL_ORBIT_TIMELAPSE_PHOTO(0x30),

/**
* 未知状态。
* 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接口

说明:此接口用于管理飞机的视觉功能,包括回避和跟踪。继承了AutelVisual.java接口(后续介绍)

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

public interface Evo2Visual extends AutelVisual {


/**
* 设置跟踪模式
*
* @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);

/**
* 待 设置视觉智能环绕目标框监听
*/
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

/**
* The area data of the tracking target.
* 跟踪目标的区域数据。
*/
public interface TrackingGoalArea {

/**
* Gets the specific ID of the tracking target.
* 获取跟踪目标的特定ID。
* @return the specific ID of the tracking target.跟踪目标的特定ID。
*/
int getId();

/**
* Gets the No.X of the tracking point, which is located in the top left corner of the tracking rectangle.
* 获取跟踪点的No.X,该点位于跟踪矩形的左上角。
* @return the No.X of the tracking point.跟踪点的No.X。
*/
float getAreaXRatio();

/**
* Gets the No.Y of the tracking point, which is located in the top left corner of the tracking rectangle.
* 获取跟踪点的No.Y,该点位于跟踪矩形的左上角。
* @return the No.Y of the tracking point.跟踪点的No.Y。
*/
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
* 目标 0:背景 1:动物 2:船 3:汽车 4:人 5:骑手 6:车辆
* 7:DetectAndSelectPerson 8:Take_Photo 9:StartOrStopRecording 10:VehicleLP 11:LicensePlate
* 7:检测并选择人 8:拍照 9:开始或停止录制 10:车辆牌照 11:牌照
*/

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),
/**
* 摩托车
*/
MOTOCYCLE(12),
/**
* 小型载客汽车
*/
SMALL_PASSENGER_CAR(13),
/**
* 大中型载客汽车
*/
LARGE_AND_MEDIUM_PASSENGER_CAR(14),
/**
* 轻型载货汽车
*/
LIGHT_TRUCK(15),
/**
* 重型载货汽车
*/
HEAVY_TRUCK(16),
/**
* 专项作业车
*/
SPECIAL_OPERATION_VEHICLE(17),
/**
* 挂车
*/
TOWED_VEHICLE(18),
RADAR_INFO(1_000),
CAR_INFO(1_001),
DEFAULT(99),
/**
* 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接口

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

/**
* 待翻译 延时摄影状态上报
* @param infoListener
*/
void setTimelapseStatusListener(CallbackWithOneParam<TimelapseMissionInfo> infoListener);

/**
* 待 GGA数据上报监听
* @param infoListener
*/
void setRtkGGAListener(CallbackWithOneParam<byte[]> infoListener);
/**
* 待 RTK信息上报监听
* @param infoListener the listener will be cancelled when the callback is null.
*/
void setRtkInfoListener(CallbackWithOneParam<RTKInternal> infoListener);

/**
* 待 任务断点位置信息上报
* @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();
/**
* 待 设置三脚架模式参数信息
* @param params TripodParams to be set
* @param callback 返回设置三脚架模式参数信息结果
*/
void setTripodParams(TripodParams params, CallbackWithNoParam callback);
/**
* 待 设置延时摄影模式参数信息
* @param params MotionDelayParams to be set
* @param callback 返回设置延时摄影模式参数信息结果
*/
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);

/**
* 待 检查禁飞区数据是否需要更新
* @param country 临时禁飞区时为文件名,固定禁飞区时为国家命名的名字
* @param md5 文件在md5值
* @param callback
*/
void checkNFZ(String country,String md5,CallbackWithOneParam<Boolean> callback);

/**
* 待 上传文件数据给飞控端
* @param filePath 文件路径
* @param type 文件类型
* @param callback 返回上传文件的进度回调
*/
void uploadFileData(String filePath, FileDataType type, CallbackWithOneParamProgress<Float> callback);


/**
* 待 设置油门感应度
* @param value 油门感应度值
* @param callback 返回设置油门感应度结果
*/
void setGasPedalSensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* 重置Exp 相关参数
*/
void resetExpParams();

/**
* 获取油门感应度
* @param callback 返回获取油门感应度信息
*/
void getGasPedalSensitivity(CallbackWithOneParam<Float> callback);

/**
* 设置姿态灵敏度
* @param value 灵敏度
* @param callback 返回设置姿态灵敏度结果
*/
void setATTISensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* 获取姿态灵敏度
* @param callback 返回姿态灵敏度
*/
void getATTISensitivity(CallbackWithOneParam<Float> callback);

/**
* 设置刹车灵敏度
* @param value 刹车灵敏度值
* @param callback 返回刹车灵敏度设置结果
*/
void setBrakeSensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* 获取刹车灵敏度
* @param callback 返回刹车灵敏度值
*/
void getBrakeSensitivity(CallbackWithOneParam<Float> callback);

/**
* 设置偏航行程灵敏度
* @param value 航行程灵敏度
* @param callback 返回设置偏航行程灵敏度值
*/
void setYawStrokeSensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* 获取偏航行程灵敏度
*
* @param callback 返回航行程灵敏度
*/
void getYawStrokeSensitivity(CallbackWithOneParam<Float> callback);

/**
* 设置俯仰和Roll轴感应度
* @param value 俯仰和Roll轴感应度
* @param callback 返回设置俯仰和Roll轴感应度结果
*/
void setPitchAndRollSenCoefficient(float value,CallbackWithOneParam<Boolean> callback);

/**
* 设置俯仰轴感应度
* @param value
* @param callback
*/
void setPitchSensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* 设置Roll轴感应度
* @param value
* @param callback
*/
void setRollSensitivity(float value,CallbackWithOneParam<Boolean> callback);

/**
* 获取俯仰和Roll轴感应度
*
* @param callback 返回获取俯仰和Roll轴感应度
*/
void getPitchAndRollSenCoefficient(CallbackWithOneParam<Float> callback);

/**
* 获取俯仰轴感应度
* @param callback
*/
void getPitchSensitivity(CallbackWithOneParam<Float> callback);

/**
* 获取Roll轴感应度
* @param callback
*/
void getRollSensitivity(CallbackWithOneParam<Float> callback);

/**
* 待翻译 校准IMU
*/
void startCalibrationIMU(CallbackWithTwoParams<CalibrateIMUStep, CalibrateIMUStatus> callback);

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

/**
* 待 获取千寻账号信息
* @param authInfoCallbackWithOneParam 返回千寻账号信息
*/
void getRtkAuthInfo(CallbackWithOneParam<AuthInfo> authInfoCallbackWithOneParam);

/**
* 设置是否使用RTK定位
* @param isUsed
* @param callback 返回设置是否使用RTK定位结果
*/
void setUseRTK(boolean isUsed, CallbackWithNoParam callback);

/**
* 获取是否使用RTK定位
* @param callback 返回是否使用RTK定位信息
*/
void getUseRTK(CallbackWithOneParam<Boolean> callback);

/**
* 设置RTK坐标类型
* @param coordinateSystem RtkCoordinateSystem to be set
* @param callback 返回设置结果 成功或失败
*/
void setRtkCoordinateSys(RtkCoordinateSystem coordinateSystem, CallbackWithNoParam callback);

/**
* 设置RTK接收数据方式
* @param recvType
* @param callback 返回设置结果 成功或失败
*/
void setRtkRecvType(int recvType, CallbackWithNoParam callback);

/**
* 获取rtk坐标类型
*
* @param callback 返回rtk坐标类型
*/
void getRtkCoordinateSys(CallbackWithOneParam<RtkCoordinateSystem> callback);

/**
* 获取rtk数据接收方式
* @param callback 返回rtk数据接收方式
*/
void getRtkRecvType(CallbackWithOneParam<RTKSignalType> callback);

void setActivateState(int value, CallbackWithNoParam callback);

void getImuModelID(CallbackWithOneParam<Long> callback);
/**
* 发送从千寻位置获取到差分数据
* @param 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
* RTK参数信息
*/
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
* 解状态,0-已解出,1-观测数据不足,2-无法收敛,4-协方差矩阵的迹超过最大值
*/
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
* 0 -- 无解;1 -- 位置由FIX POSITION命令指定;2 -- 暂不支持;8 -- 速度由即时多普勒信息导出;16 -- 单点定位;17 -- 伪距差分解;18 -- SBAS定位;32 -- L1浮点解;33 -- 消电离层浮点解;34 -- 窄巷浮点解;48 -- L1固定解;49 -- 宽巷固定解;50 -- 窄巷固定解;52 -- 纯惯导定位解;53 -- 惯导与单点定位组合解;54 -- 惯导与伪距差分定位组合解;55 -- 惯导与载波相位差分浮点解组合解;56 -- 惯导与载波相位差分固定解组合解
* posType == 16, the type is single; posType>16 && posType<47, the type is float; posType>47, the type is fix
* posType == 16 为single,posType>16 && posType<47为float,posType>47为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
* gps卫星数
*/
public int gpsSta;
/**
* Number of beidou satellites
* 北斗卫星数
*/
public int beidouSta;
/**
* Number of glonass satellites
* glonass卫星数
*/
public int glonassSta;
/**
* Number of galileo satellites
* galileo卫星数
*/
public int galileoSta;
/**
* Whether RTK is in position,N/A
* RTK是否在位 未使用
*/
public int inPos;
/**
* Whether to use RTK positioning,N/A
* 是否使用RTK定位 未使用
*/
public boolean rtkUsed;
/**
* fix status,N/A
* fix状态 未使用
*/
public int fixSat;
/**
* Location type,N/A
* 定位方式 未使用
*/
public DroneLocationType locationType;
/**
* RTK signal type,N/A
* 接收RTK信号方式 未使用
*/
public RTKSignalType signalType;
/**
* RTK coordinate system,N/A
* RTK坐标系 未使用
*/
public int coordinateSys;
}
字段表1:DroneLocationType
public enum  DroneLocationType {
GNSS(0),RTK(1),UNKNOWN(-1);
}
字段表2:RTKSignalType
/**
* RTK signal type
* RTK信号类型
*/
public enum RTKSignalType {

/**
* None
* 无
*/
NONE(0),
/**
* Station RTK
* 基站RTK
*/
RTK_M_STATION(1),
/**
* Net RTK
* 网络RTK
*/
RTK_NET(3),
/**
* Custom RTK
* 自定义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.
* EVO的飞行控制器信息。
*/

public interface EvoFlyControllerInfo {
/**
* Gets the GPS information.
* 获取GPS信息。
* @return the GPS information.GPS信息。
*/
EvoGpsInfo getGpsInfo();

/**
* Gets the IMU state information.
* 获取IMU状态信息。
* @return the IMU state information.IMU状态信息。
*/
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
/**
* This interface is used to save GPS information.
* 此接口用于保存GPS信息。
*/

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 information of the height above mean sea level.
*
* @return the information of the height above mean sea level.
*/

float getHeightMeanSeaLevel();

/**
* Gets the GPS ground speed of the north direction.
*
* @return the GPS ground speed of north direction.
*/

int getVelocityNorth();

/**
* Gets the GPS ground speed of the east direction.
*
* @return the GPS ground speed of the east direction.
*/

int getVelocityEast();

/**
* Gets the GPS ground speed of the down direction.
*
* @return the GPS ground speed of the down direction.
*/

int getVelocityDown();

/**
* Gets the GPS ground speed.
*
* @return the GPS ground speed.
*/

int getGPSSpeed();

/**
* Gets the GPS horizontal dilution of precision (unitless).
*
* @return the GPS horizontal dilution of precision (unitless).
*/

int getHorizontalAccuracy();

/**
* Gets the GPS vertical dilution of precision (unitless).
*
* @return the GPS vertical dilution of precision (unitless).
*/

int getVerticalAccuracy();

/**
* Gets the GPS ground speed.
*
* @return the GPS ground speed.
*/

int getSpeedAccuracy();

/**
* Gets the flag to indicate if NED speed is valid.
*
* @return the flag to indicate if NED speed is valid.
*/

int getVelNedValid();

/**
* 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.
* 获取修复类型。 0-1:无修复,2:2D修复,3:3D修复。 除非类型至少是2,否则一些应用程序不会使用该字段的值,所以务必正确地填写修复类型。
* @return the fix type.修复类型。
*/
int getFixType();

/**
* Gets the number of visible satellites.
* 获取可用卫星的数目。
* @return the number of visible satellites.可用卫星的数目。
*/
int getSatellitesVisible();

/**
* 获取gps信号强度
*
* @return
*/
int getGpsLevel();

int getGpsCount();
}
接口2:ImuStateInfo
/**
* The IMU information of the aircraft.
* 无人机的IMU信息。
*/
public interface ImuStateInfo {
/**
* Gets the accelerometer of the X axis, unit: m/s2.
* 获取X轴的加速度计,单位:m/s2。
* @return the accelerometer of the X axis, unit: m/s2.X轴的加速度计,单位:m/s2。
*/
float getXAccelerometer();
/**
* Gets the accelerometer of the Y axis, unit: m/s2.
* 获取Y轴的加速度计,单位:m/s2。
* @return the accelerometer of the Y axis, unit: m/s2. Y轴的加速度计,单位:m/s2。
*/
float getYAccelerometer();
/**
* Gets the accelerometer of the Z axis, unit: m/s2.
* 获取Z轴的加速度计,单位:m/s2。
* @return the accelerometer of the Z axis, unit: m/s2. Z轴的加速度计,单位:m/s2。
*/
float getZAccelerometer();

/**
* Gets the gyroscope acceleration of the X axis, unit: rad/sec.
* 获取X轴的陀螺仪加速度,单位:rad/sec。
* @return the gyroscope acceleration of the X axis, unit: rad/sec.X轴的陀螺仪加速度,单位:rad/sec。
*/
float getXGyroscope();

/**
* Gets the gyroscope acceleration of the Y axis, unit: rad/sec.
* 获取Y轴的陀螺仪加速度,单位:rad/sec。
* @return the gyroscope acceleration of the Y axis, unit: rad/sec.Y轴的陀螺仪加速度,单位:rad/sec。
*/
float getYGyroscope();

/**
* Gets the gyroscope acceleration of the Z axis, unit: rad/sec.
* 获取Z轴的陀螺仪加速度,单位:rad/sec。
* @return the gyroscope acceleration of the Z axis, unit: rad/sec.Z轴的陀螺仪加速度,单位:rad/sec。
*/
float getZGyroscope();

/**
* Gets the accelerometer1 of the X axis, unit: m/s2.
* 获取X轴的加速度计1,单位:m/s2。
* @return the accelerometer1 of the X axis, unit: m/s2.X轴的加速度计1,单位:m/s2。
*/
float getXAccelerometer1();

/**
* Gets the accelerometer1 of the Y axis, unit: m/s2.
* 获取Y轴的加速度计1,单位:m/s2。
* @return the accelerometer1 of the Y axis, unit: m/s2.Y轴的加速度计1,单位:m/s2。
*/
float getYAccelerometer1();

/**
* Gets the accelerometer1 of the Z axis, unit: m/s2.
* 获取Z轴的加速度计1,单位:m/s2。
* @return the accelerometer1 of the Z axis, unit: m/s2.Z轴的加速度计1,单位:m/s2。
*/
float getZAccelerometer1();

/**
* Gets the gyroscope acceleration1 of the X axis, unit: rad/sec.
* 获取X轴的陀螺仪加速度1,单位:rad/sec。
* @return the gyroscope acceleration1 of the X axis, unit: rad/sec.X轴的陀螺仪加速度1,单位:rad/sec。
*/
float getXGyroscope1();

/**
* Gets the gyroscope acceleration1 of the Y axis, unit: rad/sec.
* 获取Y轴的陀螺仪加速度1,单位:rad/sec。
* @return the gyroscope acceleration1 of the Y axis, unit: rad/sec.Y轴的陀螺仪加速度1,单位:rad/sec。
*/
float getYGyroscope1();

/**
* Gets the gyroscope acceleration1 of the Z axis, unit: rad/sec.
* 获取Z轴的陀螺仪加速度1,单位:rad/sec。
* @return the gyroscope acceleration1 of the Z axis, unit: rad/sec.Z轴的陀螺仪加速度1,单位:rad/sec。
*/
float getZGyroscope1();

/**
* Gets the magnetometer of the X axis, unit: Gauss.
* 获取X轴的磁力计,单位:高斯。
* @return the magnetometer of the X axis, unit: Gauss.X轴的磁力计,单位:高斯。
*/
float getXMagnetometer();

/**
* Gets the magnetometer of the Y axis, unit: Gauss.
* 获取Y轴的磁力计,单位:高斯。
* @return the magnetometer of the Y axis, unit: Gauss.Y轴的磁力计,单位:高斯。
*/
float getYMagnetometer();

/**
* Gets the magnetometer of the Z axis, unit: Gauss.
* 获取Z轴的磁力计,单位:高斯。
* @return the magnetometer of the Z axis, unit: Gauss.Z轴的磁力计,单位:高斯。
*/
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.
* 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).
* 获取翻滚数据(Z轴姿态)。
* <p>
* Default unit: ANGLE
* 默认单位:角度
* @return the roll data (Z axis attitude).翻滚数据(Z轴姿态)。
*/
double getRoll();

/**
* Gets the pitch data (X axis attitude).
* 获取俯仰数据(X轴姿态)。
* <p>
* Default unit: ANGLE
* 默认单位:角度
* @return the pitch data (X axis attitude).俯仰数据(X轴姿态)。
*/
double getPitch();

/**
* Gets the yaw data (Y axis attitude).
* 获取偏航数据(Y轴姿态)。
* <p>
* Default unit: ANGLE
* 默认单位:角度
* @return the yaw data (Y axis attitude).偏航数据(Y轴姿态)。
*/
double getYaw();
}
字段表5:LocalCoordinateInfo
/**
* The local coordinate information for EVO.
* 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.
* 获取当前飞行高度。
* <p>
* The unit of return value is meters.
* 返回值单位为米。
* @return the current flight altitude.当前飞行高度。
*/
float getAltitude();

/**
* Gets the fly speed of X axis.
* 获取X轴的飞行速度。
* <p>
* The unit of return value is meters per second.
* 返回值的单位是米每秒。
* @return the fly speed of X axis.X轴的飞行速度。
*/
float getXSpeed();

/**
* Gets the fly speed of Y axis.
* 获取Y轴的飞行速度。
* <p>
* The unit of return value is meters per second.
* 返回值的单位是米每秒。
* @return the fly speed of Y axis.Y轴的飞行速度。
*/
float getYSpeed();

/**
* Gets the fly speed of Z axis.
* 获取Z轴的飞行速度。
* <p>
* The unit of return value is meters per second.
* 返回值的单位是米每秒。
* @return the fly speed of Z axis.Z轴的飞行速度。
*/
float getZSpeed();

/**
* Gets the horizontal speed.
* 获取水平速度。
* <p>
* The unit of return value is meters per second.
* 返回值的单位是米每秒。
* @return the horizontal speed.水平速度。
*/
float getSpeed();
}
字段表7:LocalCoordinateInfo
/**
* The local coordinate information for EVO.
* 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
/**
* 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)枚举。
*/
MainFlyState getMainFlyState();

/**
* Gets ESC error code
* 获取ESC错误代码
* Get ESC error code
* 获取ESC错误代码
*/
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.
* 说明GPS信号是否可用。
* @return the GPS signal is available or not.GPS信号是否可用。
*/
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.启用等待为true,禁用等待为false。
*/
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 .摇杆达到极限为true。
*/
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.启用飞行范围限制为true,禁用飞行范围限制为false。
*/
boolean isNearRangeLimit();

/**
* Whether the wind is too high.
* 风是否太大。
* @return Whether the wind is too high.风是否太大。
*/
boolean isWindTooHigh();

/**
* Whether to support RTK
* 是否支持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。
*/
GPS(2),
/**
* The main flight state is IOC.
* 主飞行状态为IOC。
*/
IOC(3),
/**
* The main flight state is Starpoint.
* 主飞行状态为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模式飞行。
*/
GPS_FLIGHT(5),
/**
* The aircraft is flying in IOC mode
* 无人机正以IOC模式飞行。
*/
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).
* 无人机在失去遥控器信号(无GPS信号)后在空中盘旋。
*
* <p>
* 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.
* 无人机失去遥控器信号后将保持ATTI模式5秒,如果遥控器信号未恢复,无人机将自动降落在地面。
*/
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.
* 无人机在自动驾驶任务中返航。
* <p>
* 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.
* 无人机在环绕模式下盘旋。
* <p>
* Only happened when the GPS signal is very weak. If no replies after 15s, the aircraft will exit Orbit mode.
* 只有当GPS信号很弱时才会发生。 如果15秒后仍无回复,无人机将退出环绕模式。
* </p>
*/
ORBIT_HOLD(18),
/**
* One-click short video
* 一键短片
*/
SHOOT_360(19),
EPIC(20),
RISE(21),
FADE_AWAY(22),
INTO_SKY(23),
BOOMERANG(24),
SCREW(25),
PARABOLA(26),
ASTEROID(27),
CIRCLE_ROUND(28),
DOLLY_ZOOM(29),
/**
* 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),

/**
* 全景拍照
*/
PANORAMIC_MISSION(40),

/**
* The aircraft is locked to the target.
*
* 飞行器在锁定目标状态。
*/
FlightModeLocking(41),

/**
* One-shot video (flight according to tracking).
*
* 一键短片(根据锁定飞行,测算中)。
*/
FlightModeShotVideoCalculating(42),


/**
* One-shot video is flying.
*
* 一键短片正在飞行。
*/
FlightModeShotVideoFlying(43),

/**
* One-shot video returning to home.
*
* 一键短片返回中
*/
FlightModeShotVideoGohome(44),


/**
* 环绕延时测算中
*/
ORBIT_DELAY_SHOT_CALCULATING(49),

/**
* 环绕延时执⾏中
*/
ORBIT_DELAY_SHOT_MOVING(50),

/**
* 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
public interface BaseStationInfo {

int getBaseStationBattery();

int getBaseStationRtkSignal();

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

double getLatitude();

double getLongitude();

double getHeight();

int getStatus();

int getPosType();
}

本教程到此结束,再⻅。