Step 1
Configuration space
See the wall the way a planner does: as a forbidden region in the space of joint angles.
A wall in the way
In Pick & Place the table was empty, so "lift, then swing across" always worked. Now a see-through wall stands between the balls and the cup, with a pillar at its far end. A copied Pick & Place program slams into it. Over the next steps you'll build the sampling-based planning stack that MoveIt and OMPL use to get around it.
Configuration space
Four joint angles pin down the pose of the whole arm. So every pose is a single point in a 4-D space, the configuration space (C-space). Planning a motion means drawing a curve through that space.
An obstacle is a simple box in the world. The set of configurations where the arm touches it, however, is a warped region with no neat formula:
Planners never build explicitly. They probe it one configuration at a time.
New tool: arm.in_collision(q)
It answers "what if the arm were at ?" without moving anything. It returns True if the arm would come within 5 mm of the wall, the pillar, the table, the cup or itself, or if breaks a joint limit. It always models the gripper fully open, its widest. world.obstacles lists the wall and pillar.
A 2-D slice
Four dimensions are hard to picture, so freeze two joints. Turn the base to line up with the wall () and fix the wrist (). What's left, shoulder × elbow, is a flat slice you can draw as an image with one pixel per configuration.
Your task
Implement cspace_slice(base, wrist, n). It returns an bool array where grid[i, j] is True when [base, shoulders[i], elbows[j], wrist] collides, with shoulders = np.linspace(*arm.limits[1], n) and elbows = np.linspace(*arm.limits[2], n).
Open the Images tab to see your slice. The grader compares two slices with the real C-space.