In the oil and gas drilling engineering, measurement-while-drilling (MWD) system is usually used to provide real-time monitoring of the position and orientation of the bottom hole. Particularly in the rotary steerable drilling technology and application, it is a challenge to measure the spatial attitude of the bottom drillstring accurately in real time while the drillstring is rotating. A set of “strap-down” measurement system was developed in this paper. The triaxial accelerometer and triaxial fluxgate were installed near the bit, and real-time inclination and azimuth can be measured while the drillstring is rotating. Furthermore, the mathematical model of the continuous measurement was established during drilling. The real-time signals of the accelerometer and the fluxgate sensors are processed and analyzed in a time window, and the movement patterns of the drilling bit will be observed, such as stationary, uniform rotation, and stick–slip. Different signal processing methods will be used for different movement patterns. Additionally, a scientific approach was put forward to improve the solver accuracy benefit from the use of stick–slip vibration phenomenon. We also developed the Kalman filter (KF) to improve the solver accuracy. The actual measurement data through drilling process verify that the algorithm proposed in this paper is reliable and effective and the dynamic measurement errors of inclination and azimuth are effectively reduced.