# Yaw tracking slowly when using external vision pose EKF2

**URL:** <https://discuss.px4.io/t/yaw-tracking-slowly-when-using-external-vision-pose-ekf2/4113>\
**Category:** Uncategorized\
**Created:** [August 10, 2017, 6:01pm UTC](https://discuss.px4.io/t/yaw-tracking-slowly-when-using-external-vision-pose-ekf2/4113 "2017-08-10T18:01:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chengshy](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/f19dbf/32.png) [@chengshy](https://discuss.px4.io/u/chengshy)\
**Post date:** [August 10, 2017, 6:01pm UTC](https://discuss.px4.io/t/yaw-tracking-slowly-when-using-external-vision-pose-ekf2/4113/1 "2017-08-10T18:01:02Z")

</div>

Recently, I started playing with PX4 EKF2 for sensor fusion. I really appreciate all the work you have done here!

I tested the combination with magnetometer and optical flow. The state estimation works great in both walking test and flying test. However, I have encountered some problem after I started test External vision pose fusion.

Current setup for me is only mocap pose feed in as external yaw heading and primary height source.

EKF2\_AID\_MASK is set to 16 ( vision yaw fusion)  
EKF2\_EV\_DELAY is set to 50ms (The data is captured by optitrack system)  
EKF2\_DECL\_TYPE, EKF2\_GPS\_CHECK are set to 0.  
EKF2\_MAG\_TYPE is set to none (The idea is not using mag at all)  
EKF2\_HGT\_MODE is set to vision  
The height tracking is quite good but yaw track not. When I check the log data, the innovation\_check\_flag shows a reading 64 very frequently which I believe it means heading rejection. Then I check the innovation of the heading, it seems saturated most time. I tried to set EKF2\_EVA\_noise as 0.01 at begining because I think mocap system should be fairly accurate. In that case, the innovation\_var for heading is very small. Then I released the EKF2\_EVA\_noise to 0.3 rad as the default setting for mag\_heading as a hack, but the yaw tracking is still not good. I tested both lastest commit at this momment c230663 also this version [GitHub - PX4/PX4-ECL at 9b6e1ab2a7bf1787842ea9f0acb4008363b5af06](https://github.com/PX4/ecl/tree/9b6e1ab2a7bf1787842ea9f0acb4008363b5af06).

I am not sure what cause the heading innovation be so big so I am looking for help now. If anyone can give some directions I should look into that will be great.

 ![](https://discuss.px4.io/uploads/default/original/2X/2/23f6abfc926da75afd512f32bd1a84b2d6a52649.png)

 ![](https://discuss.px4.io/uploads/default/original/2X/b/ba1f99126dcfe28299cfe8cd924b1d0bc9a63e89.png)
