In the past there has been some confusion about how the compass works. For example:
I started looking into the code to understand what is going on and am now posting my findings/changes and requesting feedback.
Currently the compass displays something like the image below.
The direction arrow points in the direction of the node you have selected and is dependent on you current heading. Your current heading is supposedly represented by the letter N (based on what is in the code) which is confusing since it does not point north or really have anything to do with north.
There were a few other odd things in the code but in the end if you had a device in front of you and started walking in any direction the arrow pointing to another node would indeed guide you in the right direction (just ignore that N marker).
With the changes I have made you now have a display similar to what is pictured below:
The letter N is now fixed at the top of the compass. The letter H now represents your estimated current heading and the arrow points in the direction on the node selected.
This setup allows you to navigate in two ways:
- Start moving in any direction until you get H for your estimated heading and then adjust you bearing to try and line up H with the arrow pointing to the node (rinse repeat).
- If you know which way north is line up N with north and the arrow points in the direction of the node.
I also tried to clean up as much ambiguity in the code as I could. For example, the rotate function now rotates clockwise instead of counter clockwise, bearing calculations are clear about what points are being used for calculations and so on.
An area where I would like feedback is that I already know that I want to replace H with something else for your current heading. H gets distorted when rotating around the compass and can start looking a lot like N. Also, if you are heading north H will overlap N and it can be difficult to tell that is what happened.
One idea for replacing H would be to use a “flat arrow” to represent you current heading. This would look something like this picture:
The idea being that when your current heading lines up with the direction of the node it will end up looking something like this picture:
Not sure how intuitive that is. Other ideas welcome.
If you would like to try the new compass out give it a go and let me know what you think.