I'm encountering an issue with body tracking in ARKit. The problem arises when the body turns their back towards the camera; the BodyTrackedEntity does not work accurately in certain scenarios.
For instance, the head and body rotations seem to diverge - the head might start rotating from left to right, while the body rotates from right to left, leading to inaccurate tracking.
It appears that the head's rotation significantly impacts the rotation estimation of the entire body. Is there a way to exclude certain joints from the tracking process? Alternatively, can I manually adjust the joints of my BodyTrackedEntity? There are occasions when I prefer not to set their position or rotation.
Below are screenshots from the detection process, and my current implementation code:
var character: BodyTrackedEntity?
let characterAnchor = AnchorEntity()
// other configurations ok
extension CameraViewController: ARSessionDelegate {
func session(_ session: ARSession, didUpdate anchors: [ARAnchor]) {
for anchor in anchors {
if let bodyAnchor = anchor as? ARBodyAnchor {
let bodyPosition = simd_make_float3(bodyAnchor.transform.columns.3)
characterAnchor.position = bodyPosition + characterOffset
characterAnchor.orientation = Transform(matrix: bodyAnchor.transform).rotation
if let character = character, character.parent == nil {
characterAnchor.addChild(character)
}
}
}
}
}

