File tree Expand file tree Collapse file tree
src/main/java/de/serosystems/lib1090/msgs/adsr Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,7 +110,12 @@ public VelocityOverGroundMsg(ExtendedSquitter squitter) throws BadFormatExceptio
110110
111111 vertical_source = (msg [4 ]&0x10 )>0 ;
112112 vertical_rate_down = (msg [4 ]&0x08 )>0 ;
113- vertical_rate = (short ) ((((msg [4 ]&0x07 )<<6 | (msg [5 ]>>>2 )&0x3F )-1 )<<6 );
113+ int raw_vr = ((msg [4 ]&0x07 )<<6 | (msg [5 ]>>>2 )&0x3F );
114+ if (raw_vr == 0 ) {
115+ vertical_rate_info_available = false ;
116+ } else {
117+ vertical_rate = (short ) ((raw_vr -1 )<<6 );
118+ }
114119
115120 geo_minus_baro = msg [6 ]&0x7F ;
116121 if (geo_minus_baro == 0 ) geo_minus_baro_available = false ;
@@ -228,7 +233,7 @@ public Integer getGeoMinusBaro() {
228233 * @return heading in decimal degrees ([0, 360]) clockwise from geographic north or null if information is not available.
229234 * The latter can also be checked with {@link #hasVelocityInfo()}.
230235 */
231- public Double getHeading () {
236+ public Double getTrueTrackAngle () {
232237 if (!velocity_info_available ) return null ;
233238 double angle = Math .toDegrees (Math .atan2 (
234239 -this .getEastToWestVelocity (),
You can’t perform that action at this time.
0 commit comments