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

FINALLY fix mag rotation issues. #7366

Merged
merged 2 commits into from
Jun 7, 2017
Merged

FINALLY fix mag rotation issues. #7366

merged 2 commits into from
Jun 7, 2017

Conversation

mhkabir
Copy link
Member

@mhkabir mhkabir commented Jun 6, 2017

Fixes #7358.

@mhkabir
Copy link
Member Author

mhkabir commented Jun 6, 2017

@matanhavi @Tubme please test this PR thoroughly with all the problem cases you found.

@LorenzMeier I also realise that we can cut our loop times for voted_sensors_update in half (because I made small optimisations over the last few PRs which remove bad assumptions preventing this previously). We are currently super-wasteful with nested loops in the code. Something to remember after this fix goes in.

@mhkabir
Copy link
Member Author

mhkabir commented Jun 7, 2017

@bresch please test this :)

@matanhavi
Copy link
Contributor

I tested with the same configuration, and the PR fixes the issue.
Note that I tested it only on the table.

@@ -66,7 +66,7 @@ VotedSensorsUpdate::VotedSensorsUpdate(const Parameters &parameters, bool hil_en
// initialise the corrections
memset(&_corrections, 0, sizeof(_corrections));

for (unsigned i = 0; i < 3; i++) {
for (unsigned i = 0; i < math::max(ACCEL_COUNT_MAX, GYRO_COUNT_MAX); i++) {
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong: i stands for the axis index, not sensor index.

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.

@LorenzMeier LorenzMeier merged commit 5cbaaa6 into master Jun 7, 2017
@LorenzMeier LorenzMeier deleted the pr-mag-fix3 branch June 7, 2017 08:50
LorenzMeier pushed a commit that referenced this pull request Jun 7, 2017
* sensors : second cut at fixing mag calibration - remove old problematic code

* sensors : use more intuitive naming for loop variables
@tubeme
Copy link

tubeme commented Jun 21, 2017

This does not fix our issue. On the X2.1 the external mag0 was 180 degrees offset (the GPS + Mag physically are oriented toward the front). Even more, The CAL_MAG0_ROT was at Internal Mag (-1) and I could not change it! I tried a couple of times to give Yaw 180 degrees without success. I tried forcefully to change it with param 4 but again it did not store my choice. It seems like the QGC accepts the change but then it stays back to Internal Mag. I know there are 3 internal mags in X2.1 and 1 external. I don't see a MAG3 in Parameters...

Forgot to mention we flashed yesterdays master...

@mhkabir
Copy link
Member Author

mhkabir commented Jun 21, 2017

@Tubme can you give us a parameter dump? Please post it here : #7434 (instead of on this closed PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants