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

Allow to keep mag calibration after airframe change #13276

Closed
wants to merge 2 commits into from

Conversation

jlecoeur
Copy link
Contributor

This solves a minor annoyance I encountered when switching between airframe configs.

The magnetometer calibration is erased when the airframe config is updated. This is based on the assumption that a different airframes have different magnetic influence.

This commit adds the parameter CBRK_KEEP_MAGCAL to preserve the magnetometer calibration on airframe change.
Use it if you do not change the physical airframe (only the software airframe config), and do not want to recalibrate.

Describe possible alternatives
The alternative is to always keep the magnetometer calibration, but I think the current default makes sense.

The magnetometer calibration is erased when the airframe config is updated. This is based on the assumption that a different airframes have different magnetic influence.

This commit adds the parameter CBRK_KEEP_CALMAG to preserve the magnetometer calibration on airframe change.
Use it if you do not change the physical airframe (only the software airframe config), and do not want to recalibrate.
@dagar
Copy link
Member

dagar commented Oct 25, 2019

I'm wondering about resetting the rotation of external sensors regardless.

@jlecoeur
Copy link
Contributor Author

I'm wondering about resetting the rotation of external sensors regardless.

I am not sure to understand, do you want to exclude all CAL_* sensors ?

@dagar
Copy link
Member

dagar commented Oct 27, 2019

I'm wondering about resetting the rotation of external sensors regardless.

I am not sure to understand, do you want to exclude all CAL_* sensors ?

Possibly if we were confident in the preflight checks (not yet). It's more of a development scenario, but at the moment I wouldn't be surprised if the current behavior often results in worse results overall. People get frustrated (and/or lazy) and recalibrate indoors with usb connected just to get through it.

if param compare CBRK_KEEP_MAGCAL 382716
then
# Wipe out params except RC*, flight modes, total flight time, next flight UUID, accel cal, gyro cal, AND mag cal
param reset_nostart RC* COM_FLTMODE* LND_FLIGHT_T_* TC_* COM_FLIGHT_UUID CAL_ACC* CAL_GYRO* CAL_MAG*
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if CAL_MAGx_ROT should still be reset.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hum, this circuit breaker is to avoid any sensor config when you know that nothing but software airframe will change.

For this reason, I think it is best not to reset external mag rotation when the circuit breaker is set.
On the contrary, in the normal case, external mags are probably mounted differently on the new airframe, so it is safer to reset CAL_MAGx_ROT.

Does that make sense?

@jlecoeur
Copy link
Contributor Author

It's more of a development scenario,

Exactly, it is more for developers use. I have faced the problem in two scenarios:

  • a board that I keep on the desk to test stuff, which I regularly have to recalibrate.
  • fully assembled robot, on which I load a different airframe to start different drivers and controllers -> boom, mag uncalibrated.

This was referenced Oct 30, 2019
@stale stale bot added the stale label Jan 25, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2020
@dagar dagar closed this Oct 9, 2022
@dagar dagar deleted the pr-keep_cal_mag branch October 9, 2022 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants