Tuck removed, dashboard arm card with wave and taught poses, markers refresh by themselves
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+4
-8
@@ -23,7 +23,6 @@ from robot import arm
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1] # the project folder
|
||||
POSES_FILE = ROOT / "data" / "arm_poses.json"
|
||||
TUCK = [179.3, -88.6, -13.9, -15.8, -14.5, -121.3] # deg, arm folded beside the column (fits doorways)
|
||||
LIMITS = [360, 125, 130, 360, 120, 360] # deg, ± factory range per joint (docs/01_HARDWARE.md)
|
||||
LIMIT_MARGIN = 5.0 # deg kept away from every limit
|
||||
JOINT_SPEED = {"slow": 10.0, "normal": 25.0, "route": 40.0} # deg/s; route: empty-hand pose-graph moves (estimate)
|
||||
@@ -73,20 +72,17 @@ def tcp():
|
||||
|
||||
|
||||
def poses():
|
||||
"""Named poses: tuck plus everything taught."""
|
||||
"""Named poses: everything taught."""
|
||||
try:
|
||||
taught = json.loads(POSES_FILE.read_text())
|
||||
return json.loads(POSES_FILE.read_text())
|
||||
except FileNotFoundError:
|
||||
taught = {}
|
||||
return {"tuck": TUCK, **taught}
|
||||
return {}
|
||||
|
||||
|
||||
def teach(name):
|
||||
"""Save the current joints as pose `name`."""
|
||||
if name == "tuck":
|
||||
raise MotionError("tuck is fixed in motion.py")
|
||||
check(j := [round(v, 2) for v in joints()])
|
||||
taught = {k: v for k, v in poses().items() if k != "tuck"}
|
||||
taught = poses()
|
||||
taught[name] = j
|
||||
POSES_FILE.write_text(json.dumps(taught, indent=1))
|
||||
return j
|
||||
|
||||
Reference in New Issue
Block a user