kopia lustrzana https://github.com/cyoung/stratux
Speed option for AHRS replay.
rodzic
fbcfddc006
commit
663fe90ae8
|
@ -342,8 +342,8 @@ func heartBeatSender() {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
crcInit()
|
crcInit()
|
||||||
if len(os.Args) < 4 {
|
if len(os.Args) < 5 {
|
||||||
fmt.Printf("%s <start second> <ahrs file> <gps file>\n", os.Args[0])
|
fmt.Printf("%s <start second> <ahrs file> <gps file> <replay speed>\n", os.Args[0])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
startsec, err := strconv.Atoi(os.Args[1])
|
startsec, err := strconv.Atoi(os.Args[1])
|
||||||
|
@ -352,6 +352,12 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
replayspeed, err := strconv.Atoi(os.Args[4])
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("invalid: %s\n", os.Args[4])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
startnsec := int64(startsec) * 1000000000
|
startnsec := int64(startsec) * 1000000000
|
||||||
|
|
||||||
ahrsfp, ahrsIdx, err := seekTimestampInAHRS(os.Args[2], startnsec, 1000000000) // Find the index with 1.00s tolerance.
|
ahrsfp, ahrsIdx, err := seekTimestampInAHRS(os.Args[2], startnsec, 1000000000) // Find the index with 1.00s tolerance.
|
||||||
|
@ -414,7 +420,7 @@ func main() {
|
||||||
fmt.Printf("%f %f\n", pitch, roll)
|
fmt.Printf("%f %f\n", pitch, roll)
|
||||||
s := fmt.Sprintf("XATTStratux,%f,%f,%f", gps.Course, pitch, roll)
|
s := fmt.Sprintf("XATTStratux,%f,%f,%f", gps.Course, pitch, roll)
|
||||||
outConn.Write([]byte(s))
|
outConn.Write([]byte(s))
|
||||||
time.Sleep(time.Duration(ahrs.Timestamp - lastTs))
|
time.Sleep(time.Duration((ahrs.Timestamp - lastTs)/int64(replayspeed)))
|
||||||
lastTs = ahrs.Timestamp
|
lastTs = ahrs.Timestamp
|
||||||
|
|
||||||
// Now we're working with synced samples.
|
// Now we're working with synced samples.
|
||||||
|
|
Ładowanie…
Reference in New Issue