Goal
Add an optional "aligned" placement TSR for precise stacking — object centered on the destination face, with orientation constraints appropriate to the held object's geometry.
Current behavior
_generate_surface_place_tsrs generates TSRs with:
Bw[0,1] = ±(surface extent - margin) — lateral freedom
Bw[5] = [-π, π] — full yaw freedom
This is good for general placement ("put it somewhere on the table") but bad for stacking ("put the box exactly on top of the other box with edges aligned").
Design
Generate an additional precision TSR with:
Bw[0,1] = [0, 0] — centered on the face, no lateral freedom
- Yaw depends on held object geometry:
- Box:
Bw[5] = [0, 0] — edges aligned with destination
- Cylinder:
Bw[5] = [-π, π] — free yaw (no meaningful alignment)
- Sphere:
Bw[5] = [-π, π] — free yaw
This TSR is always emitted alongside the free-placement TSRs. The planner samples from all TSRs, so it may naturally pick the aligned one if it's easier to reach.
For explicit precise/aligned placement, the caller can filter to only the precision TSR:
robot.place("sugar_box", aligned=True) # box: centered + edges aligned
robot.place("can", aligned=True) # cylinder: centered + free yaw
robot.place("sugar_box") # all TSRs including precision
Implementation
_generate_surface_place_tsrs gets an aligned_only: bool = False parameter
- Always generates the precision TSR (Bw xy = 0, yaw per geometry type)
- If
aligned_only=False (default), also generates the free TSR
- If
aligned_only=True, only the precision TSR
place() in primitives.py passes through the aligned kwarg
GeneratePlaceTSRs reads {ns}/aligned from blackboard
LLM integration
The LLM can choose aligned placement when the user says things like:
- "stack the boxes neatly"
- "put it right on top"
- "align the edges"
- "center it"
Goal
Add an optional "aligned" placement TSR for precise stacking — object centered on the destination face, with orientation constraints appropriate to the held object's geometry.
Current behavior
_generate_surface_place_tsrsgenerates TSRs with:Bw[0,1]= ±(surface extent - margin) — lateral freedomBw[5]= [-π, π] — full yaw freedomThis is good for general placement ("put it somewhere on the table") but bad for stacking ("put the box exactly on top of the other box with edges aligned").
Design
Generate an additional precision TSR with:
Bw[0,1]= [0, 0] — centered on the face, no lateral freedomBw[5]= [0, 0] — edges aligned with destinationBw[5]= [-π, π] — free yaw (no meaningful alignment)Bw[5]= [-π, π] — free yawThis TSR is always emitted alongside the free-placement TSRs. The planner samples from all TSRs, so it may naturally pick the aligned one if it's easier to reach.
For explicit precise/aligned placement, the caller can filter to only the precision TSR:
Implementation
_generate_surface_place_tsrsgets analigned_only: bool = Falseparameteraligned_only=False(default), also generates the free TSRaligned_only=True, only the precision TSRplace()in primitives.py passes through thealignedkwargGeneratePlaceTSRsreads{ns}/alignedfrom blackboardLLM integration
The LLM can choose aligned placement when the user says things like: