Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol heading is off for ADS-B tracks #14

Open
ampledata opened this issue Jul 20, 2023 · 3 comments
Open

Symbol heading is off for ADS-B tracks #14

ampledata opened this issue Jul 20, 2023 · 3 comments

Comments

@ampledata
Copy link
Collaborator

ampledata commented Jul 20, 2023

From a user:

It looks like all headings are off by some fixed offset between the Magnetic heading and the on-icon caret

Screen Shot 2023-07-20 at 4 30 52 PM
Screen Shot 2023-07-20 at 4 31 03 PM
Screen Shot 2023-07-20 at 4 31 14 PM

Per https://www.dev.adsbexchange.com/version-2-api-wip/:

track: true track over ground in degrees (0-359)

Per CoT Spec:

The track element specifies direction and speed of travel. It has two required attributes: course and speed. It also has optional attributes for specifying the vertical component of the motion vector (slope) and errors associated with course, speed, and slope.
Course denotes the direction of motion and is specified as the number of degrees measured clockwise from true North. Speed is specified in meters per second as speed over ground.
There is no constraint on the precision used for these values.

@ampledata ampledata changed the title It looks like all headings are off by some fixed offset between the Magnetic heading and the on-icon caret Symbol heading is off for ADS-B tracks Aug 9, 2023
@ampledata
Copy link
Collaborator Author

If you're also seeing this on AirTAK, it's running adsbcot, and the bug was reported with adsbxcot. It could be we're not converting from ADS-B values to CoT values correctly across the board.

Here's how adsbcot is converting ADS-B trk/track to CoT track: track.set("course", str(craft.get("trk", craft.get("track", "9999999.0"))))

Here's how adsbxcot is converting ADS-B track to CoT: track.set("course", str(craft.get("track", "9999999.0")))

From the dump1090-fa documentation: track: true track over ground in degrees (0-359)

Both say they reference 'true'

Heading is referring to the direction the aircraft is pointed at, whereas track is referring to the actual direction of the aircraft travelling across the ground.

True (Desired) Course +/- Wind Correction Angle = True Heading
True Heading +/- Magnetic Variation = Magnetic Heading
Magnetic Heading +/- Deviation = Compass Heading

@ampledata
Copy link
Collaborator Author

Here's how dump1090-fa spits out heading

    if (mm->heading_valid && mm->heading_source == HEADING_TRUE && accept_data(&a->heading_valid, mm->source, now)) {
        a->heading = mm->heading;
    }

    if (mm->heading_valid && mm->heading_source == HEADING_MAGNETIC && accept_data(&a->heading_magnetic_valid, mm->source, now)) {
        a->heading_magnetic = mm->heading;
    }

@ampledata
Copy link
Collaborator Author

From the CoT Spec:

			<xs:attribute name="course" use="required">
				<xs:annotation>
					<xs:documentation>Direction of motion with respect to true north. Measured in degrees.</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:decimal">
						<xs:minInclusive value="0"/>
						<xs:maxExclusive value="360"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant