added motion trajectory simulation
This commit is contained in:
@@ -179,15 +179,24 @@ def default_preferences() -> dict[str, Any]:
|
||||
#: The UV-space texture for the flat picker. Preferred over the derived
|
||||
#: path when it exists; empty falls back to the layout map.
|
||||
"finger_texture_path": DEFAULT_FINGER_TEXTURE,
|
||||
#: The mounting plate lifts the sensor along the platform's tool axis, so
|
||||
#: a fixture thickness is one number rather than a transform.
|
||||
"finger_plate_thickness_mm": 0.0,
|
||||
#: Tool tip offset from the platform reference, mm.
|
||||
"finger_tool_offset_mm": [0.0, 0.0, 0.0],
|
||||
#: Stage travel, degrees. The bench's figures: pitch turns continuously,
|
||||
#: yaw is limited — and that limit is what decides how much of the patch
|
||||
#: can be aligned at all.
|
||||
"finger_yaw_limit_deg": 90.0,
|
||||
#: How the sensor actually sits on the stack when the machine is at zero:
|
||||
#: x/y/z translation along the table's axes and a yaw about its z. **The z
|
||||
#: is the mounting plate**, so the plate is not a setting of its own — it
|
||||
#: lifts the sensing face and does nothing else, and two fields for one
|
||||
#: number drift apart.
|
||||
"finger_sensor_offset_mm": [0.0, 0.0, 0.0],
|
||||
"finger_sensor_yaw_deg": 0.0,
|
||||
#: Where the tool is, in the table frame, mm. Straight above the table
|
||||
#: origin unless the real machine says otherwise; every XY move is measured
|
||||
#: against it, so it is what makes the reported move match the bench. A tool
|
||||
#: tip offset belongs here — it used to be a separate field, and having two
|
||||
#: of them is what let the picture and the numbers disagree.
|
||||
"finger_tool_xy_mm": [0.0, 0.0],
|
||||
#: Stage travel, degrees. Confirmed at the bench: the vertical stage turns
|
||||
#: a full half-turn either way (±180), and the horizontal stage turns
|
||||
#: continuously. An earlier value of 90 was wrong and made half the patch
|
||||
#: look unreachable when it is not.
|
||||
"finger_yaw_limit_deg": 180.0,
|
||||
"finger_pitch_limit_deg": 360.0,
|
||||
}
|
||||
|
||||
@@ -199,6 +208,43 @@ def load_preferences() -> dict[str, Any]:
|
||||
axis_params = prefs.setdefault("axis_params", {})
|
||||
for axis, values in _default_axis_params().items():
|
||||
axis_params.setdefault(axis, values)
|
||||
|
||||
# The mounting plate used to be a setting of its own. It is now the z of the
|
||||
# sensor's mounting pose, so a stored value is carried over rather than quietly
|
||||
# dropped — a machine that had it tuned would otherwise come back 4 mm off.
|
||||
plate = prefs.pop("finger_plate_thickness_mm", None)
|
||||
try:
|
||||
plate = float(plate) if plate is not None else 0.0
|
||||
except (TypeError, ValueError):
|
||||
plate = 0.0
|
||||
offset = prefs.get("finger_sensor_offset_mm")
|
||||
offset = list(offset) if isinstance(offset, list) else [0.0, 0.0, 0.0]
|
||||
while len(offset) < 3:
|
||||
offset.append(0.0)
|
||||
if plate and not offset[2]:
|
||||
offset[2] = plate
|
||||
prefs["finger_sensor_offset_mm"] = offset
|
||||
|
||||
# The tool tip offset used to be a vector added to the reported coordinates
|
||||
# while the drawing ignored it, so the picture and the numbers disagreed by
|
||||
# exactly that much. It is the tool's position now: fold a stored x/y into it,
|
||||
# and take whatever is left out of the document so nothing reads it again. Its
|
||||
# z had no meaning the model kept — the tool's height is the Z axis's job — so
|
||||
# it is dropped, deliberately and visibly rather than silently applied.
|
||||
legacy = prefs.pop("finger_tool_offset_mm", None)
|
||||
tool = prefs.get("finger_tool_xy_mm")
|
||||
tool = list(tool) if isinstance(tool, list) else [0.0, 0.0]
|
||||
while len(tool) < 2:
|
||||
tool.append(0.0)
|
||||
if isinstance(legacy, list) and len(legacy) >= 2:
|
||||
for index in range(2):
|
||||
try:
|
||||
value = float(legacy[index])
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
if value and not tool[index]:
|
||||
tool[index] = value
|
||||
prefs["finger_tool_xy_mm"] = tool
|
||||
return prefs
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user