Output position GPS or dead reckoning + average IMU from pixhawk

Hey everybody !

I want to output average IMU angles of attitudes from the 29 MEMS and position from GPS connected to pixhawk or dead reckoning position if GPS position is not available.

Is it possible to do that with pixhawk 2 ?