kopia lustrzana https://github.com/cyoung/stratux
Set heading from GPS with sustained >=10kts.
Apply same to new source.pull/182/head^2
rodzic
32383c12c2
commit
dab97a2328
|
@ -314,6 +314,17 @@ func validateNMEAChecksum(s string) (string, bool) {
|
||||||
return s_out, true
|
return s_out, true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only count this heading if a "sustained" >10kts is obtained. This filters out a lot of heading
|
||||||
|
// changes while on the ground and "movement" is really only changes in GPS fix as it settles down.
|
||||||
|
//TODO: Some more robust checking above current and last speed.
|
||||||
|
func setTrueCourse(groundSpeed, trueCourse uint16) {
|
||||||
|
if myMPU6050 != nil && globalStatus.RY835AI_connected && globalSettings.AHRS_Enabled {
|
||||||
|
if mySituation.GroundSpeed >= 10 && groundSpeed >= 10 {
|
||||||
|
myMPU6050.ResetHeading(float64(trueCourse))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func processNMEALine(l string) bool {
|
func processNMEALine(l string) bool {
|
||||||
replayLog(l, MSGCLASS_GPS)
|
replayLog(l, MSGCLASS_GPS)
|
||||||
l_valid, validNMEAcs := validateNMEAChecksum(l)
|
l_valid, validNMEAcs := validateNMEAChecksum(l)
|
||||||
|
@ -455,15 +466,7 @@ func processNMEALine(l string) bool {
|
||||||
mySituation.LastGroundTrackTime = time.Time{}
|
mySituation.LastGroundTrackTime = time.Time{}
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: Experimental. Set heading to true heading on the MPU6050 reader.
|
setTrueCourse(trueCourse, uint16(groundspeed))
|
||||||
if myMPU6050 != nil && globalStatus.RY835AI_connected && globalSettings.AHRS_Enabled {
|
|
||||||
// Only count this heading if a "sustained" >10kts is obtained. This filters out a lot of heading
|
|
||||||
// changes while on the ground and "movement" is really only changes in GPS fix as it settles down.
|
|
||||||
//TODO: Some more robust checking above current and last speed.
|
|
||||||
if mySituation.GroundSpeed >= 10 && uint16(groundSpeed) >= 10 {
|
|
||||||
myMPU6050.ResetHeading(float64(trueCourse))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mySituation.TrueCourse = uint16(trueCourse)
|
mySituation.TrueCourse = uint16(trueCourse)
|
||||||
mySituation.GroundSpeed = uint16(groundspeed)
|
mySituation.GroundSpeed = uint16(groundspeed)
|
||||||
|
@ -575,15 +578,7 @@ func processNMEALine(l string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: Experimental. Set heading to true heading on the MPU6050 reader.
|
setTrueCourse(trueCourse, uint16(groundSpeed))
|
||||||
if myMPU6050 != nil && globalStatus.RY835AI_connected && globalSettings.AHRS_Enabled {
|
|
||||||
// Only count this heading if a "sustained" >10kts is obtained. This filters out a lot of heading
|
|
||||||
// changes while on the ground and "movement" is really only changes in GPS fix as it settles down.
|
|
||||||
//TODO: Some more robust checking above current and last speed.
|
|
||||||
if mySituation.GroundSpeed >= 10 && uint16(groundSpeed) >= 10 {
|
|
||||||
myMPU6050.ResetHeading(float64(trueCourse))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mySituation.TrueCourse = uint16(trueCourse)
|
mySituation.TrueCourse = uint16(trueCourse)
|
||||||
mySituation.GroundSpeed = uint16(groundSpeed)
|
mySituation.GroundSpeed = uint16(groundSpeed)
|
||||||
|
|
Ładowanie…
Reference in New Issue