zs6buj / AntTracker

Antenna Tracker for tracking a moving model aircraft or drone with a small high-gain UHF or SHF antenna
GNU General Public License v3.0
141 stars 41 forks source link

Bug found in Compass.ino #54

Closed DiscoMan18 closed 1 year ago

DiscoMan18 commented 1 year ago

if defined Compass_Align

      fHeading = applySensorAlignment(fHeading, Compass_Align);
    #endif

Change Compass_Align to Compass_Rotation :)

Sorry, I'm writing this from a phone, can't use proper formatting. Also it would be good to see one day compass calibration and tilt compensation.

Great project anyways, all the fpv community should thank you for this:)

DiscoMan18 commented 1 year ago

A separate thanks goes for QLRS support:)

zs6buj commented 1 year ago

@DiscoMan18

Thank you for the feedback. Could you give me a little more reasoning for the change to Bohan's PR? I'm travelling and also working on my phone :)

DiscoMan18 commented 1 year ago

Well, the reason for this change in code is simple: Compass_Align is a structure, and Compass_Rotation is a constant that should have only one of the values the struct contains. When you pass Compass_Align to the function it simply doesn't work and proper compass align is not applied at all. I tested it yesterday with TTGO T-Display board and HMC5883L compass module. After the change in code that I proposed above it started finally working.

zs6buj commented 1 year ago

I'm looking at it now on the big screen, and I can see it needs a bit of work. Thanks again for the feedback.

zs6buj commented 1 year ago

V2.19.10 . Could you please try it when you get the chance.

DiscoMan18 commented 1 year ago

V2.19.10 . Could you please try it when you get the chance.

Sorry, I can't, as I used your code and have completely rewritten it to suit my purposes. But it should be working, as I already tested these changes on my own.