# Land Detector on pure VIO

Source: https://forum.modalai.com/topic/1200/land-detector-on-pure-vio
Category: Flight Core and Legacy VOXL (https://forum.modalai.com/category/9/flight-core-and-legacy-voxl)
Tags: voxl-flight
Posted: 2022-08-14 12:33:55 UTC by hmlow
Replies: 1 · Views: 439

## hmlow · 2022-08-14 12:33:55 UTC

Hi all

I have a customized drone running purely on VIO (EKF2_AID_MASK == 280, GPS and mag are both not attached) with the various hardware transplanted from a seeker.

I just cant seem to get the Land Detector working when on Position mode (does not disarm on landing). Works fine on Manual/Stabilized mode though.

Just wondering if anyone knows what might be the cause.

Saw a similar topic here but unrelated:
https://forum.modalai.com/topic/471/land-detector-not-working-after-several-landings

Some of the Land Detector params that i have:

LNDMC_ALT_MAX	-1.00
LNDMC_ROT_MAX	500
LNDMC_XY_VEL_MAX	1.50
LNDMC_Z_VEL_MAX	0.50
MPC_THR_HOVER	0.51
MPC_THR_MAX	0.70
MPC_THR_MIN	0.15
COM_DISARM_LAND	0.10

Thanks

## Reply by hmlow · 2022-08-17 09:50:51 UTC

I've figured out why.

My original MPC_LAND_SPEED and MPC_Z_VEL_MAX_DN were 0.6 and 0.5 respectively.

Thanks to the following chunk of code from MulticopterLandDetector.cpp, descend_vel_sp will never be true.

```
	if (_flag_control_climb_rate_enabled) {
		vehicle_local_position_setpoint_s vehicle_local_position_setpoint;

		if (_vehicle_local_position_setpoint_sub.update(&vehicle_local_position_setpoint)) {
			// setpoints can briefly be NAN to signal resets, TODO: fix in multicopter position controller
			const bool descend_vel_sp = PX4_ISFINITE(vehicle_local_position_setpoint.vz)
						    && (vehicle_local_position_setpoint.vz >= land_speed_threshold);
```

Had to increase MPC_Z_VEL_MAX_DN and that solved my problem
