diff --git a/web/plates/gps.html b/web/plates/gps.html index 80fb496c..2aaf223b 100644 --- a/web/plates/gps.html +++ b/web/plates/gps.html @@ -56,6 +56,18 @@ {{ahrs_roll}}° {{ahrs_alt}} ft +
+ Mag Hdg: + Slip/Skid: + Turn Rate: + G Load: +
+
+ {{ahrs_heading_mag}}° + {{ahrs_slip_skid}}° + {{ahrs_turn_rate}} s + {{ahrs_gload}}G +
diff --git a/web/plates/js/ahrs.js b/web/plates/js/ahrs.js index 656701f6..1b7122ed 100644 --- a/web/plates/js/ahrs.js +++ b/web/plates/js/ahrs.js @@ -48,14 +48,15 @@ ahrsRenderer.prototype = { } }, - orientation: function (pitch, roll, heading) { + orientation: function (pitch, roll, heading, slipSkid) { // Assume we receive valid pitch, roll, heading this.pitch = pitch; this.roll = roll; this.heading = heading; + this.slipSkid = slipSkid; }, - animate: function (t, pitch, roll, heading) { + animate: function (t, pitch, roll, heading, slipSkid) { var FPS = 40; // we assume we can maintain a certain frame rate var x_inc = ((pitch - this.pitch) / (FPS * t)); var y_inc = ((roll - this.roll) / (FPS * t)); @@ -67,6 +68,7 @@ ahrsRenderer.prototype = { this.heading += 360; } var z_inc = ((heading - this.heading) / (FPS * t)); + var w_inc = ((slipSkid - this.slipSkid) / (FPS * t)); var _this = this; //console.log(z_inc); var frames = 0; @@ -74,12 +76,13 @@ ahrsRenderer.prototype = { _this.pitch += x_inc; _this.roll += y_inc; _this.heading += z_inc; + _this.slipSkid += w_inc; if (frames < (FPS * t)) { _this.draw(); frames++; window.requestAnimationFrame(f); // recurse } else { - _this.orientation(pitch, roll, heading); + _this.orientation(pitch, roll, heading, slipSkid); } }; f(); diff --git a/web/plates/js/gps.js b/web/plates/js/gps.js index 8e3fc63b..4d7d3488 100644 --- a/web/plates/js/gps.js +++ b/web/plates/js/gps.js @@ -106,6 +106,15 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) { // pitch and roll are in degrees $scope.ahrs_pitch = Math.round(status.Pitch*10)/10; $scope.ahrs_roll = Math.round(status.Roll*10)/10; + + $scope.ahrs_heading_mag = Math.round(status.Mag_heading); + $scope.ahrs_slip_skid = Math.round(status.SlipSkid*10)/10; + if (status.RateOfTurn > 0.001) { + $scope.ahrs_turn_rate = Math.round(360/status.RateOfTurn); + } else { + $scope.ahrs_turn_rate = '--' + } + $scope.ahrs_gload = Math.round(status.GLoad*100)/100; // "LastAttitudeTime":"2015-10-11T16:47:03.534615187Z" setGeoReferenceMap(status.Lat, status.Lng); @@ -118,7 +127,7 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) { $http.get(URL_GPS_GET). then(function (response) { loadStatus(response.data); - ahrs.animate(0.1, $scope.ahrs_pitch, $scope.ahrs_roll, $scope.ahrs_heading); + ahrs.animate(0.1, $scope.ahrs_pitch, $scope.ahrs_roll, $scope.ahrs_heading, $scope.ahrs_slip_skid); // $scope.$apply(); }, function (response) { $scope.raw_data = "error getting gps / ahrs status";