SITL heading mismatch between ROS and FCU?

Hi guys,

I have been using Gazebo for sitl lately and I have found an interesting problem, and it might be my lack of understanding of the SITL so I hope you guys can shed some light here.

When I use px4 SITL with Gazebo with mavros_px4_sitl.launch, after launching it, the drone appears and “/mavros/local_position/pose” starts publishing and I can recover yaw from the received quaternion. To illustrate, the default frame is x forward, y left and z upward, and the yaw of the drone is 0 at the start, which is something like below:

                        +x, yaw = 0
        yaw = 180, +y <----------0    yaw = 270     
                               yaw = 180

But if I opened Qgroundcontrol at the same, I can find a totally different pattern of rotation which looks like below:

                              yaw = 90
            yaw = 0   <----------0    yaw = 180     
                               yaw = 270

As we can see, these two frames are quite different and they cannot be converted to one another with a simple yaw offset.

This problem has been found on both px4 1.8.0 and the master branch.

Can anyone help me find out what I am doing wrong here?

Thanks for any help!


ROS is in ENU frame while PX4 is in NED frame. Mavros performs the conversion between the two frames.

thanks for the heads up, I got it.