-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added the target heading and distance to the compass when it is set #68
base: main
Are you sure you want to change the base?
Conversation
My JS skills are pretty bad tbh but I'll take a closer look at the code when I get a chance. Functionality wise it looks correct from the testing I've done. I'll actually review this correctly in the next few days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nothing stands out. @abhaybd can you take a look over this? Testing wise it all works really nicely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! lgtm @abhaybd ready for your final pass to catch js things i miss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not connected to rover: Waypoint can be set (0,0) is directly East, no distance labels
Maybe disallow setting of waypoint when there's no rover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, nice job! Just left some minor notes.
Also Isaac raised a good point, when the distance is <0.5m or something we shouldn't display a heading indicator (maybe display like a green ring around the outside of the compass to indicate we've reached? you tell me)
I think setting the waypoint is fine when the rover is disconnected, we should just disable the "start navigation" button.
@@ -32,6 +33,53 @@ function sanitize(num, decimals) { | |||
return num >= 0 ? " " + ret : ret; | |||
} | |||
|
|||
/** | |||
* Convert latitude and longitudes to heading. | |||
* Based on https://www.igismap.com/formula-to-find-bearing-or-heading-angle-between-two-points-latitude-longitude/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda nitpicky, but can we make this @see https://...
|
||
/** | ||
* Convert latitude and longitudes to distance. | ||
* Based on the Haversine formula (https://en.wikipedia.org/wiki/Haversine_formula) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, do @see https://...
I opted to change the color of the target distance text. The outer compass color is already used to indicate the attitude of the rover. |
04a457b
to
0ff4659
Compare
Didn't get to this before CIRC, Hutton can handle review and merging. |
After pressing "Set Waypoint" in the Waypoint Navigation interface, the heading to the target will appear on the compass as a gold circle (i.e., when the needle is facing the gold circle, it is facing the target). And the distance to the target will be displayed on the compass (>20 meters or the actual value rounded to the nearest tenth). The "Set Waypoint," button turns into "Unset Waypoint" after the waypoint has been set, and at that point, the "Go" button will be enabled. Pressing "Go" will disable the waypoint inputs and buttons.