固定 HHD 下采样并标记三轴力单位
避免运行中改变 HHD 测量配置,并明确部分标定时各轴单位。已通过 SDK 与共享层测试。
This commit is contained in:
@@ -246,24 +246,16 @@ def test_read_info_force_stays_raw_without_calibration_json(monkeypatch):
|
||||
sensor.disconnect()
|
||||
|
||||
|
||||
def test_configure_hhd_downsample_invalidates_solver_cache():
|
||||
def test_hhd_downsample_is_fixed_by_sensor_config():
|
||||
sensor = _external_sensor()
|
||||
try:
|
||||
sensor._hhd_downsample = 1
|
||||
sensor._Sensor__hhd = object()
|
||||
sensor._hhd_grid_shape = (40, 40)
|
||||
sensor.valid_mask = np.ones((90, 90), dtype=bool)
|
||||
sensor.valid_mask_hhd = sensor.valid_mask
|
||||
|
||||
sensor.configure(hhd_downsample=3)
|
||||
assert sensor._hhd_downsample == 3
|
||||
assert sensor._Sensor__hhd is None
|
||||
assert sensor._hhd_grid_shape is None
|
||||
assert sensor.valid_mask_hhd is not None
|
||||
assert sensor.valid_mask_hhd.shape == (30, 30)
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
sensor.configure(hhd_downsample="nope")
|
||||
configured = sensor._config["tracker"]["hhd_downsample"]
|
||||
assert sensor._hhd_downsample == configured
|
||||
sensor.configure(force_median_window=3)
|
||||
assert sensor._hhd_downsample == configured
|
||||
assert "hhd_downsample" not in sensor.filters_state()["measurement"]
|
||||
with pytest.raises(TypeError):
|
||||
sensor.configure(hhd_downsample=1)
|
||||
finally:
|
||||
sensor.disconnect()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user