优化传感器对准压头
This commit is contained in:
@@ -39,12 +39,8 @@ def _random_units(count: int, seed: int) -> list[np.ndarray]:
|
||||
|
||||
|
||||
def _apply(stack: PlatformStack, unit: np.ndarray, yaw_deg: float, pitch_deg: float) -> np.ndarray:
|
||||
"""Re-apply a returned pose with the library's own rotations."""
|
||||
return (
|
||||
rotation_about(stack.pitch_axis, pitch_deg)
|
||||
@ rotation_about(stack.yaw_axis, yaw_deg)
|
||||
@ unit
|
||||
)
|
||||
"""Re-apply a returned pose with the same rotation the drives execute."""
|
||||
return stack.platform_rotation(yaw_deg, pitch_deg) @ unit
|
||||
|
||||
|
||||
# ------------------------------------------------------------------ exactness
|
||||
@@ -108,11 +104,10 @@ def test_the_two_methods_agree_inside_the_envelope():
|
||||
|
||||
|
||||
def test_the_two_pitch_bindings_are_the_same_family():
|
||||
"""Confirmed at the bench: a 90 degree yaw takes one binding to the other.
|
||||
"""``R_y(p)·R_z(t)`` and ``R_x(p)·R_z(t − 90)`` reach the same alignments.
|
||||
|
||||
``R_y(p)·R_z(t)`` and ``R_x(p)·R_z(t − 90)`` agree to machine precision. So
|
||||
which axis is called pitch is a naming and zero-offset choice, not a
|
||||
correctness question — the two reach exactly the same set of alignments.
|
||||
This is a property of the right-hand matrices. The drive does not get to
|
||||
pick either binding: pitch is about ``x`` with the measured command sign.
|
||||
"""
|
||||
unit = np.array([0.3, 0.5, -0.81])
|
||||
unit = unit / np.linalg.norm(unit)
|
||||
|
||||
Reference in New Issue
Block a user