ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The reason the covariance is 6x6 and not 7x7 even though the quaternion has four variables is because the covariance is specified for the 3 angles that the quaternion represents, roll, pitch and yaw, not the individual components of the quaternion. That is the reason that the comments refer to roll, pitch and yaw instead of the quaternion components. If you wanted to apply those error estimates to the quaternion, you would have to either do some error propogation to get estimates for the quaternion components or (more commonly) extract the roll, pitch and yaw angles from the quaternion.
Usually we have estimates for each of those angles individually (along with their covariance) and then generate a quaternion from the three angles in order to have an unambiguous representation of the rotation. By keeping the covariance relative to roll, pitch and yaw instead of quaternion components, there is no need to do any complicated error propogation through the math that creates a quaternion from RPY.
See http://answers.ros.org/question/9446/how-do-i-compute-the-covariance-matrix-for-an/ for some discussion of how to compute the covariance.