Skip to content
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

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

Williangalvani
Copy link
Member

@Williangalvani Williangalvani commented Apr 19, 2024

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

return
}
mavlink2rest.setParam('EK3_SRC1_POSXY', 0, autopilot_data.system_id)
// wait for the param to get set, wait up to 3 seconds
Copy link
Member

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:

Suggested change
// wait for the param to get set, wait up to 3 seconds
// Wait for the param to get set

Copy link
Member Author

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)
Copy link
Member

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 ?

Copy link
Member Author

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: {
Copy link
Member

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 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
</script>

<style scoped>
Copy link
Member

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/

Copy link
Member Author

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() {
Copy link
Member

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:

https://www.npmjs.com/package/javascript-color-gradient

Copy link
Member Author

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 ✔️ , ⚠️ , and

},
all_compasses_calibrated() {
if (!this.compasses_calibrated) {
return 0
Copy link
Member

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 ?

Copy link
Member Author

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

const message = 'Timed out waiting'
if (raise) {
throw new Error(message)
} else {
Copy link
Member

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

Copy link
Member Author

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
@patrickelectric patrickelectric merged commit 0f34c43 into bluerobotics:master Apr 24, 2024
6 checks passed
@ES-Alexander ES-Alexander added the docs-needed Change needs to be documented label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-needed Change needs to be documented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants