I experienced a crash recently on a copter running ArduCopter 4.5.7. We were flying without any GPS onboard and running VIO. The EKF parameters used were as following:
At the time, before takeoff the UAV was in ALT_HOLD mode in EKF lane 1. The takeoff was performed manually by a safety pilot. The VIO was initialized in flight, resulting in ~0m altitude while in hover. Following this, the pilot switched the EKF lane to 2 via controller, which caused a sudden drop in altitude and crash. Analyzing logs, namely CTUN messages, we have verified that after the switch the VISION_POSE altitude appears to be fed as the desired altitude.
The following plot and log file were obtained via simulation to replicate the issue. Here I send a constant dummy z position via VISION_POSE.
i think if u are using Visual Odometry so your Ek3src1posz should be external vision only then only Flight controller can utilize the visual odom for althold otherwise it will use barometer
in indoor enviorment barometer has many fluctuations so use external vision only
We are flying outdoor and trying to use barometer for both EKF lanes as altitude source. And to reiterate the issue, despite having barometer set for both lanes, on the described situation, the EKF from lane 2 seems to follow the external vision odometry altitude.
Red is Baro Altitude , Green is EK3 estimator outputs , blue is Visual Odometry Position Z
EK3 is only using Barometer as an input for Z directions as per this BLog
I understand what you are saying, however I would call your attention to the lane switch performed at around 11:56:00, which triggered a sudden change is desired altitude. Most of the starting data is idle or a quick takeoff-land sequence to about 2m for data checks, I would focus on the last part around the timestamp I mention.