The invention discloses a course angle obtaining method based on an inertial sensor. The course angle obtaining method comprises the following steps: firstly, course angles are independently calculated by using measured values of a
gyroscope and a
magnetometer, and then weight fusion is carried out on two results. Specifically, when the course angle is calculated by using the
gyroscope, integration is performed on a z-direction angular speed under a carrier coordinate
system, which is measured by the
gyroscope, wherein whether the integration is carried out or not is judged according to a size relation between a total angular speed at the current moment and a threshold value; when the course angle is calculated by using the
magnetometer, a horizontal plane of a
geographic coordinate system is divided into eight quadrants,
magnetic field strength values measured by the
magnetometer are projected to the horizontal plane and correspond to the specific quadrants according to a horizontal plane axis and
magnetic field strength components in the axial direction, and in each quadrant, an existing course angle calculation formula is corrected by adopting different correction factors; finally,
a weighting coefficient is set by using a variance yield of the angular speed and the course angles calculated by the two methods are fused. According to the course angle obtaining method, the accurate course angle value can be obtained so that the positioning precision is high.