Pose code fails quietly. The robot still moves, the map still draws, and the numbers look plausible, but headings flip near 180°, a camera sees the floor in the sky, and a composed rotation is the wrong one of two.
You will diagnose the heading bugs from the shape of their errors, implement the quaternion algebra from scratch, and fix the classic camera optical-frame trap using a fact you can check: floor markers have z = 0.