The purpose of this paper is to modify the attitude of quadruped robot body against disturbances via sensory feedback. For this goal Inertial Measurement Unit (a 3-axis gyroscope and a 3-axis accelerometer) and a 3-axis magnetometer are used. In order to use the data provided by IMU and magnetometer, it is required to design a filter to provide an estimation with proper accuracy. A Switching Extended Kalman Filter (SEKF) is used to fuse the sensory information and estimate the quadruped robot bodY attitude along with uncompensated gyro bias. In this filter, switching rule is used to separate the measurement model of EKF in the accelerated or non-accelerated motion of the robot body. Then, the body deviation is compensated using support legs based on the outputs of observer. Through numerical simulations, SEKF is compared with a nonlinear observer and its efficiency is shown. Finally, the robot body attitude is modified on a platform under ramp disturbances.