Locomotion of robotic pill. a) Photograph of the pill illustrating the inner magnetic field direction (M). b) Scheme and photograph of the walking locomotion mechanism based on the response to an external magnetic field (H). c) Time-lapse image of directed locomotion of a pill. d) Locomotion of a robotic pill through rough terrain composed of small rocks. e) Robotic pill locomotion through an obstacle course containing ramps and two elevated platforms separated by a gap. f) Locomotion of a robotic pill over a pork belly strip. g) Time lapse images (i-vi) of robotic pill to transport and rearrange small cubes. h) Simultaneous actuation of four robotic pills and their assembly into a larger structure. Scale bar: 5 mm.