Skip to content

Conversation

Williangalvani
Copy link
Member

No description provided.

@Williangalvani Williangalvani force-pushed the implement_compass_cal branch 12 times, most recently from b072b5b to f5d9a0f Compare February 1, 2024 19:56
@Williangalvani Williangalvani marked this pull request as ready for review February 1, 2024 20:37
Copy link
Member

@joaoantoniocardoso joaoantoniocardoso left a comment

Choose a reason for hiding this comment

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

Large vehicle calibration is working fine! :)

one annoying thing: the "Current Declination", which doesn't show the current declination, rather, it seems to be showing the last manual declination set.

It's weird to have to input the declination in a separate window if I can select the value. Maybe make it non-selectable, but also, make something like a transparent text that shows when the mouse hovers it saying "CLICK TO EDIT", to indicate the action.

Also about it, the edit box contains units, and the main "current declination" value does not.

Another thing is: why can't I manually enter the GPS coordinates?

@joaoantoniocardoso
Copy link
Member

This is visually annoying:

image

(could we just remove those gears?)

@joaoantoniocardoso
Copy link
Member

joaoantoniocardoso commented Feb 2, 2024

  • I know the calibration is supposed to be quick, but by default, we could have a progress bar saying "calibrating". Somehow, my calibration got stuck in one of my tests, and I waited for a minute, I forgot to see the console and hit F5.
    edit: It happened again. Nothing in the console, it took around 3 minutes to calibrate.

Another UI thing: can we remove this bar?

image

@ES-Alexander ES-Alexander added the docs-needed Change needs to be documented label Feb 5, 2024
Copy link
Member

@patrickelectric patrickelectric left a comment

Choose a reason for hiding this comment

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

I forgot to send my review 🤦
I have not finished yet, but should catch up later today.

@@ -0,0 +1,186 @@
export function degrees (radians: number): number {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll give it a go.

Copy link
Member Author

Choose a reason for hiding this comment

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

well, after looking at it, I think I'd rather keep well-defined Vector3 and Matrix3 types. The constructors are also different, and I'm tired of looking at this code as a whole 😅


export function mag_heading(RawImu: Vector3, attitude: Vector3, declination: number) {
// calculate heading from raw magnetometer
if (declination === undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

How is that possible if the type of declination is not | undefined ?

Copy link
Member Author

Choose a reason for hiding this comment

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

it is not. good catch

const headY = magY * dcmMatrix.e(8) - magZ * dcmMatrix.e(7)
const headX = magX * cosPitchSqr - dcmMatrix.e(6) * (magY * dcmMatrix.e(7) + magZ * dcmMatrix.e(8))
let heading = degrees(Math.atan2(-headY, headX)) + declination
if (heading < -180) {
Copy link
Member

Choose a reason for hiding this comment

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

while ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I dont think atan2 can produce anything that far. but maybe if declinations is set wrongly...
updating it anyway.

components: {
ParamSets,
ArdupilotMavlinkCompassSetup,
SpinningLogo,
Copy link
Member

Choose a reason for hiding this comment

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

Are we using it ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, it shows up while the parameters are not fully loaded

@Williangalvani
Copy link
Member Author

Williangalvani commented Feb 6, 2024 via email

@Williangalvani Williangalvani force-pushed the implement_compass_cal branch 3 times, most recently from db84243 to 1d6ccfc Compare February 9, 2024 18:17
@Williangalvani Williangalvani force-pushed the implement_compass_cal branch 2 times, most recently from c5c00e3 to 5791f6b Compare February 9, 2024 18:25
@patrickelectric patrickelectric enabled auto-merge (rebase) February 12, 2024 19:20
@patrickelectric patrickelectric enabled auto-merge (rebase) February 12, 2024 19:22
@patrickelectric patrickelectric merged commit 1eed2a6 into bluerobotics:master Feb 12, 2024
@Williangalvani Williangalvani deleted the implement_compass_cal branch February 12, 2024 19:23
@ES-Alexander ES-Alexander added docs-minimal Documentation exists but should be improved and removed docs-needed Change needs to be documented labels Oct 6, 2024
@ES-Alexander ES-Alexander added the docs-in-progress Included in an open docs PR label Apr 15, 2025
@ES-Alexander ES-Alexander added docs-complete Change documentation has been completed and removed docs-minimal Documentation exists but should be improved docs-in-progress Included in an open docs PR labels Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-complete Change documentation has been completed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants