Skip to content

Conversation

@timklge
Copy link
Owner

@timklge timklge commented Nov 6, 2025

ref #182

@timklge timklge requested a review from Copilot November 7, 2025 13:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements true north calculation for the compass feature by accounting for magnetic declination when using magnetometer-based bearing. The compass now displays true north instead of magnetic north by using GPS coordinates to calculate and apply the appropriate magnetic declination correction.

Key changes:

  • Added GPS coordinate tracking to calculate magnetic declination for true north conversion
  • Updated UI text to reflect that the compass points to true north
  • Improved capitalization in user-facing messages

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/src/main/kotlin/de/timklge/karooheadwind/HeadingFlow.kt Implements GPS coordinate tracking and magnetic declination calculation to convert magnetic north to true north
app/src/main/res/values/strings.xml Updates compass description to indicate it points to true north
app/src/main/kotlin/de/timklge/karooheadwind/screens/WindyScreen.kt Capitalizes GPS fix waiting message
README.md Updates documentation to reflect compass points to true north
app/build.gradle.kts Reorders screenshot URLs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

val geomagneticField = GeomagneticField(
coords.lat.toFloat(),
coords.lon.toFloat(),
0f,
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The altitude parameter is hardcoded to 0f. Consider using actual altitude from GPS coordinates if available for more accurate declination calculations, especially in mountainous terrain where altitude can affect magnetic declination.

Suggested change
0f,
(coords.altitude ?: 0f),

Copilot uses AI. Check for mistakes.
@timklge timklge merged commit f56041d into master Nov 10, 2025
2 checks passed
@timklge timklge mentioned this pull request Nov 23, 2025
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

Successfully merging this pull request may close these issues.

1 participant