An adaptive attitude controller is designed based on Barrier Lyapunov Function (BLF) to meet the state constraints caused by side window detection. Firstly, the attitude controller is designed based on the BLF, but the stabilization function is complex and its time derivative will cause “differential explosion”. Therefore, Finite-time-convergent Differentiator (FD) is used to estimate the first derivative of the stabilization function. If the tracking error is outside the BLF's convergence domain, BLF controller cannot guarantee the error global convergence. Sliding mode controller (SMC) is used to make the system's error converge to set domain, and then the BLF controller could be used to ensure that the output constraint is not violated. Uncertainties and unknown time-varying disturbances usually make the control precision worse and Nonlinear Disturbance Observer (NDO) is designed for estimation and compensation uncertainties and disturbances. The pseudo rate modulator (PSR) is used to shape the continuous control command to pulse or on-off signals to meet the requirements of the thruster. Numerical simulations show that the proposed method can achieve state constraints, pseudo-linear operation, and high accuracy.