A prosthetic or orthotic system including a sensor module and a processing module usable to determine a terrain variable, such as a terrain transition. In certain examples, the system is capable of anticipating a terrain transition prior to the user experiencing the terrain transition, which may include, for instance, a transition from level ground walking to walking on stairs or may include a change in a slope of the ground surface. In certain embodiments, the system advantageously monitors a posture and/or movement of the patient to anticipate the terrain transition. Furthermore, the system may control an actuator to appropriately adjust the prosthetic or orthotic device to encounter the anticipated terrain transition.