A moving apparatus has a body, and has at least a pair of wheels, a
control unit, a direction measuring unit and at least a pair of encoders
installed on the body. The direction measuring unit coupled to the
control unit measures the direction of the body, and the control unit
obtains a first direction variation according to the direction
information. The pair of encoders coupled to the control unit measure a
speed of the pair of wheels, and the control unit obtains a second
direction variation according to information of the speed. The control
unit compares the first and second direction variations to determine
whether the direction measuring unit is temporarily dysfunction. Based on
the result of comparison, the control unit applies the information
provided by the direction measuring unit or the pair of encoders to
obtain the current direction of the body.