I have done programming with similar systems, and if you are looking for how to make it field centric rather than robot centric, I just took in the joystick values as polar coordinates, which is a magnitude and direction, then converted them to cartesian coordinates but in the conversion process adjusted the angle by the angle of the gyro.
So a snippet of the code:
Code:
adjustmentAngle = gyro->GetAngle()*3.14/180+3.14/2;
x=Pilot->GetMagnitude()*cos(Pilot->GetDirectionRadians()-adjustmentAngle);
y=Pilot->GetMagnitude()*sin(Pilot->GetDirectionRadians()-adjustmentAngle);