I know that almost every spacecraft uses a gyroscope to determine its orientation, but I don't know if an accelerometer could also be used in addition to a magnetometer to calculate it.
I have been trying to figure it out searching on the internet but all articles say that it can only be done if the accelerometer only reads gravity, in other words, if it is not moving at all. They use a gravity vector as a reference and then calculate the needed rotation to transform body coordinates into fixed ones. Does it mean that this configuration can't be used to determine the orientation of a rocket in motion and have to rely on the gyroscope measurements?