I want to use a MPU9150 to give me the position (XY) and heading (angle) of a wheeled robot. This MPU9150 from invensense has a Digital Motion Processor in it which can give me a quaternion. But how do I convert this quaternion data to an XY-coordinate and an angle so I can plot the position of my vehicle?
The quaternion only contains information about the rotation of the vehicle. It will not contain information about the location of you vehicle on a 2-d plane.
One method of converting quaternions to euler angles is to create the transformation matrix that is defined by the rotation and get the euler angles from that.