Allow yaw reset to north when disarmed - for multirotors with no compass #11529
Allow yaw reset to north when disarmed - for multirotors with no compass #11529breadoven wants to merge 3 commits intoiNavFlight:maintenance-9.xfrom
Conversation
Review Summary by QodoEnable yaw reset to north for compass-less multirotors
WalkthroughsDescription• Allow yaw reset to north when disarmed for multirotors without compass - Uses compass calibration stick command to reset yaw to 0 degrees - Initializes GPS heading for navigation modes • Fix typo: rename compansatedGravityBF to compensatedGravityBF throughout • Code formatting improvements: spacing, line breaks, conditional statements • Add beeper feedback for successful yaw reset action Diagramflowchart LR
A["Disarmed State"] -->|"No Compass & CALIBRATE_MAG"| B["Reset Yaw to 0"]
B --> C["Beeper Feedback"]
C --> D["Initialize GPS Heading"]
D --> E["Ready for Nav Modes"]
File Changes1. src/main/flight/imu.c
|
Code Review by Qodo
1.
|
|
Test firmware build ready — commit Download firmware for PR #11529 234 targets built. Find your board's
|
|
The principal seems to work fine. Such features can be easily over looked. And harder to access for the user. Because they either forget they are there. Or they forget the stick sequence. |
|
Can you put something in the documentation covering this? |
|
I'll add something to document this. Should be in the controls.md anyway in fact because it's added to the compass calibration stick command ... I missed that. @Jetrell This and the other hidden functions could be added to the programming framework I guess but how would you use it though ?. I noticed mag calibration is in the programming already so it should be possible to use that somehow. Not so sure about modes though simply because there are so many already. This would work well with Multifunction so that's a possibility but then if you have a magless quad surely you'd just remember the stick command to set the heading to North every time you powered on. |
I suppose in their simplest form, they could be like a couple of the other Operations that just activate with a boolean 1, which could be simply driven from a LOW, MED or HIGH switch state.
Something that I've heard a lot of pilots say over the years. Is if a function requires too much effort to access, they just don't bother with it. Because many of them are struggling to grasp the basics of flight control. In any case. The user has to be familiar with that means of activation.. Which is far more to remember, than just flicking a switch, and you're done. This is likely why their are so many Modes. Because they are easy to use. Not that any person would ever use all of them on any one model. Don't take what I've said as criticism. I'm simply repeating what I have heard. |
|
I've tested an idea to make this more accessible without needing to remember stick commands. It works by adding a setting that defines a time period after power on during which you can set the heading by moving the throttle stick high. A system message is displayed during the time period "THROTTLE HIGH TO SET HEADING". The message disappears once the heading is set after which the throttle high method won't work again (you can still use the compass calibration stick command though ... if you can remember it). This only works if you have a GPS, no compass and not a fixed wing. Does this sound useful ? Edit: I guess a setting would push this out of 9.1 so this method would have to be added separately to this PR. |
Would it make sense to go with not memorizing anything and set 0 / north on first arm? No special commands needed, no setting needed. |
You could do but it would then inadvertently allow Nav modes to be activated with a heading that could be completely wrong. You need to be aware that the quad needs to be physically pointed North before setting the heading, that's why it needs some sort of deliberate action other than arming. You could avoid using a setting and simply have the message displayed up until arming but then there's the risk of moving the throttle high for some other reason and ending up with a false heading. At least with a setting the pilot should understand what they're doing because they used the setting in the first place. I think it's OK as is just with the compass calibration stick command. If you fly quads without a compass and you want to use Nav modes you'll just learn what to do if you want a valid heading before liftoff. |
Thanks for your thought towards this. Having a system message would certainly help with user assistance of activation for many functions. Regardless of what heading trigger method you end-up using for this specific feature. However if you go the way of the stick, maybe using the elevator stick might be a better call. The same as you did to remove the post flight stats.. It just feels wrong to push the throttle high, regardless of hard coded lockouts.
Not to sound sarcastic. If my reading of most peoples character is right. 90% will say stuff it. And just fly 10m to get a heading, then come back and hover in front of themselves, rather than getting out the phone and working out where north is.. Heck I'd likely do something similar. And do that on the first flight. Then remember from were I'm standing and certain geographic markers, which direction is north from the GNSS heading. Then use this method on every other flight afterwards. |
I figure MOST people will have no idea that this feature exists. Heck, it may be most people who now think there's no reason to have a compass anyway - INAV works without a compass, right? I saw it on Facebook. For the rest of us, I imagine some will use their phone compass, some live in areas with sane roads, so the roads run north-south and east-west. Point it the same direction as the road, toward the library that's at the end of the main road. Which also matches the orientation of that big building over there. And others will just fly around. To each their own. As long as it doesn't burn more than about a kilobyte of flash, it's there for those who want it. |
Allows yaw heading to be reset to 0 for multirotors that don't have a compass available. Uses the Compass calibration stick command to initiate the reset so only possible when disarmed.
It is intended to allow the heading on a multicopter to be manually aligned with north by pointing the craft north then resetting the yaw heading to 0 using the compass calibration stick command. This also initialises the GPS heading allowing use of Nav modes without first obtaining a valid GPS ground course.
Tests OK in Configurator.
Also includes various formatting and other trivial fixes. Main change is at line 845.