The problem is that the orientation drifts over time(MPU6050 does not have magnetometer)
That can be fixed by using a 9DOF sensor and better software, but the resulting 3D orientations won't be more accurate that +/- a few degrees.You might consider measuring the 3D position using Pozyx.
HMC5883L magnetometer with the MPU6050
can we use a GPS sensor
That will work, if you calibrate the magnetometer according to this tutorial (essential step).That won't work indoors, and the position error is way too high (+/- meters).