-
Notifications
You must be signed in to change notification settings - Fork 316
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
added magnetometer models #2056
Conversation
@RomanLut Very nice rendering of the GNSS/mag hardware models.. It looks to work much better. But I did notice the alignment tool would occasionally lock-up the configurator after a save/reboot. |
sounds good :-) |
Do you mean that after "save and reboot" configurator may fall into never endling loading cycle? Unfortunatelly it happens with other tabs with current Master. Alignment tool is not exception here. |
I forwarded this build to a friend who was having trouble setting up his quad. Which has both the GNSS/mag module and FC board rotated from the forward default position. I'd like to give you some history. The procedure was simple. By default, the arrow on the FC and the arrow on the GNSS module should face the direction the aircraft will travel. With the Orientation Preset being the offset of the magnetometer chip, with respect to the arrow they provide, or the plug facing the opposite direction to the arrow (rear of the model) Can I ask a question respectfully. I'm under the impression that you misunderstand what the Orientation Preset or CLI I ask because it seems you have integrated
Look at the example below. This is what the tool has always shown when Instead, it should look like this with the arrow facing forward, or the plug facing the rear of the aircraft.. The Roll, Pitch and Yaw sliders should be zero after the orientation preset (offset) is applied. If all three sliders are not at zero, after the orientation preset is loaded. The image below shows how the tool does not work as the user would expect. The only one that is not effected is CW0 or CW0FLIP.. Because a module with that preset, will already have a correct reference to the front of the aircraft. |
Yes he has to do this way. This is the whole idea of the tool. If he can provide photos of his setup, we may try to understang what is wrong. The are two methods to provide orientation of the mag in inav: If all (b) are zero, then align_mag is used. if any of (b) is non-zero, then (b) is used and align_mag is ignored. (a) defines rotation relative to FC. (b) defines absolute rotation. This is how settings work in inav. This is not going to be changed. On this picture tool shows that align_mag is ignored - dropdown is crosed out. Orientation is set with (b) - defined with sliders. On this picture, tool shows that align_mag=cw270flip is used (dropdown is NOT crossed out). At the same time, sliders show values for (b) which would provide the same orientation as align_mag=cw270flip with current FC rotation. If user desides to define orientation using (b), he can touch sliders. Dropdown will became crossed out. This very usefull if mag is mounted slightly off. User can rotate it a little bit at any time, tool will switch to (b).
Arrow is not facing forward because align_mag is ignored. I thought that crossed out dropdown would be enough to understand that preset is not used. If it is not the case - I can add explicit bold text somewhere. If you want to define orientation with (a) - select preset in dropdown, do not touch sliders, save and reboot. You might wonder what will happend if user set sliders to zero and save setting - will it revert to cw270flip preset and screw up orientation? No, tool will save align_max_pitch=0, align_max_roll=0, align_mag_yaw=1. Orientatino will still be defined by angles consistently. |
I agree. And I understand your view point on this matter.
I believe the above explanation is somewhat confusing for new users. I rang the guy I was speaking to about this. He doesn't have a Github account. You can see that the front of the aircraft is the reference point. (green arrow and 0°.) I know this is simple if you understand, as you and I do. This is why I said the mag sliders should be set to zero when an orientation preset is defined and loaded, providing an active offset, referenced from the front of the aircraft. |
If FC is mounted with arrow pointing forward: If matek-m10q is mounted with arrow facing forward, then cw270flip orientation preset should be used. If matek-m10q is mounted with arrow facing backward, then cw90flip orientation preset should be used. Sliders do not show rotation which is "additionally applied on top of orientation preset". They show values of align_mag_xxx settings which corresponds to orientation of magnethometer as seen on screen. Maybe this helps to understand: yaw slider has to be set to 90 because CW90flip means "rotation by 90 on yaw". |
@RomanLut I've been watching this pull request along with #2025. I would like to send a thank you for attempting to make this tool work correctly.
We may understand. But I guarantee you that know one else will. If I had to go to that much trouble to decipher what the tool is telling me, I wouldn't bother with it. As I don't. But this isn't about me. |
User in NOT required to undestand how aling* settings work. User is NOT required to know preset name for default mounting of mag. User is NOT requred to know order or rotations and directions of euler angles. In extreme case, I could hide all text, numbers and dropdown, and display just three nameless sliders. All user is required to do - is to rotate mag model to match physical orientaton and click "save and reboot". Values of align_mag_* settings make no sense for the user? It is expected. In order for settings to make sense, user has to understand everything mentioned above. |
I was just looking at the alignment tool in 7.x and noticed that the default model arrow does not match the gps axix, which certainly does not help. Having these many models with correct alignment would be a great step forward, but I worry a bit about keeping it up to date in the long term. |
I was going to report a problem with the compass side of the alignment tool in iNav 7.1. But its already being worked on. Thanks @RomanLut
That is not correct. Additional align mag slider setting should be zero after the orientation preset 90, 180 or 270 are applied. As for the XY coordinates. I fail to see the benefit of them being added to a module or to the tool. How are people to know if its X positive / negative, or Y positive / negative. |
@Choolet >why you have not zeroed the magnetometer sliders once the orientation preset is applied The are two methods to provide orientation of the mag in inav: If all (b) are zero, then align_mag is used. if any of (b) is non-zero, then (b) is used and align_mag is ignored. This is stated in the title "2. Select a preset (align_mag) or create a custom configuration using the sliders So yes, in order for preset(align_mag) to take effect, align_mag_pitch, align_mag_roll, align_mag_yaw settings should be zeroed. At the same time, it is usefull to show align_mag_pitch, align_mag_roll, align_mag_yaw settings which would provide the same orientation as selected preset with current FC rotation. If user desides to define orientation using (b), he can touch sliders. For example: I am experienced user, I know that my FC is not rotated, my matek magnehometer is mounted with arrow forward, so I select CW270FLIP. Then I notice that mag is actually slightly off by 20 degrees, so I use sliders to adjust orientation slightly. Tool switches from preset to align_mag_* settings once sliders are touched. In this PP, I hope I made enough changes in interface to indicate which settings take effect. If preset takes effect, then align_mag_pitch, align_mag_roll, align_mag_yaw are striked out, and CLI string below shows "align_mag_pitch=0, align_mag_roll=0, align_mag_yaw=0" for thouse who understand how settings work: If align_mag_pitch, align_mag_roll, align_mag_yaw takes effect, then preset dropdown is striked out: Update: Also a label has been added which rexplicitly tell: "Magnetometer orientation is defined by: PRESET" or "Magnetometer orientation is defined by: ANGLES".
Actually, XYZ model is the most important model in the tool. This single model is enough to setup any magnetometer. inav does not care about magnetometer or magnetometer chip manufacturer, arrow marking, default preset etc. All inav needs to know is how magnethometer local frame axes are oriented on the physical setup. If magnethometer has XY axis markings, settings can be easily found in tool by aligning XYZ model to physical setup. So in future, if some magnetometer 3D model is not included in tool, setings could be found by alligning axes. |
I don't agree with that assessment. (a) Should be applied first. When any one of the orientation presets are applied. All the (b) sliders should be reset to ZERO. So they can be used to reference mounting position changes by the user.
(a) stands by itself. It should not be rendered void when the sliders are adjusted. |
align_mag_roll, align_mag_pitch, align_mag_yaw are not applied on top of preset (allign mag) in inav. If CW270FLIP preset takes effect, then settings are: If magnethometer is off by 1 degree, then settings should be: While CW270FLIP preset takes effect, I prefer to set sliders in positions 0 180 270 and strke out "align_mag_xxx" title to indicate that sliders values do not have effect. This way, when user touches sliders, magnetometer keeps orientation and does not flip to 0,0,0 (CW0). |
@RomanLut shall we merge? It looks awesome enought :) |
PR is ready for merging. |
This PR adds 3D models of various magnetometers and magnethometer chips to Alignment tool tab.