This paper presents a body-fixed-sensor (BFS) based approach for quantifying compensatory trunk movements during unconstrained walking. Orientation of trunk segments was calculated by fusing low-pass filtered accelerometer data and high-pass filtered data from gyroscopes. To evaluate accuracy, frontal plane angular movements of the pelvis during different treadmill walking conditions were compared to results based on a high-accuracy camera system. Mean differences between the two methods remained within 0.31 degrees , standard deviations of differences within 1.4 degrees and error percentages within 17.7%. Correlations ranged from 0.87 to 0.99. To test whether the method could discriminate between hip arthroplasty patients with and without compensatory trunk movements, the BFS based method was applied to patients and healthy controls during overground walking. Within a walking speed range of 0.40-1.10 m/s, the peak-to-peak amplitudes of trunk movements ranged from 5.7 degrees to 7.9 degrees in healthy subjects and from 13.5 degrees to 26.3 degrees versus 7.4 degrees to 13.8 degrees in patients with and without compensatory trunk movements, respectively. The presented BFS based approach can be used to assess spatio-temporal gait parameters and trunk movements and thus to objectively monitor gait function in hip arthroplasty patients in a clinical setting.