I am trying to make a simple simulation where an iiwa arm picks up foam bricks from a tower. However I have been running into issues finding a way to generate multiple bricks and moving them. The block of code below is how I am currently generating this tower, but this results in the bricks being unable to move the Z plane that they are generated on.
sdf = FindResourceOrThrow("drake/examples/manipulation_station/models/061_foam_brick.sdf")
z=0.35
for i in range(2):
planar_joint_frame = plant.AddFrame(FixedOffsetFrame("planar_joint_frame", plant.world_frame(), RigidTransform(RotationMatrix.MakeZRotation(np.pi/2),[-0.4, 0.2, z])))
instance = parser.AddModelFromFile(sdf, f"object{i}")
plant.AddJoint(PlanarJoint(f"joint{i}", planar_joint_frame, plant.GetFrameByName("base_link", instance), damping=[0,0,0]))
z+=0.05
Is there another way to generate multiple models that can be manipulated by the iiwa arm?