龙鱼心跳及告警信息使用教程
无人机心跳信息说明
1. 概述
龙鱼心跳信息是以2HZ为频率的上报信息。心跳信息包含了告警信息,飞行状态相关信息,自检状态,指南里校准信息等。
2. 无人机心跳信息使用说明
2.1 监听心跳信息
接口定义:
val KeyDroneLfNtfy: AutelKey<DroneKeyInfoLFNtfyBean> = KeyTools.createKey(CommonKey.KeyDroneLfNtfy)
示例代码:
val KeyDroneLfNtfy: AutelKey<DroneKeyInfoLFNtfyBean> = KeyTools.createKey(CommonKey.KeyDroneLfNtfy)
val CallBack = object : CommonCallbacks.KeyListener<DroneKeyInfoLFNtfyBean> {
override fun onValueChange(oldValue: DroneKeyInfoLFNtfyBean?, newValue: DroneKeyInfoLFNtfyBean) {
val heartBeanInfo = newValue.getDFHeartBeanInfo()
}
}
//开始监听
DeviceManager.getDeviceManager().getFirstDroneDevice()?.getKeyManager()?.listen(key, CallBack)
//取消监听
DeviceManager.getDeviceManager().getFirstDroneDevice()?.getKeyManager()?.cancelListen(key, CallBack)
2.2 心跳接口说明
/**
* 龙鱼心跳信息管理
* DragonFish HeartBeat Information Manager
*/
object DFHeartBeatInfo {
/**
* 重置参数
* Resets the data to initial state
*/
fun resetData()
/**
* 心跳数据是否无效
* Checks if the heartbeat data is invalid
*/
fun isInValid(): Boolean
/**
* 飞行状态:手动、自动
* Gets the main flight status:Manual or Auto.
*/
fun getMainFlyState(): MainFlyState {
return MainFlyState.findEnum(this.alarmStatus2 and 0x0f)
}
/**
* 飞行形态
* Gets the flight state
*/
fun getFlightState(): FlightState
/**
* 飞行模式
* Gets the flight mode.
*/
fun getFlyMode(): FlyMode
/**
* 龙鱼自检状态
* Auto self-check status
*/
fun getAutoCheckStatus(): AutoCheckStateEnum
/**
* 所有机翼状态
* Gets the status of all wings
*/
fun getAllWingStatus(): AllWingStatus
/**
* 电池告警
* Gets the battery warning status
*/
fun getBatteryWarning(): BatteryWarning
/**
* 获取指南针校准状态
* Gets the compass calibration status
*/
fun getCompassStatus(): DFCalibrateCompassStatus
/**
* 姿态是否异常
* Checks if the attitude is abnormal
*/
fun isAttitudeValid(): Boolean
/**
* 机头方向无效来判断指南针状态是否有效
* Checks if the compass status is valid based on the invalid head direction
*/
fun isCompassValid(): Boolean
/**
* 声呐是否有效
* Checks if the sonar is valid
*/
fun isSonarValid(): Boolean {
return ((this.alarmStatus1 shr 6 and 0x1) == 1)
}
/**
* 空速计是否有效
* Checks if the airspeed sensor is valid
*/
fun isAirspeedValid(): Boolean
/**
* GPS是否有效
* Checks if the GPS is valid
*/
fun isGpsValid(): Boolean
/**
* 飞机RTK有异常
* Checks if the RTK is abnormal
*/
fun isRTKValid(): Boolean
/**
* 遥控器是否连接
* Checks if the RC is connected
*/
fun isRcConnected(): Boolean
/**
* 飞机是否能起飞
* Checks if the aircraft can take off
*/
fun isCanTakeOff(): Boolean
/**
* 超过限高告警
* Tells whether the aircraft reaches the max altitude.
* */
fun isReachMaxHeight(): Boolean
/**
* 超过最远距离告警
* Tells whether the aircraft reaches the max distance.
*/
fun isReachMaxRange(): Boolean
/**
* 飞控模块温度过高
* Checks if the flight control module is too hot
*/
fun isFCHot(): Boolean
/**
* 电池温度过高
* Checks if the battery is too hot
*/
fun isBatteryHot(): Boolean
/**
* 获取禁飞区警报错误码
* Gets the airport warning error code
*/
fun getAirportWarning(): AirportWarningEnum
/**
* IMU0是否有效
* Checks if IMU0 is valid
*/
fun isIMU0Valid(): Boolean
/**
*IMU1是否有效
* Checks if IMU1 is valid
*/
fun isIMU1Valid(): Boolean
/**
* 磁力计0是否有效
* Checks if magnetometer0 is valid
*/
fun isMagnetometer0Valid(): Boolean
/**
* 磁力计1是否有效
* Checks if magnetometer1 is valid
*/
fun isMagnetometer1Valid(): Boolean
/**
* 气压计0是否有效
* Checks if barometer0 is valid
*/
fun isBarometer0Valid(): Boolean
/**
* 气压计1是否有效
* Checks if barometer1 is valid
*/
fun isBarometer1Valid(): Boolean
/**
* 升降舵通讯状态是否正常
* Checks if the elevator state communication is normal
*/
fun isElevatorStateCommunicationNormal(): Boolean
/**
* 固件是否激活
* Checks if the firmware is activated
*/
fun isFirmwareFlagActive(): Boolean
/**
* RTK 航向是否有效
* Checks if the RTK heading is valid
*/
fun isRtkHeadingValid(): Boolean
/**
* CPU温度是否正常
* Checks if the CPU temperature is normal
*/
fun isCpuTemperatureNormal(): Boolean
/**
* 控板子温度是否正常
* Checks if the FMU board temperature is normal
*/
fun isFmuBoardTemperatureNormal(): Boolean
/**
* 天线1是否连接
* Checks if the antenna1 is connected
*/
fun isAntenna1Connected(): Boolean
/**
* 天线2是否连接
* Checks if the antenna2 is connected
*/
fun isAntenna2Connected(): Boolean
/**
* 天线1是否短路
* Checks if the antenna1 is normal
*/
fun isAntenna1Normal(): Boolean
/**
* 天线2是否短路
* Checks if the antenna2 is normal
*/
fun isAntenna2Normal(): Boolean
/**
* 飞控SD卡是否正常
* Checks if the FMU SD card is normal
*/
fun isFmuSdcardNormal(): Boolean
/**
* Usb调试口是否正常
* Checks if the USB debug port is normal
*/
fun isUsbDebugNormal(): Boolean
/**
* 飞控风扇是否正常
* Checks if the FMU fan is normal
*/
fun isFmuFanNormal(): Boolean
/**
* 是否需要弹出自检框
* Checks if the need to pop up the self-check box
*/
fun isNeedChecking(): Boolean
/**
* 飞控固件版本不匹配
* Flight controller firmware version mismatch
**/
fun isModelMatch(): Boolean
/**
* 左侧机翼是否正常
* Checks if the left wing is normal
*/
fun isLeftWingNormal(): Boolean
/**
* 右侧机翼是否正常
* Checks if the right wing is normal
*/
fun isRightWingNormal(): Boolean
/**
* 前向感知系统(雷达)是否正常
* Checks if the forward sensing system (radar) is normal
*/
fun isForwardSensingSystemNormal(): Boolean
/**
* RTK通讯是否正常
* Checks if the RTK communication is normal
* */
fun isRTKCommunicationNormal(): Boolean
/**
* GPS通讯是否正常
* Checks if the GPS communication is normal
* */
fun isGpsCommunicationNormal(): Boolean
/**
* 执行器通讯是否正常
* Checks if actuator communication is normal
**/
fun isActuatorCommunicationNormal(): Boolean
/**
* 导航姿态是否正常
* Checks if navigation attitude is normal
*/
fun isNavigationAttitudeNormal(): Boolean
/**
* 固定翼自动飞行高度过低
* Fixed-wing automatic flight altitude is too low
*/
fun isFixedWingLowHeight(): Boolean
/**
* 升降舵状态是否正常
* Checks if elevator state is normal
*/
fun isElevatorStateNormal(): Boolean
/**
* 电机电调状态是否正常
* Checks if motor ESC state is normal
*/
fun isEscStateNormal(): Boolean
/**
* 移动基站 RTK 信息是否有效 (在使用移动基站模式下可用,StationType = StationType.MDBS)
* Checks if mobile base station RTK information is valid (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKValid(): Boolean
/**
* 移动基站 RTK Heading2 信息是否有效 (在使用移动基站模式下可用,StationType = StationType.MDBS)
* Checks if mobile base station RTK Heading2 information is valid (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKHeadingTwoValid(): Boolean
/**
* 移动基站 RTK Heading 信息是否有效 (在使用移动基站模式下可用,StationType = StationType.MDBS)
* Checks if mobile base station RTK Heading information is valid (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKHeadingValid(): Boolean
/**
* 移动基站 RTK 位置信息是否有效 (在使用移动基站模式下可用,StationType = StationType.MDBS)
* Checks if mobile base station RTK position information is valid (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKPositionValid(): Boolean
/**
* 移动基站 RTK 速度信息是否有效(在使用移动基站模式下可用,StationType = StationType.MDBS)
* Checks if mobile base station RTK speed information is valid (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKSpeedValid(): Boolean
/**
* 移动基站 RTK 姿态信息是否正常(在使用移动基站模式下可用,StationType = StationType.MDBS)
* Checks if mobile base station RTK attitude information is normal (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKAttitudeNormal(): Boolean
/**
* 移动返航点信息是否正常(在使用移动基站模式下可用, StationType = StationType.MDBS)
* Checks if mobile return home point information is normal (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isMoveHomePositionNormal(): Boolean
/**
* 移动基返航点精度差是否正常(在使用移动基站模式下可用, StationType = StationType.MDBS)
* Checks if the mobile return home point precision is normal (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isMoveHomePrecisionNormal(): Boolean
/**
* 是否需要同步电子围栏信息
* Checks if the need to synchronize electronic fence information
*/
fun isNeedUploadGenFence(): Boolean
/**
* 当前是由主设备还是从设备控制飞机
* Checks if the current is controlled by the main device or the slave device
*/
fun isMainDevice(): Boolean
/**
* 是否处于受限制的国家禁飞区内
* Checks if the current is in the restricted country no-fly zone
*/
fun isInRestrictedCountryNoFlyZone(): Boolean
/**
* 低电量返航提示标志位
* Low battery return home prompt flag
*/
fun isLowBatteryReturnHomePromptFlag(): Boolean
/**
* 严重低电量降落标志位
* Serious low battery landing flag
*/
fun isLowBatteryLandFlag(): Boolean
/**
* 导航位置信息
* Navigation position information
*/
fun isNavigationPositionNormal(): Boolean
/**
* 磁航向与RTK航向是否吻合
* Checks if the magnetic heading and RTK heading are consistent
*/
fun isNavigationAndRTKNormal(): Boolean
/**
* 磁力计通讯是否正常
* Checks if the magnetometer communication is normal
*/
fun isMagnetometerCommunicationNormal(): Boolean
/**
* 磁力计参数更新失败
* Checks if the magnetometer parameter update failed
*/
fun isMagnetometerParameterFailed(): Boolean
/**
* 结合flightMode 判断目标是否属于打击范围内
* Checks if the target is in the attack range based on flightMode
*/
fun isTargetATTKRange(): Boolean
/**
* 左机翼动力机型与机身是否匹配
* Checks if the left wing power model matches the body
*/
fun isLeftWingPowerModelMatch(): Boolean
/**
* 右机翼动力机型与机身是否匹配
* Checks if the right wing power model matches the body
*/
fun isRightWingPowerModelMatch(): Boolean
/**
* 视觉有效性
* Vision system validity
*/
fun isVisualValid(): Boolean
}