A non-volatile computer-readable storage medium, configured to store computer program instructions, wherein the computer program instructions, when executed by a processor, implements a method for determining a relative orientation between a user device and a target device, the user device being provided with a first inertial measurement unit, the target device being provided with a second inertial measurement unit, the method comprising:
- obtaining a predicted state vector, wherein the predicted state vector is determined based on data acquired by the first inertial measurement unit and data acquired by the second inertial measurement unit, and the predicted state vector comprises at least one of following two configurations:
- a predicted relative position, a predicted relative orientation, and a predicted relative velocity between the user device and the target device;
- and a first predicted position, a first predicted orientation, and a first predicted velocity of the user device in a world coordinate system, and a second predicted position, a second predicted orientation, and a second predicted velocity of the target device in the world coordinate system;
- obtaining a preset observed relative position between the user device and the target device;
- determining a first error between the preset observed relative position and the predicted relative position, wherein the predicted relative position satisfies one of the following two conditions:
- the predicted relative position is the predicted relative position in the predicted state vector, and the predicted relative position is determined based on the first predicted position and the second predicted position in the predicted state vector;
- and
- correcting the predicted state vector using the first error to obtain an corrected relative orientation between the user device and the target device.