Opti-track, mocap and mavros data orientation

Hi,
I’m using LPE firmware burned on px4 autopilot with external heading option (mocap heading), The autopilot is connected to odroidXU3 board that runs ROS kinetic versionand. I am also using opti-track system for the indoor test below.

The problem is as the following:
If I rotate the drone clockwise (in Yaw) the orientation signs for x, y, z and w from the /mavros/local position/pose topic are the same as the data signs that is coming from /mavros/mocap/pose . However, if the drone is rotated counter clockwise the orientation signs are swapped in these two topics (similar problem is shown in the figure below that was posted in this page mocap/pose only updating position in local_position/pose .. orientation data wrong. · Issue #510 · mavlink/mavros · GitHub)

I tried to fly the drone in position hold mode and I got the following results (please see the yaw - third and fourth figures- as I think the problem appeared there

The performance of the drone when switched to position hold was unstable and the plots below for the local position show that

Any suggestion ??

Hello I am having a similar issue where direction of yaw seems to switch unpredictably. I’m using kinetic, pixhawk, and ux4 – but EKF2 instead of LPE. Did you find a fix?