Skip to content

Commit

Permalink
Ensure SensorQuaternion synced with IMUMapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
westphae committed Jun 22, 2017
1 parent a2bba20 commit 74909ad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion goflying
1 change: 1 addition & 0 deletions main/managementinterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ func handleOrientAHRS(w http.ResponseWriter, r *http.Request) {
saveSettings()
myIMUReader.Close()
globalStatus.IMUConnected = false // restart the processes depending on the orientation
CageAHRS()
log.Printf("AHRS Info: sensor orientation success! forward: %d; up: %d\n", f, u)
default: // Cancel the sensor calibration.
f = 0
Expand Down
1 change: 1 addition & 0 deletions main/sensors.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ func sensorAttitudeSender() {
}

if needsCage {
log.Println("AHRS Info: Caging")
ff = *makeSensorRotationMatrix([3]float64{c[0], c[1], c[2]})
f[0], f[1], f[2], f[3] = ahrs.RotationMatrixToQuaternion(ff)
globalSettings.SensorQuaternion[0] = f[0]
Expand Down

0 comments on commit 74909ad

Please sign in to comment.