Vehicular traveling direction measuring system
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates generally to a system for measuring a traveling direction of a vehicle and, more specifically, to a vehicular traveling direction measuring system which can derive an accurate traveling direction of a vehicle by utilizing a geomagnetic sensor and a gyro sensor. 
     2. Description of the Background Art 
     One previously proposed system for measuring a vehicle traveling direction is exemplified by Japanese First Patent Publication No. 58-34483. 
     In this publication, a system utilizing a geomagnetic sensor which provides an absolute traveling direction of the vehicle, and a gyro sensor which provides a relative variation in traveling directions of the vehicle is disclosed. The system is adapted to measure the traveling direction of the vehicle by utilizing the combination of outputs from the geomagnetic sensor and the gyro sensor, as will be described hereinbelow with reference to FIG. 1. 
     Assuming the vehicle is running in a direction P on a straight road where the geomagnetism environment is unfavorable, a traveling direction derived by the gyro sensor becomes a straight line Q which is stable and close to the direction P because the gyro sensor is, as is known, not affected by environmental geomagnetic conditions. Deviation between the directions P and Q is caused by an error due to drift of the gyro sensor. Since the error is accumulated with a lapse of time or increment of distance travelled by the vehicle, the deviation between the directions P and Q gets larger as shown in FIG. 1. On the other hand, because the direction derived by the geomagnetic sensor is affected by the environmental geomagnetism, it is exemplarily described as a sine curve R in FIG. 1. 
     Accordingly, when the vehicle traveling direction is measured solely based on the output of the geomagnetic sensor as disclosed, for example, in Japanese First Patent Publication No. 59-100812, an error between the true vehicle traveling direction P and the measured traveling direction R becomes considerably large. On the other hand, when the vehicle traveling direction is measured solely based on the gyro sensor as disclosed, for example, in Japanese First Patent Publication No. 59-202014, an error between the true vehicle traveling direction P and the measured traveling direction Q gets larger with the lapse of time as mentioned above. 
     In order to overcome the above-mentioned defects, predetermined constant lower and upper threshold levels S1 and S2 are set as shown in FIG. 1, which are selected by deriving difference between the directions R and Q measured by the geomagnetic sensor and the gyro sensor, respectively. When the direction R exceeds the threshold level S1 or S2, the direction R is corrected to be equal to the threshold level S1 or S2 so as to obtain a directional line T which is held as a measured traveling direction of the vehicle. Accordingly, the direction R obtained by the geomagnetic sensor is corrected by the direction Q obtained by the gyro sensor to reduce the error to a difference L between the threshold level and the true traveling direction P of the vehicle. 
     However, as is clear from FIG. 1, the error L is still considerably large. Therefore, when a geographical position of the vehicle is calculated using the corrected directional line T, a difference between a true position of the vehicle and a calculated position of the vehicle gets larger with the lapse of time because the error is accumulated with the lapse of time. 
     Further, because the gyro sensor is utilized only for setting the threshold levels to provide a stabler output of the geomagnetic sensor, the most advantageous aspect of the gyro sensor, that is, providing a relative directional variation with high accuracy without being affected by environmental geomagnetism, is not effectively utilized. 
     SUMMARY OF THE INVENTION 
     Therefore, it is an object of the present invention to provide a system for measuring a traveling direction of a vehicle that can eliminate the above-noted defects inherent in the background art. 
     It is another object of the present invention to provide a system for measuring a traveling direction of a vehicle that can provide an accurate measured traveling direction of the vehicle by changing, when calculating the vehicle traveling direction, a rate of dependence upon an output of a geomagnetic sensor and an output of a gyro sensor according to a derived environmental geomagnetic condition as well as a derived reliability of an output from the gyro sensor. Accordingly, an inherent feature of the geomagnetic sensor, that is, being capable of providing an absolute direction while liable to be affected by environmental geomagnetic field, and an inherent feature of the gyro sensor, that is, being capable of providing a relative directional variation with high accuracy without being affected by the environmental geomagnetic field while being subject to generation of a drift, are effectively utilized in the system. 
     To accomplish the above-mentioned and other objects, according to one aspect of the present invention, a system for measuring a traveling direction of a vehicle comprises: 
     a geomagnetic sensor, mounted to the vehicle, which produces a first output signal indicative of directional data relating to a geomagnetic field around the vehicle; a gyro sensor, mounted to the vehicle, which produces a second output signal indicative of angular variation data independently of the geomagnetic field; and a control circuit operatively connected to said geomagnetic sensor and the gyro sensor for receiving the first and second output signals to derive a traveling direction therefrom, the control circuit including: first means for deriving a first variation in a traveling direction of the vehicle based on the second output signal from the gyro sensor; second means for deriving a first vehicle traveling direction based on the first directional variation; third means for deriving a second vehicle traveling direction based on the first output signal from the geomagnetic sensor; fourth means for deriving a second variation in the second vehicle traveling direction; fifth means for deriving a first value indicative of a disturbance of the geomagnetic field on a short interval basis, the first short interval based value being derived by calculating a difference between the first and second direction variations; sixth means for deriving a second value indicative of a disturbance of the geomagnetic field on a long interval basis, the second long interval based value being derived by calculating a difference between the first and second vehicle traveling directions; seventh means for deriving a first correction value indicative of a drift error caused by the gyro sensor; and eighth means for deriving a third vehicle traveling direction based on the first and second derived vehicle traveling directions by changing a rate of dependence upon the first and second vehicle traveling direction depending on the first short interval based value, the second long interval based value and the first correction value. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The present invention will be understood more fully from the detailed description given hereinbelow and from the accompanying drawings of the preferred embodiment of the invention, which are given by way of example only, and are not intended to be limitative of the present invention. 
     In the drawings: 
     FIG. 1 is a graph of time versus direction showing the vehicular traveling direction measurement characteristics performed by the background art; 
     FIG. 2 is a schematic block diagram showing the general construction of a system for measuring a traveling direction of a vehicle according to the present invention; 
     FIG. 3 is a schematic block diagram showing a preferred embodiment of the present invention; 
     FIG. 4 is a general flowchart to be executed by a controller in the preferred embodiment of FIG. 3; 
     FIG. 5 is a flowchart showing an interrupt routine to be executed per a predetermined distance by the controller in the preferred embodiment of FIG. 3; 
     FIGS. 6A, 6B and 6C are flowcharts showing an interrupt routine to be executed per a predetermined time by the controller in the preferred embodiment of FIG. 3; 
     FIG. 7 is a graph of distance versus direction showing an influence of short distance based disturbance of the geomagnetic field upon measurement of the vehicle traveling direction; 
     FIG. 8(a) is a graph of distance versus direction showing an influence of short and long distance based disturbances of the geomagnetic field upon measurement of the vehicle traveling direction; 
     FIG. 8(b) is a graph of distance versus direction showing an influence of short distance based disturbance of the geomagnetic field upon the measurement of vehicle traveling direction; 
     FIG. 8(c) is a graph of distance versus direction showing an influence of long distance based disturbance of the geomagnetic field upon measurement of the vehicle traveling direction; 
     FIG. 9(a) is a graph showing a relationship between an elapsed time and a second gyro drift correction value α 1  derived by the preferred embodiment of FIG. 3; 
     FIG. 9(b) is a graph showing a relationship between an elapsed time and a third gyro drift correction value α 2  derived by the preferred embodiment of FIG. 3; 
     FIG. 9(c) is a graph showing a relationship between a short distance based geomagnetic environment index β and a coefficient K 1  derived by the preferred embodiment of FIG. 3; 
     FIG. 9(d) is a graph showing a relationship between a long distance based geomagnetic environment index γ and a coefficient K 2  derived by the preferred embodiment of FIG. 3; 
     FIG. 10 is a graph of distance or time versus direction showing variations of the traveling direction measurement characteristics according to values of a coefficient K derived by the preferred embodiment of FIG. 3 and 
     FIGS. 11(a)(b)(c) are graphs showing variations of short and long distance based geomagnetic environment indicies β and γ when disturbance of the long distance geomagnetic field occurs. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring now to the drawings, particularly to FIG. 2, the general and fundamental concept of a system for measuring a traveling direction of a vehicle, according to the present invention, is illustrated in a form of functional blocks. 
     As seen from FIG. 2, the system includes a geomagnetic direction measuring means (a) which provides a traveling direction of the vehicle using a geomagnetic sensor, and a gyro direction measuring means (b) which provides a traveling direction of the vehicle using a gyro sensor. The system also includes a first geomagnetic environment deriving means (c) for providing a first geomagnetic environment value β indicative of a disturbance of the geomagnetic field per short interval, for example, of the order of several meters. Specifically, the first means (c) calculates a difference between a variation of a vehicle traveling direction measured by the geomagnetic direction measuring means (a) and a variation of a vehicular traveling direction measured by the gyro direction measuring means (b), per a predetermined unit interval, such as, a predetermined unit distance travelled by the vehicle. This difference is used as the first geomagnetic environment value β. 
     Practically, the calculation by the first means (c) may be first performed per a predetermined unit time travelled by the vehicle and then converting the calculated value to a value per a predetermined unit distance travelled by the vehicle. 
     The system further includes a second geomagnetic environment deriving means (e) for providing a second geomagnetic environmet value γ indicative of a disturbance of the geomagnetic field per long interval, for example, of the order of several 10 to several 100 meters. Specifically, the second means (e) calculates a difference between the vehicle traveling direction derived by the geomagnetic direction measuring means (a) and a traveling direction of the vehicle derived based on the directional variation measured by the gyro direction measuring means and a vehicular traveling direction derived by below-noted vehicular traveling direction deriving means (d) in a prior cycle of the system, per a predetermined unit interval, such as, a predetermined unit distance travelled by the vehicle. This difference is used as the second geomagnetic environment value γ. 
     Practically, the calculation by the second means (e) may be first performed per a predetermined unit time travelled by the vehicle and then converting the calculated value to a value per a predetermined unit distance travelled by the vehicle. 
     The system further includes correction value deriving means (f) for deriving a gyro drift correction value α based on an elapsed time from a time point where a correction of a gyro sensor drift error (zero-point correction) is performed and a drift characteristic of the gyro sensor. The gyro drift correction value α is used by the vehicular traveling direction deriving means (d) for compensating an error caused by the gyro sensor drift so as to derive a vehicle traveling direction having no substantial drift error. 
     Finally, the vehicle traveling direction deriving means (d) derives the vehicle traveling direction by calculating the outputs from the geomagnetic direction measuring means (a) and the gyro direction measuring means (b), changing a rate of dependence upon those outputs based on the first and second magnetic environment values β and γ and the gyro drift correction value α. 
     Assuming that the measurement of the vehicle traveling direction is performed solely by the geomagnetic sensor, it is possible to obtain an accurate measured direction normally, i.e. when the geomagnetic disturbance is not substantial, while it is impossible to obtain an accurate measured value when the geomagnetic disturbance is substantial. On the other hand, if the measurement of the vehicle traveling direction is performed solely by the gyro sensor, a measurement error caused by the drift of the gyro sensor is accumulated with the distance travelled by the vehicle. Accordingly, it is possible to obtain a reliable result for a short distance, while largely deviating from the true traveling direction over long distances. 
     In order to utilize the features of both sensors, the system according to the present invention uses the first and second geomagnetic environment values β and γ as well as the gyro drift correction value α as described above. By varying the rate of dependence upon the geomagnetic sensor and the gyro sensor, not in an ON-OFF fashion but continuously, using the first and second geomagnetic environment values β and γ and the gyro drift correction value α, the system is capable of providing an accurate measured traveling direction without being adversely affected by the magnetic disturbance and drift of the gyro sensor. 
     Now a preferred embodiment of the vehicular traveling direction measuring system according to the present invention will be described with reference to FIGS. 3 to 11. 
     FIG. 3 shows a block diagram of the vehicular traveling direction measuring system of the preferred embodiment. In FIG. 3, a speed or distance sensor 1 outputs a signal indicative of a distance travelled by the vehicle to a controller 4. The speed sensor 1 may be in the form of, such as a photoelectric, electromagnetic or mechanical-contact sensor which outputs pulse signals in proportion to the number of rotations of a tire. A geomagnetic sensor 2 outputs a signal indicative of an absolute traveling direction of the vehicle to the controller 4. A rate gyro sensor 3 outputs a signal indicative of variation in the traveling direction of the vehicle to the controller 4. 
     The controller 4 comprises, for example, a microcomputer and receives the outputs from the speed sensor 1, the geomagnetic sensor 2 and the rate gyro sensor 3 as described above. The controller 4 counts the pulses output from the speed sensor 1 and calculates the distance travelled by the vehicle. The controller 4 further calculates a vehicle traveling direction based on the outputs from the geomagnetic sensor 2 and the rate gyro sensor 3 to determine a position of the vehicle on a two-dimensional coordinate or an X-Y coordinate per a predetermined unit distance travelled by the vehicle. 
     A display device 5, such as a CRT (cathode-ray tube) display device and a liquid crystal display device, renews and displays in sequence a current position of the vehicle based on the positional data output from the controller 4. 
     General operation of the vehicular traveling direction measuring system of the preferred embodiment will be described hereinbelow with reference to FIG. 4 which shows a flowchart to be executed for sequentially deriving the current position of the vehicle on the X-Y coordinate. 
     Immediately after the power is first applied to the controller 4, the process goes to an initialize step 100 where an initialize routine is executed. At a subsequent step 102, a current position of the vehicle is set by keyboard-input, and then at a step 104, the current position of the vehicle and a peripheral map are displayed on the display device 5. 
     When interrupt is allowed at an allow interrupt step 106, then the process goes to a main loop comprising steps 112 and 114. In this main loop, when it is determined at the step 112 based on results from interrupt routine steps 108 and 110 that the current position of the vehicle has been changed, the current position of the vehicle and the peripheral map are renewed at the step 114. 
     FIG. 5 shows a flowchart of the interrupt routine identified as step 108 in FIG. 4. This interrupt routine is executed per a predetermined distance ΔD travelled by the vehicle. Specifically, when the speed sensor 1 outputs 24 pulses per one rotation of the tire, then ΔD is, for example, 6 to 7 centimeters, which however is variable according to an outer diameter of the tire, and the interrupt routine is executed 24 times per one rotation of the tire. 
     In FIG. 5, a counter SSS is counted up by 1 per every execution of the interrupt routine at a step 400 and is used for determining whether the vehicle is stopped. A counter S is also counted up by 1 per every execution of the interrupt routine at a step 402, and a counter SS is counted up by 1 per every 12 executions (per half rotation of the tire) of the interrupt routine as shown at steps 404 and 406. Specifically, the counter SS is counted up by 1 in response to the counter S counting up 12 times. The counter S is reset to zero at a step 408. These counters S and SS are used for calculating the vehicle traveling direction, as will be described later. A counter SSSS is counted up by 1 per every execution of the interrupt routine at step 410 and is used for calculating the current position of the vehicle, which will be also described later. 
     FIGS. 6A, 6B and 6C show a flowchart of the interrupt routine identified as the step 110 in FIG. 4. This interrupt routine is executed per a predetermined unit time ΔT, for example, every 100 msec. 
     In FIG. 6A, a step 500 determines whether the vehicle is stopped, i.e. whether a value of the counter SSS is zero. When the value of the counter SSS is zero, i.e. an answer at the step 500 is YES, which means that the vehicle is stopped and no variation of the traveling direction is possible, then the routine goes to a step 504 via a step 503 bypassing a subsequent traveling direction calculation routine. At the step 504, correction of the gyro sensor drift is performed. Since an angular velocity of the vehicle should be zero when it is stopped, an output of the gyro sensor 3 is considered to be a product of gyro sensor drift. At the step 503, a counter value i is reset to zero. The counter value i is counted up by 1 per every execution of a step 505 for deriving an elapsed time commencing from a time point where the correction of gyro sensor drift is performed at the step 504. 
     On the other hand, when the answer at the step 500 is NO, that is, the vehicle is moving, the counter SSS is reset to zero at a step 502, and the routine goes to the step 505. At the step 505, as described above, the counter value i is increased by 1 per every execution of the step 505 so as to count the elapsed time commencing from the time point of the correction of the gyro sensor drift at the step 504. Subsequently, at a step 506, a first gyro drift correction value α 0  is derived using the elapsed time derived at the step 505 and a drift characteristic of the gyro sensor (a drift error of the gyro sensor per unit time, which is normally 0.01 deg/sec to 0.1 deg/sec) which has been measured in advance. This first correction value α 0  is used at subsequent steps 507 and 508 to derive second and third gyro drift correction values α 1  and α 2  respectively. Specifically, the first to third correction values α 0 , α 1  and α 2  are derived based on the following equations, respectively: ##EQU1## where, DR is the drift characteristic of the gyro sensor 3, i is the elapsed time derived at the step 505, and C 1 , C 2  and C 3  are all constants. These constants are set, for example, to the following values: 
     
         C.sub.1 =300 C.sub.2 =0.4 C.sub.3 =4 
    
     As appreciated from the above-noted equations, the first and second correction values α 0  and α 1  become larger with the elapsed time i being larger, while the third correction value α 2  becomes less with the elapsed time i being larger. 
     Now, the routine proceeds to a step 509 where the absolute traveling direction θ M  of the vehicle measured by the geomagnetic sensor 2 is read out, and at a subsequent step 510, a difference Δθ M  between the absolute direction θ M  and a prior absolute direction θ MOLD  is derived. The prior absolute direction θ MOLD  is an absolute direction θ M  which has been derived during the prior execution of the interrupt routine and is stored at a step 534 in sequence for a subsequent execution of the interrupt routine. 
     At a subsequent step 511 (FIG. 6B), an angular velocity ψ G  in a yawing direction of the vehicle measured by the gyro sensor 3 is read out, and at a step 512, a directional variation Δθ G  is calculated by ψ G  ×ΔT. When an absolute value of Δθ G  is determined less than 0.3 (deg/sec)ΔT at a step 514, the routine goes to a step 516 where Δθ G  is set to zero. Accordingly, through the steps 514 and 516, the directional variation Δθ G  is disregarded during a subsequent calculation routine when the absolute value of Δθ G  is less than the predetermined value. Specifically, as described above, because the measuring error caused by the drift is inherent to the gyro sensor, though the drift error is small in one execution of the interrupt routine, it becomes considerably large through integration as the interrupt routine is executed repeatedly. Accordingly, the steps 514 and 516 prevent the directional variation caused by the gyro sensor drift from being integrated during the interrupt routine. 
     Through steps 518 to 530, the traveling direction of the vehicle is calculated based on the data obtained by the outputs of the geomagnetic and gyro sensors 2 and 3. 
     At the step 518, a traveling direction θ of the vehicle derived by the prior execution of the interrupt routine and stored at a step 536 is set to θ 1 . Subsequently, at the step 520, the directional variation Δθ G  derived at the step 512 is added to the direction θ 1  so as to derive a direction θ 2 . Accordingly, the direction θ 2  only includes the directional variation derived by the gyro sensor 3 in the current routine. 
     At the steps 522 and 524, the geomagnetic environment indicies β and γ are calculated. The geomagnetic environment index β derived at the step 522 corresponds to the output value derived from the first geomagnetic environment deriving means (c) in FIG. 2, and the geomagnetic environment index γ derived at the step 524 corresponds to the output value derived from the second geomagnetic environment deriving means (e) in FIG. 2. 
     The geomagnetic environment index β is calculated by the following equation: 
     
         β=|Δθ.sub.G -Δθ.sub.M | 
    
     and is indicative of a difference between the outputs of the geomagnetic sensor 2 and the gyro sensor 3 over a short distance or a short time, and thus is indicative of a disturbance of the geomagnetic field over a short distance or a short time, for example, of the order of several meters. 
     The magnetic environment index β has the following meaning: 
     When the vehicle is running on an elevated road, a disturbance component is increased in the output of the geomagnetic sensor per several meters travelled by the vehicle. It is considered that this increment of the disturbance component is caused by metallic structural members of the elevated road. Further, when the vehicle is traveling on a road under an elevated road, the disturbance component is also increased in the output of the geomagnetic sensor per several meters travelled by the vehicle due to supporting posts arranged on both sides of the road for supporting the elevated road. The geomagnetic environment index β is a numeric value for defining the above-noted disturbance component over a short distance or a short time. Accordingly, the geomagnetic environment index β is derived by comparing the output of the gyro sensor which is considered to be accurate over short distances and the output of the geomagnetic sensor. 
     On the other hand, the magnetic environment index γ is calculated by the following equation: 
     
         γ=|θ.sub.2 -θ.sub.M | 
    
     and is indicative of a difference between the direction θ 2  derived at the step 520 and the absolute direction θ M  read out at the step 509, and thus is a numeric value indicative of a disturbance of the geomagnetic field, i.e. the disturbance of the output of the geomagnetic sensor, over a distance (for example, of the order of several 10 to several 100 meters) longer than that for the geomagnetic environment index β. This long distance based disturbance of the geomagnetic field is likely to occur, for example, when the vehicle is running close to and in parallel with a railroad or on a road under which a subway is extended. 
     FIGS. 7 and 8 respectively show graphs of distance versus vehicle traveling direction measured by the geomagnetic sensor 2. In FIGS. 7 and 8(a), a true traveling direction of the vehicle is indicated by a dotted line, that is, the vehicle is traveling straight in the same direction. 
     FIG. 7 shows one example wherein the short distance based disturbance of the geomagnetic field is large. The solid line shows the vehicle traveling direction derived by the geomagnetic sensor, which largely deviates from the true traveling direction of the vehicle. The geomagnetic environment index β varies largely in this example. 
     FIG. 8(a) shows another example wherein the short distance based disturbance and the long distance based disturbance of the geomagnetic field are included. FIG. 8(b) shows the solid line of FIG. 8(a) extracting the short distance based disturbance component only, while FIG. 8 (c) shows the solid line of FIG. 8(a) extracting the long distance based disturbance component only. In this example, the short distance based disturbance is less than that in FIG. 7, i.e. the variation of the geomagnetic environment index β is less, while the long distance based disturbance is large, i.e. the variation of the geomagnetic environment index γ is large. 
     Referring back to FIG. 6B, a coefficient K is calculated at the step 526 based on the following equation (1). ##EQU2## 
     The coefficient K is a numeric value for determining how fast the direction θ 2  derived at the step 520 is to approach the absolute direction θ M  read out at the step 509, which will be described later. 
     In the equation (1), the geomagnetic environment indicies β and γ are the values derived at the steps 522 and 524, respectively, and α 1  and α 2  are the values derived at the steps 507 and 508, respectively, and C 4 , C 5 , n1 and n2 are all constants. These constants are set, for example, to the following values: ##EQU3## 
     If these values (assuming C 5  =0.1) are substituted for the corresponding constants in the equation (1), then ##EQU4## 
     In the equation (2), if the first term on the right side is denoted by K 1  and the second term of the right side is denoted by K 2 , then 
     
         K=K.sub.1 ×K.sub.2 ×0.1                        (3) 
    
     Accordingly, K 1  is determined by the geomagnetic environment index β and α 1 , and K 2  is determined by the geomagnetic environment index γ and α 2 . 
     FIG. 9(a) is a graph showing a relationship between the elapsed time and the second correction value α 1 , wherein a line (1) shows the relationship therebetween for the gyro sensor having a drift characteristic of 0.1 deg/sec, a line (2) for the gyro sensor having a drift characteristic of 0.05 deg/sec and a line (3) for the gyro sensor having a drift characteristic of 0.01 deg/sec. As seen from FIG. 9(a), the second correction value α 1  becomes larger with lapse of time and is less with the gyro sensor having less drift error. 
     FIG. 9(b) is a graph showing a relationship between the elapsed time and the third correction value α 2 , wherein a line (1) shows the relationship therebetween for the gyro sensor having the drift characteristic of 0.1 deg/sec, a line (2) for the gyro sensor having the drift characteristic of 0.05 deg/sec and a line (3) for the gyro sensor having the drift characteristic of 0.01 deg/sec. As seen from FIG. 9(b), the third correction value α 2  becomes less with lapse of time and is larger with the gyro sensor having less drift error. 
     FIG. 9(c) is a graph showing a relationship between the geomagnetic environment index β and K 1 , wherein a line (1) shows the relationship therebetween with the second correction value α 1  being 0.2 and a line (2) with the second correction value α 1  being 0.02. As seen from FIG. 9(c), K 1  becomes less with the index β being larger and is larger with the second correction value being larger. 
     FIG. 9(d) is a graph showing a relationship between the geomagnetic environment index γ and K 2 , wherein a line (1) shows the relationship therebetween with the third correction value α 2  being 1 and a line (2) with the third correction value α 2  being 2. As seen from FIG. 9(d), K 2  becomes less with the index γ being larger and is larger with the third correction value being less. 
     Further, as seen from FIGS. 9(a) to 9(d), the affection of the indicies β and γ to K 1  and K 2  become less with lapse of time from the time point of the correction of the gyro sensor drift at the step 504, due to function of the second and third correction values α 1  and α 2 . 
     Each of the above-noted constants has the following meaning. 
     C 1  . . . The constant C 1  determines a degree of effect the gyro sensor drift has on the coefficient K. 
     C 2  . . . This constant is the speed of the direction θ 2  derived at the step 520 to approach the absolute direction θ M  read out at the step 509 in case the disturbance of the geomagnetic field is occurring per the order of several meters while the long distance disturbance is the least (β is large, γ is zero). As this constant gets less, the approaching speed gets less. Accordingly, the rate of dependence upon the gyro sensor gets larger. 
     C 3  . . . This constant is for adjusting an influence of the geomagnetic environment index γ upon the approaching speed. Specifically, as this constant gets larger, the influence upon the approaching speed gets larger and the rate of dependence upon the gyro sensor gets larger even when the value γ is small. 
     C 4  . . . When the disturbance of the geomagnetic field is the least (β=0, γ=0), the coefficient K gets maximum. The constant C 4  is for adjusting this maximum value. As this constant gets larger, the speed of the direction θ 2  derived at the step 520 to approach the absolute direction θ M  read out at the step 509 gets higher. 
     C 5  . . . This constant is for adjusting the approach speed as a whole. 
     n1 . . . This constant is for adjusting the characteristics of K 1  to be varied based on the geomagnetic environment index β. For example, in FIG. 9(c), because this constant is large (n1=6), K 1  varies rapidly around β=1 both in the lines (1) and (2). Naturally, when the constant n1 gets larger, the variation of K 1  around β=1 gets larger, and when the constant n1 gets smaller, the variation of K 1  around β=1 gets smaller. 
     n2 . . . This constant is for adjusting the characteristics of K 2  to be varied based on the geomagnetic environment index γ. For example, in FIG. 9(d), because this constant is small (n2=1), K 2  does not vary rapidly in comparison with K 1  in FIG. 9(c). Because α 2  =2 for the line (2), K 2  varies rapidly around γ=1/2 as this constant gets larger. On the other hand, because α 2  =1 for the line (1), K 2  varies rapidly around γ=1 as this constant gets larger. 
     As understood from the foregoing explanation, the values of the constants n1 and n2 are determined depending on whether the coefficient K should be varied rapidly or slowly and whether the coefficient K should be varied rapidly around certain values of the geomagnetic environment indicies β and γ. 
     Referring back to FIG. 6C, at the steps 528 and 530, the vehicle traveling direction θ 2  derived at the step 520 approaches to the absolute direction θ M  read out at the step 509. A rate of approach performed at the steps 528 and 530 is determined by the coefficient K. As the coefficient K gets larger, the approach rate gets larger. 
     For example, at the step 530, when the coefficient K=1, then 
     
         θ.sub.2 =1×(θ.sub.M -θ.sub.2)+θ.sub.2 =θ.sub.M 
    
     Accordingly, the vehicle traveling direction θ 2  derived at the step 520 becomes equal to the absolute direction θ M  at one execution of the step 530. On the other hand, when the coefficient K=0, the absolute direction θ M  read out at the step 509 is not reflected at the step 530. 
     In FIG. 10, the above-noted characteristics are shown. When the vehicle is running on a straight road with a rapid variation in the geomagnetic field, the vehicle traveling direction θ 2  derived at the step 520 approaches the absolute direction θ M  read out at the step 509 faster with a larger value of the coefficient K and less fast with a lower value of the coefficient K. 
     Further, immediately after the gyro sensor drift is corrected at the step 504 and when there is no disturbance of the geomagnetic field, then there is no discrepancy in measured directions between the geomagnetic sensor and the gyro sensor. Accordingly, as β=γ=0, α 1  =0 and α 2  =4, then K 1  =0.6 and K 2  =1.0. Assuming that the constant C 5  =1, then K=0.6 (a maximum value). On the other hand, when the disturbance of the geomagnetic field is large and, for example, β=∞ and γ=∞, then K=0. If the condition of K=0 lasts long, then the variation in the vehicle traveling direction is derived solely by the gyro sensor during this condition so that drift error accumulates. However, practically, the coefficient K falls between the minimum value 0 and the maximum value 0.6 and further, is a value corrected by the second and third correction values α 1  and α 2 , so that it is not likely that the condition of K=0 will last long enough to allow significant accumulation of drift error. Accordingly, on a long-term basis, the traveling direction β 2  derived at the step 520 approaches the absolute direction θ M  through the step 530 and the drift error is cancelled. 
     It is to be noted that the step 528 is an instruction for repeating the step 530 as many times as a value of the counter SS. Accordingly, when the value of the counter SS is 2, then the step 530 is repeated twice. On the other hand, when the value of the counter SS is 0, then the process skips step 530 and goes to a step 532 where the counter SS is reset to 0 for a subsequent execution of the interrupt routine. 
     The repetition of the step 530 is required for deriving a calculation result on a basis of a predetermined distance since this interrupt routine is executed on a basis of the predetermined time ΔT. Accordingly, in this preferred embodiment, it is equivalent to execute the step 530 per a half rotation of the tire since the counter SS is counted up by 1 in response to the counter S counting up 12 times as shown in FIG. 5. Though it is preferable to execute this interrupt routine per a predetermined distance, it is practical to execute same per a predetermined time while the processed result is equivalent to that on a basis of the predetermined distance, due to a problem of calculation load applied to a central processing unit (CPU) of the microcomputer. 
     Referring back to FIG. 6C, at a step 534, the absolute direction θ M  read out at the step 509 is stored as θ MOLD  for a subsequent execution of the interrupt routine. At a step 536, the vehicle traveling direction θ 2  derived at the step 530 is stored as θ, and then at a step 538, a current position in the form of X and Y coordinate values is renewed. At the step 538, ΔD×SSSS denotes a distance travelled by the vehicle from the prior execution of the interrupt routine. Subsequently, at a step 540, the counter SSSS is reset to 0 for a subsequent execution of the interrupt routine. 
     It is to be noted that at the initialize step 100 shown in FIG. 4, the vehicle traveling directions θ and θ MOLD  are initialized to an absolute direction θ M  which is read out from the geomagnetic sensor at the time of initialization. Further, the counters S, SS, SSS and SSSS are all reset to 0. 
     Now advantages of using the two geomagnetic environment indicies β and γ and the second and third correction values α 1  and α 2  are explained hereinbelow. 
     As shown in FIG. 11(a), it is assumed that abrupt long distance based disturbance of the geomagnetic field occurs on a basis of the order of several 10 meters to several 100 meters when the vehicle is traveling on a straight road. For simplification, the short distance based disturbance of the geomagnetic field on a basis of the order of several meters is not considered in FIG. 11(a) and thus the geomagnetic environment index β is assumed constant. 
     The geomagnetic environment index γ is derived by γ=|θ 2  -θ M  | at the step 524 as described above. Accordingly, in FIG. 11(a), a difference between the absolute direction θ M  (corresponding to θ M  at the step 524) and the vehicle traveling direction θ (corresponding to θ 2  at the step 524) denotes the index γ. A variation in value of the index γ is shown in FIG. 11(b), wherein it is seen that the value of the index γ is held large between time points t1 to t10. Accordingly, K 2  becomes small between the time points t1 to t10, and thus the coefficient K also becomes small. Therefore, the approach rate or speed as described above also becomes small. 
     It is to be appreciated that even while the index γ  is large, the second and third correction values α 1  and α 2  cooperatively function to compensate gyro sensor drift error so that accumulation of drift error is effectively avoided. 
     On the other hand, after the geomagnetic field returns to normal at the time point 10, the index γ rapidly gets smaller between time points t10 to t11, and thus the foregoing approach rate gets larger. 
     FIG. 11(c) shows a variation in value of the geomagnetic environment index β. As seen from FIG. 11(c), because the value of the index β varies only at the time points t1 and t10 in this example, that is, at the time of the variation in the long distance based disturbance of the geomagnetic field, the value of the index β remains small between the time points t2 to t9. Accordingly, if the index γ is not used in the calculation of the coefficient K, the foregoing approach rate becomes large between the time points t2 to t9 so that the measured direction rapidly approaches the absolute direction θ M  in FIG. 11(a). Therefore, the finally derived direction is largely deviated from the true traveling direction of the vehicle. 
     The distance or time axes in FIGS. 11(a), (b) and (c) are all common. 
     It is to be appreciated that by using the two geomagnetic environment indicies β and γ, it is possible to provide accurate measurement of the vehicle traveling direction even when short and long distance based disturbance of the geomagnetic field occurs. Further, by using the second and third correction values α 1  and α 2 , the gyro sensor drift error is effectively compensated. 
     Further, the exemplified values of the constants C 1  to C 5 , n1 and n2 are set assuming that the used gyro sensor has a drift error of about 0.1 deg/sec. Accordingly, when using the gyro sensor having less drift error, the values of the constants may be changed to increase the rate of dependence upon the gyro sensor so as to provide a more accurate measurement of the vehicle traveling direction with less effect from disturbances in the geomagnetic field. 
     It is to be understood that this invention is not to be limited to the embodiments described above, and that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.