Skip to main content

Obstacle Avoidance System Guide

Obstacle Avoidance System Guide

1. Overview

Autel fixed-wing UAVs provide two safety mechanisms: radar obstacle avoidance and terrain following.

2. Radar Obstacle Avoidance

Radar obstacle avoidance is a safety protection mechanism that uses radar to detect obstacles within the aircraft's flight range, providing alerts and taking appropriate actions when obstacles are detected.

2.1 Enable or Disable Radar Obstacle Avoidance

Example code:

val key = KeyTools.createKey(DFFlightPropertyKey.KeyRadarOCAEnable)
val keyManager = DeviceManager.getDeviceManager().getFirstDroneDevice()?.getKeyManager()
//value 0-disabled 1-enabled
keyManager.setValue(key, value, object: CommonCallbacks.CompletionCallback {
override fun onSuccess() {
SDKLog.i(TAG, "setObstacleAvoidanceSwitch onSuccess")
}

override fun onFailure(code: IAutelCode, s: String?) {
SDKLog.i(TAG, "setObstacleAvoidanceSwitch onFailure code: $code s: $s")
}
})

2.2 Get Current Radar Obstacle Avoidance Status

Example code:

val key = KeyTools.createKey(DFFlightPropertyKey.KeyRadarOCAEnable)
val keyManager = DeviceManager.getDeviceManager().getFirstDroneDevice()?.getKeyManager()
keyManager.getValue(key, object: CommonCallbacks.CompletionCallbackWithParam<Int> {
override fun onSuccess(t Int?) {
//t 0-disabled 1-enabled
SDKLog.d(TAG, "getObstacleAvoidanceSwitch onSuccess: $t");
}

override fun onFailure(code: IAutelCode, s: String?) {
SDKLog.d(TAG, "getObstacleAvoidanceSwitch onFailure code: $code s: $s")
}
})

3. Terrain Following

Terrain following refers to the UAV's ability to adjust its flight altitude based on terrain elevation data during waypoint missions, avoiding collision risks due to terrain variations.

3.1 Enable or Disable Terrain Following

Before starting a waypoint mission, you can decide whether to enable the terrain following feature based on your needs.

Example code:

val key = KeyTools.createKey(DFFlightPropertyKey.KeyFmsTFEnable)
val keyManager = DeviceManager.getDeviceManager().getFirstDroneDevice()?.getKeyManager()
//value 0-disabled 1-enabled
keyManager.setValue(key, value, object: CommonCallbacks.CompletionCallback {
override fun onSuccess() {
SDKLog.i(TAG, "set KeyFmsTFEnable onSuccess")
}

override fun onFailure(code: IAutelCode, s: String?) {
SDKLog.i(TAG, "set KeyFmsTFEnable onFailure code: $code s: $s")
}
})

3.2 Get Current Terrain Following Status

Example code:

val key = KeyTools.createKey(DFFlightPropertyKey.KeyFmsTFEnable)
val keyManager = DeviceManager.getDeviceManager().getFirstDroneDevice()?.getKeyManager()
keyManager.getValue(key, object: CommonCallbacks.CompletionCallbackWithParam<Int> {
override fun onSuccess(t Int?) {
//t 0-disabled 1-enabled
SDKLog.i(TAG, "get KeyFmsTFEnable onSuccess $t")
}

override fun onFailure(code: IAutelCode, s: String?) {
SDKLog.d(TAG, "get KeyFmsTFEnable onFailure code: $code s: $s")
}
})