Legged robots must traverse complex terrain consisting of particles of varying size, shape and texture. While much is known about how robots can effectively locomote on hard ground and increasingly on homogeneous granular media, principles of locomotion over heterogeneous granular substrates are relatively unexplored. To systematically discover how substrate heterogeneity affects ambulatory locomotion, we investigate how the presence of a single boulder (3D printed convex objects of different geometries) embedded in fine granular media affects the trajectory of a small (150 g) six legged robot. Using an automated system to collect thousands of locomotion trials, we observed that trajectories were straight before the interaction with the boulder, and scattered to different angles after the interaction depending on the leg-boulder contact positions. However, this dependence of scattering angle upon contact zone was relatively insensitive to boulder shape, orientation and roughness.1 Inspired by this insensitivity, here we develop an anticipatory control scheme which uses the scattering information in coordination with a tail induced substrate jamming. Our scheme allows the robot to "envision" outcomes of the interaction such that the robot can prevent trajectory deviation before the scattering occurs. We hypothesize that (particularly during rapid running or in the presence of noisy sensors) appropriate substrate manipulation can allow a robot to remain in a favorable locomotor configuration and avoid catastrophic interactions.