apache / apache/cordova-plugin-device-orientation

compass heading is off by 40 degrees

Open
#85 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
63
Forks
80
PR merge metrics
No merged PRs in 30d

Description

## Problem
On a Samsung Galaxy S23 Ultra, the compass is about 40 degrees off. The compass shows 320 degrees when pointing north. It's off 40 degrees while pointing any directions. The Google Maps app shows the compass pointing in the correct direction, so I assume the phone operating system has the accurate compass?

### What is expected to happen?
Compass heading is accurate.

### What does actually happen?
Compass heading is not accurate.

## Information

### Command or Code

```
navigator.compass.watchHeading(function(a) {
// returns {magneticHeading: 323.75201416015625, trueHeading: 323.75201416015625, headingAccuracy: 0, timestamp: 1725987545312} while pointing north (0/360)
}
```

### Environment, Platform, Device

### Version information

Cordova CLI 12.0.0
Android 13.0
Plugin 3.0.0

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start by reproducing navigator.compass.watchHeading on the Samsung Galaxy S23 Ultra with Cordova CLI 12.0.0, Android 13.0, and plugin 3.0.0, then inspect how the plugin produces magneticHeading and trueHeading. Compare the reported values with the device or Google Maps while pointing north; done means the heading is accurate across directions.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.