confusion between GPS heading and compass heading

I am trying to display the heading from Position.Info and the heading from Sensors.Info separately but depending on whether I am standing still or moving fast, the two items seem to be linked to each other, i.e. show the same values. I am still not 100% sure about the logic behind that.
Is there any way to obtain the correct information for both data items separately ?
Moreover, can I read the data anytime through Position.getInfo() and Sensor.getInfo() simply based on a time triggered event ?
Thanks so much !

Quatix 3
  • Normally you would register for position and sensor events via the Position.enableLocationEvents() and Sensor.enableSensorEvents() methods. When you do this, your callback function will be called approximately once a second with updated data. You can poll the data by calling Position.getInfo() or Sensor.getInfo(), but I'm fairly certain that you won't get accurate position or sensor data if you don't use the previously mentioned enable...() functions first.

    Some devices don't have a magnetic compass, so the values will always be the same. For the devices that do have a magnetometer, it is only used under certain circumstances. I believe when you are stopped or barely moving it will use it, otherwise it will use your direction of travel.

    Travis
  • If you always want only the HW compass info, see the "AccelMag" sample in the SDK (mag is the compass part).

    If the "heading" switches between GPS and the mag you don't have an easy way to know that. If you're getting a GPS heading yet standing still, it's kind of weird, but with mag, if while standing still you just move your arm a few degrees, mag will reflect that. Same if uore moving fact enough if you're getting a "gps heading" on a device with a compass

    This kind of depends on what you want to use the data for...
  • If you always want only the HW compass info, see the "AccelMag" sample in the SDK (mag is the compass part).

    If the "heading" switches between GPS and the mag you don't have an easy way to know that. If you're getting a GPS heading yet standing still, it's kind of weird, but with mag, if while standing still you just move your arm a few degrees, mag will reflect that. Same if uore moving fact enough if you're getting a "gps heading" on a device with a compass

    This kind of depends on what you want to use the data for...



    In fact, I need both !
    While cruising on a boat, I need to tell the course of the boat over ground (COG) along with the speed (SOG) but at the same time, I sometimes have to direct the compass (bearing = BRG) to a special point of interest along the coast line. Therefore, it would be nice to read both COG and BRG at the same time.

    I have downloaded the Sailing App from RMZ84. Obviously, the developper is able to read both data items separately, but I just don't know how :-(
  • Built-in compass not reliable

    After studying the Demo App 'AccelMag', I have been playing with different options but can not get a reliable compass indication that is different from the Position.Info.heading.
    Even the North-direction of the Demo 'AccelMag' can be tricked by turning the watch (Quatix 3) slowly.
    Does anybody have a nice example which allows me to show the true course (from position) and the true bearing (from compass) independently ?????
    Thanks so much.
  • I must be missing something here. Let's say your moving east. Your heading will be east, from either GPS or mag data, and with the mag info directly, you'd be going east.

    You want to find the direction you should be going to get to a specific point (lets say it's in the south-east), correct?

    How do you define the point you want to head to? I'm guessing lat/lon.

    To me that sounds like you want to use your current lat/lon, and the lat/lon of the point you want to head towards to determine the direction you need to go to get to the specific point.

    Am I misunderstanding this? To me it sounds like your new direction is based on where you are and where to want to go to, and not on your current heading. Maybe then have some kind of indication that the heading is correct for where you want to go?

    The Acelmag sample shows two different things.. There's a dot that move around based on the accel, and an arrow that points north, based on the mag data. The dot will move around a lot, but that doesn't matter with the compass..

    I do something like this in an app, where I mark waypoints and from my current location, I show a list of the waypoints with the direction and distance to each one, for example.
  • I've been trying mag data a bit, and the most noticeable difference is when your standing still. With mag data, you look at your watch and and see which way you're facing (or actually your wrist is facing!). With GPS heading, when standing still, your heading bounces all over the place, as it can't figure out what direction you're moving, as you're not moving.. With mag data, even if you move backwards, it still sees north at the same place, even if you are moving 180' from that. That would be a case where GPS data is better than mag data for heading.

    I guess I'm still trying to figure out what the app will do. Is it something like "start here, head to point A, and once you get there, head to B" and so on? That would be a case where with some math, you use where you are and where the next point to go to is, and then use the mag to make sure you are heading the right way? (navigation type stuff)
  • 3 different directions

    Hi jim_m_58
    Thanks for looking so deep into this. Meanwhile, i have advanced a little and at least i got a better result from the magnetic sensors. i made a little mistake when dividing xMag by yMag. this ratio gave me an intgere and then of course my Math.atan(x/y) gave me stupid results.
    Still, we are left with 3 different directions:
    1. the compass bearing derived from Sensor.Info.mag
    2. the compass bearing obtained from Sensor.Info.heading
    3. the heading derived from Position.Info.heading
    In my current app, I added one page which shows all those three items at te same time and interestingly 1. and 2. show slightly different values whereas 3. has it's own life :-)
    I just wonder how, the built in SW of the Quatix 3 is calculating 2 and 3.
    For further studies, I am going to write down some of those triples while moving and also while standing still.

    Why do I need the heading and the bearing separately ?
    Imagine you are sailing on a boat with a course of 270 degrees (east to west) in parallel to a coast line. The heading derived from GPS should show 270. At the same time you are observing the coast line in the north. As soon as you see a given spot (e.g. a light house) exactly at 345 degrees (compass reading) from your current position you want to change your course from 270 to 290. This would be a typical scenario where you use the bearing to one or more landmarks to decide whether you have reached a certain waypoint.

    It's a pitty, that the API docu mixes up the two 'headings' without further explanation.
  • Hi all,
    This is also interesting for me, because in my app I can't get any precise heading to waypoint on fenix 3.
    When I use Info.heading it works pretty good until the speed is low (when I'm walking).
    But in car, either with Position.heading or Info.heading it shows a huge error (up to 90 degrees) despite of good gps signal.
    Previously I made compass calibration (I don't exactly know does that have impact on sensor values), but the same.