Better AHRS initialization behavior when sensors not yet calibrated.

pull/578/head
Eric Westphal 2017-02-27 20:34:02 -05:00
rodzic 4d31c3940c
commit cd6b708007
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -162,6 +162,8 @@ func sensorAttitudeSender() {
errHeadingMag, errSlipSkid, errTurnRate, errGLoad error
failnum uint8
)
log.Println("AHRS Info: initializing new simple AHRS")
s = ahrs.InitializeSimple(fmt.Sprintf("/var/log/sensors_%s.csv", time.Now().Format("20060102_150405")))
m = ahrs.NewMeasurement()
cage = make(chan(bool))
@ -175,8 +177,6 @@ func sensorAttitudeSender() {
// Need a sampling freq faster than 10Hz
timer := time.NewTicker(50 * time.Millisecond) // ~20Hz update.
for {
log.Println("AHRS Info: initializing new simple AHRS")
s = ahrs.InitializeSimple(fmt.Sprintf("/var/log/sensors_%s.csv", time.Now().Format("20060102_150405")))
if globalSettings.IMUMapping[0]==0 { // if unset, default to RY836AI
globalSettings.IMUMapping[0] = -1 // +2
globalSettings.IMUMapping[1] = -3 // +3