-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add UI for onboard compass calibration #2554
Add UI for onboard compass calibration #2554
Conversation
return | ||
} | ||
mavlink2rest.setParam('EK3_SRC1_POSXY', 0, autopilot_data.system_id) | ||
// wait for the param to get set, wait up to 3 seconds |
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.
The problem for using such comments.. is that they can be out of sync with the code.. as we are seeing now. I would recommend changing it to:
// wait for the param to get set, wait up to 3 seconds | |
// Wait for the param to get set |
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.
cleaned up
@@ -139,6 +171,15 @@ export default { | |||
}, | |||
}, | |||
) | |||
await sleep(0.5) |
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.
Can we have a scope defined function to avoid the duplicated code ?
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.
done
export default { | ||
name: 'CalibrationQualityIndicator', | ||
props: { | ||
quality: { |
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.
Can you add a comment explaining what range quality is working here ?
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.
done
} | ||
</script> | ||
|
||
<style scoped> |
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 scope should be removed/
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.
done
display_width: 0, | ||
}), | ||
computed: { | ||
computed_color() { |
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.
We should use something like this:
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 mimics the color bars in QGroundControl
So while we display a gradient, these limits are the same as used by QGC
I'm pondering adding some icons as well. maybe ✔️ ,
}, | ||
all_compasses_calibrated() { | ||
if (!this.compasses_calibrated) { | ||
return 0 |
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.
Isn't this supposed to be a bool ?
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.
yep. added return type too
9751bab
to
fc5b503
Compare
const message = 'Timed out waiting' | ||
if (raise) { | ||
throw new Error(message) | ||
} else { |
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.
else is unnecessary after throw
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.
fixed
Also creates supports_setting_position() for disabling setting the position on non-sub vehicles
fc5b503
to
c21410e
Compare
This is the calibration method available on QGC, MissionPlanner, and etc.
Screencast.from.2024-04-19.16-49-10.webm
ps: the progress bar is actually centered in the code, I made the video before I fixed it