File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -914,8 +914,12 @@ export function FlightLog(logData) {
914914 Ve = srcFrame [ gpsVelNED [ 1 ] ] ,
915915 Vd = srcFrame [ gpsVelNED [ 2 ] ] ;
916916 const velocity = Math . sqrt ( Vn * Vn + Ve * Ve + Vd * Vd ) ;
917- const minVelo = 1 ;
918- const trajectoryTiltAngle = velocity > minVelo ? - Math . asin ( Vd / velocity ) * 180.0 / Math . PI : 0 ; // [degree], if velo is up then >0
917+ const minVelo = 5 ; // 5cm/s limit to prevent division by zero and miss tiny noise values
918+ let trajectoryTiltAngle = 0 ;
919+ if ( velocity > minVelo ) {
920+ const angleSin = Math . max ( - 1 , Math . min ( 1 , Vd / velocity ) ) ;
921+ trajectoryTiltAngle = - Math . asin ( angleSin ) * 180.0 / Math . PI ; // [degree], if velo is up then >0
922+ }
919923 destFrame [ fieldIndex ++ ] = trajectoryTiltAngle ;
920924 } else {
921925 destFrame [ fieldIndex ++ ] = 0 ;
You can’t perform that action at this time.
0 commit comments