fix(perception): preserve quaternion alignment across binary ingress
This commit is contained in:
@@ -187,6 +187,21 @@ def test_cloud_validation_checks_later_bounded_chunks():
|
||||
normalized_sensor("lidar", 1, 100, struct.pack("<I", 2000) + xyz.tobytes() + bytes(2000))
|
||||
|
||||
|
||||
def test_wire_pose_owns_aligned_immutable_quaternion_with_exact_values():
|
||||
from k1link.perception.geometry_math import quaternion_xyzw_to_rotation_matrix
|
||||
|
||||
quaternion = np.array([0.1, -0.2, 0.3, 0.9273618495495703], "<f8")
|
||||
raw = np.array([1, 2, 3], "<f8").tobytes() + quaternion.tobytes()
|
||||
position, decoded = normalized_sensor("pose", 1, 100, raw).value
|
||||
assert decoded.flags.owndata and decoded.ctypes.data % 16 == 0
|
||||
assert not decoded.flags.writeable and not position.flags.writeable
|
||||
assert decoded.tobytes() == quaternion.tobytes()
|
||||
assert np.array_equal(
|
||||
quaternion_xyzw_to_rotation_matrix(decoded),
|
||||
quaternion_xyzw_to_rotation_matrix(quaternion),
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("failure", ["socket", "receiver-registration", "source-registration"])
|
||||
def test_bridge_initialization_failure_releases_unstarted_resources(monkeypatch, failure):
|
||||
monkeypatch.syspath_prepend(
|
||||
|
||||
Reference in New Issue
Block a user