TimelinePacking thread · rev BJan 2025 – Aug 2025

Deep-Pack: a robot that packs a container through its door

The problem

Boxes of different sizes arrive one at a time, and a robot has to place each one in a container that opens on one side only, like a truck loaded through its back door. The aim is to fill as much of the container as possible. Each box has to rest on something solid and be reachable from the door, so a gap at the back is no use once a box in front of it blocks the way.

Team
Anush Bharathi R, Kamran B, Nilavan K J, Shibi Praveen S
Guide
Dr. P. Karthikeyan
Where
Madras Institute of Technology, Anna University
Report
B.E. final-year report, May 2025 (PDF, web edition with a note on what was corrected)
Footage of the robot we built packing boxes into the scaled container from one planned episode, ending on the packed container. 1 min 45 s.

The idea

Train the packing policy with reinforcement learning, but let it choose only among the moves this robot can physically make from the door.

1The robot

The arm has five degrees of freedom. A gantry of aluminium extrusions moves it in X and Y over a workspace of 1 m by 0.6 m, with timing belts and linear bearings. A rotary base turns the arm, and a lead screw lifts it through 0.2 m. The end effector is a pair of electromagnets that grip steel washers on one face of each box, and a servo turns them. The payload is 200 g. The container is a scaled model, 30 by 20 by 15 cm, loaded through its open side. Everything runs open loop from an Arduino Mega.

Before fabrication we checked the structure under its payload.
Static analysis (ANSYS)Value
Maximum stress0.87 MPa
Maximum deformation0.74 mm
Safety factorabove 15

A path planner turns the policy's plan into pick-and-place moves that the arm runs without feedback. We tested the policy's plans on this physical robot, as in the video at the top of this page. The physical figures in our B.E. report are not backed by logs that survived, so I don't quote them here; the web edition of the report marks them as unverified.

2How the reinforcement learning works

Next boxsize, plus onebox of lookaheadCorner candidates32 slots, twoorientations eachRobot-aware maskscorridor, envelope,reach, supportPacking Transformertrained with PPOon a GPUTwo depth viewsfrom above, andfrom the doorPlanwhere each boxgoes, in orderDigital twinIsaac Lab, physics,randomizedGantry robotfirmware commands,open loop
Fig. 1One decision. The policy only chooses among placements that pass the robot-aware masks, and its plan is run in the digital twin before it is compiled for the robot.
Fig. 2The trained policy packing containers in parallel on the GPU: 16 of the 2,048 environments, picked at even spacing before the capture. Each frame is a real environment state; every decision is held for half a second so it can be followed.
StateWhere the load is now

The container is a 60 by 40 by 30 grid of 0.5 cm cells. Two maps describe the load: the height of the stack over the floor, and, for every row of the doorway, how far towards the door the load already reaches. The second is exactly what a depth camera at the door would see.

ActionWhich spot, which way round

A generator on the GPU proposes up to 32 corner positions for the current box, each in two orientations, so the policy chooses one of 64 actions. It also sees the size of the next box.

MaskOnly moves the robot can make

Before the choice, each action is tested: the box must fit and be supported, there must be a free corridor from the door to the spot, the magnets and arm must clear the neighbours, and the arm must be able to reach the pose. Failed actions get zero probability.

PolicyA Transformer that scores spots

Item tokens and candidate tokens attend to each other in 4 blocks, and two small convolutional encoders read the top view and the door view. Each action's score is a product of its item and candidate embeddings. 2.42 M parameters.

RewardVolume, plus stability

Each placement earns its share of the container volume, so an episode's total is the final fill. Small terms reward a dense neighbourhood, good support and a centre of mass well inside it.

TrainingPPO, entirely on one GPU

2,048 containers run in parallel; each rollout is 16 steps, followed by 4 epochs of updates. 19.9 million steps in 57 minutes on one RTX 4090.

Each box also keeps 4 mm of clearance on every side. That came from the digital twin, an Isaac Lab model of the robot: plans with boxes packed flush jammed at the door 22% of the time, while plans with clearance never did.

Learning curve: space utilisation against environment steps, rising from 0.21 to about 0.45, above dashed lines for DBLF 0.382, best-fit 0.339 and random-feasible 0.226
Fig. 3Training of the main policy. The fill reached by the policy rises past every rule-based method within the first million steps (dashed lines).

3Results

20% moreof the container filled than by the best rule-based method
200 of 200plans can be loaded in the order the boxes arrive
0 of 200for the same policy trained without the robot-aware masks

The last of these numbers is the main finding. Without the robot-aware masks a policy packs just as densely on paper, but every one of its plans needs the boxes in a different order from the one they arrive in. Adding the masks only at test time does not rescue it: the fill falls to 20.1%, because it never learned to keep corridors open.

These three numbers are scored in simulation, where hundreds of plans can be checked, with clearance built in. In the twin, the policy's 10-box plan for the physical queue placed all 640 boxes across 64 randomised runs, each within 3.7 mm of its target. We then ran the policy's plans on the physical robot, as in the video at the top.

Fig. 4The policy's plan for the physical box queue, run open loop in 16 physics simulations of the robot at once, each with randomised box mass, friction, magnet strength and timing. The first three pick-and-place cycles, at twice real speed; in all 16, no box was dropped and the arm never struck the workcell.

4What's next

The policy's plans have been tested in the twin and on the physical robot, which runs them open loop. The next step is a camera at the door, which would measure exactly the door view the policy already uses, and let the robot replan as the container fills.