This question was created in reference to: [Add support for gyro motion data to Steam Controller [Content removed]
Apologies for starting a new thread, the original was permanently closed so I can’t follow up. Since the issue tracker looks like it has been scheduled for 5.7, I just wanted to share that we’ve since updated our SteamController gyro implementation to address a couple issues. The new state of the modification is as follows:
`if (UserId.IsValid() && DeviceId.IsValid())
{
ControllerMotionData_t MotionData = SteamInput()->GetMotionData(ControllerHandle);
// InputMotionData_t - For rotQuatX/rotQuatY/rotQuatZ/rotQuatW, the inertial measurement unit on the controller will create a quaternion
// based on fusing the gyro and the accelerometer. This value is the absolute orientation of the controller, but it will drift on the
// yaw axis.
const FQuat TiltQuat(MotionData.rotQuatX, MotionData.rotQuatY, MotionData.rotQuatZ, MotionData.rotQuatW);
const FRotator TiltRot(TiltQuat);
const FVector TiltVector(TiltRot.Pitch, TiltRot.Yaw, TiltRot.Roll);
// InputMotionData_t - Angular velocity is reported as an interpolated value between INT16_MIN and INT16_MAX where the extents are clamped
// to ±2000 degrees per second.
const FVector RotationRate = FVector::DegreesToRadians((FVector(MotionData.rotVelY, -MotionData.rotVelX, -MotionData.rotVelZ) / INT16_MAX) * 2000.f);
// InputMotionData_t - Positional acceleration is reported as an interpolated value between INT16_MIN and INT16_MAX where the extents are
// clamped to ±2G (1G = 9.80665 m/s2).
const FVector Acceleration = (FVector(MotionData.posAccelY, MotionData.posAccelX, MotionData.posAccelZ) / INT16_MAX) * 2.f;
MessageHandler->OnMotionDetected(
TiltVector,
RotationRate,
FVector::ZeroVector,
Acceleration,
UserId,
DeviceId
);
}`
Notably we’re now using the overload of OnMotionDetected that accepts both UserId and DeviceId since it looks like that’s the recommended method to ensure correct user mapping (though we do have [a separate [Content removed] with that that we’re working to resolve). Additionally, while the axes used in the original modification technically worked fine, as we’ve expanded our platform support we’ve decided to align the SteamController RotationRate and Acceleration with UnifyMotionSpace=1 (from one of the NDA platforms) since that looks like it’s now the default coordinate space moving forward in 5.5+.
Hope this info is beneficial.