[Windows Mobile Apps and Games] Mach2003:
HD2 Compass Enabled Driver

Barty22 and I have a late Christmas present for you HD2 owners out there.

GpsModDriver 1.50b changelog:

- Added HD2 compass and g-sensor support to ModDriver

- Hardware compass is read and averaged (only when it exists in the phone)

- G-sensor is read, averaged, and translated into orientation code (only when compass exists in phone)

- Whenever GPS has no fix, compass heading is inserted into the GPS data

- Whenever speed is below (delta speed * HDOP), compass heading is inserted.

Basically what this new version will allow you to do is to use your hardware compass in all software applications that use GPS. This can be really helpful when navigating in unfamiliar locations. The effect the compass will have on your navigation software depends on the software itself.

This new build uses both the compass and the g-sensor. The compass "looks" from the top, away from the screen, at all times. Therefore the g-sensor is needed to detect the phone's landscape orientation and automatically correct for this change in heading that the compass sees when the phone is in landscape orientation.

Theoretically the compass works in both profiles of GpsModDriver; Walking and Driving. However, during our tests

the compass was unusable in the car due to the strong magnetic fields on the inside of the car. You can try this beta

to see how it works in your car, and please be sure to report your findings.

What will it do in your navigation software?

Of course you have to force your navigation software to use the GpsModDriver GPS COM port.

iGO8: In 3d view, your car arrow will rotate with the entire screen according to your compass heading, as long as you have a GPS fix. In 2d mode it will rotate the arrow according to your compass heading, or you can set it to rotate the map according to your heading, so that you will always move towards the top of your screen.

IMPORTANT: For this to work, disable the option "Keep position on road" in your iGO8 navigation settings (or go to pedestrian mode, which will automatically disable the "keep position on road" option).

IMPORTANT: To enable the "rotate map in 2d" mode, add the following to your sys.txt:

[map]

2dheadup=1

iGO Amigo: Currently iGO Amigo unfortunately won't use the compass heading in any way. Google Maps: Your current location and current heading will be displayed by means of a blue arrow. It will not rotate the map, but only the arrow.

Google Maps: Your current location and current heading will be displayed by means of a blue arrow. It will not rotate the map, but only the arrow.

Compass settings

- Added Compass Setup page to ModSetup, appropriate for your currently selected profile.

- Landscape Angle (30), degrees that the phone has to be tilted to "determine that it is landscape"

- Poll Rate (50), number of milliseconds between all g-sensor and compass readings

- Averages (5), number of g-sensor and compass readings to average together (rolling average)

- Portrait and Landscape selection buttons, choose the mode you wish to 'Zero' or 'Calibrate' for, of course the phone must also be in the correct orientation.

- Zero Calibration Button reset calibration number, for the active profile, and selected orientation to zero.

- Calibrate, use while above delta speed to set compass reading to GPS heading.

- Portrait and Landscape calibration values, these can be edited or 'calibrated'.

This page must be saved, and the main page saved (to update driver) to have any effect.

Calibration

This function is mostly un-tested, not working as desired at this time, manually enter correction numbers in the compass setup screen. But please do test this, and report your findings.

Each profile has its own calibration options, one for portrait and one for landscape. What this allows you to do is to correct for the difference between the magnetic North that your compass is reporting, and the true North that is displayed on the maps in your navigation software. If you're interested in finding out your "Magnetic Declination", go to www.magnetic-declination.com.

Calibration can also be helpful if you want to get a slightly more accurate correction of the compass heading when your phone is in landscape orientation. Calibration will also be useful when you want to use the compass in your car. Car mounts that are not completely aligned with the direction you are moving in (and that will be 99% of all car mounts) will report the compass heading of your phone, which in that case will not the same as the heading of your car. Calibration can correct for this.

To calibrate, you need to be moving in a straight line for about 10 seconds. You can reset your calibration values to zero or manually enter your calibrations. The format is easy, the calibration values are a positive or negative amount of degrees.

Please note that in order to calibrate for portrait or landscape, the phone actually has to be in portrait or landscape mode. When it is not in the correct orientation your calibration numbers will be inaccurate.

Important!!!

- Compass heading is only inserted into the GPS data when you are below (delta speed * HDOP).

For example, the default Delta Speed in driving profile is 50 - which means 5 kmph. What this does is that the compass heading is inserted into the GPS data and forwarded to the GPS software when you are moving below 5 kmph. Above 5 kmph this compass heading is replaced with your GPS heading, which is more accurate at high speeds anyway. This example is simplified because it does not take HDOP into account, but it should give you a simple idea of how it works.

Delta Speed in walking profile is also set by default to 50. It works the same way as in the driving profile. However, for all of you who want to use the compass feature while walking or riding the bike, it is highly recommended to force GpsModDriver to *always* use the compass heading, and to NOT let it switch to the GPS heading above a certain speed. The reason for this is that at low speeds, which you have when you are walking or on the bike, the measured speed is not always very accurate. As a result, your speed might jump to high values which will trigger the use of the (wrong) GPS heading for a short moment. In the GPS software this will be visible as a jumpy and wrong display of heading. You can set Delta Speed in the walking profile to 1500 to force the driver to use the compass heading instead of the GPS heading as long as you are below 150 kmph. This will make sure the jumpy speed that will happen when you are walking will not cause the compass heading to switch to GPS heading when it shouldn't.

- The current defaults for 'poll rate' and 'number of averages' settings are optimized for a speedy response rate of the compass and low CPU usage. It is just as fast as the HTC Digital Compass application! If you are an expert you can however decide to play with these.

- GPS data is sent to the GPS software at a rate of once per second. Because of this limitation, the compass heading in your GPS software will only be updated once per second as well.

- The compass is easily influenced by technical equipment such as computers. If you feel it is not working accurately, move away from these objects and try again.

- As mentioned before, we could not get the compass to function properly in the car. This has nothing to do with the functionality of the driver, but with the magnetic fields in the cars we used. Even the HTC Digital Compass application suffered serious problems in our tests. Perhaps it will work correctly in your car, we are not sure. Please try the beta driver in your car (in driving profile of course) and report.

BETA BUILD (1.50b) attached, useful for hardware compass only, tested on HD2 only. All devices should be able to use this build still, but no new features are included, except for the compass support.