Navigation flight modes get deleted at hardware fault.
Behavior
The fact that Navigation flight modes are not configurable when mag/gps/baro are not available deletes all already configured modes when one of these is disconnected. That makes it uncomfortable and probably dangerous if you disconnect for doing changes or something and power up the board but dont apply the modes again later.
Is this a new feature request? yes
I don't think it clears the navigation modes if you just unplug the GPS/mag only if you disable the GPS feature (feature -GPS).
Correct, it does not delete anything
I checked the code. @Antiheld86 is partially right. When the mag is not detected it also makes the navigation flight modes unavailable.
fc/fc_msp_box.c:
if ((feature(FEATURE_GPS) && sensors(SENSOR_MAG) && sensors(SENSOR_ACC)) || (STATE(FIXED_WING) && sensors(SENSOR_ACC) && feature(FEATURE_GPS))) {
activeBoxIds[activeBoxIdCount++] = BOXNAVPOSHOLD;
activeBoxIds[activeBoxIdCount++] = BOXNAVRTH;
activeBoxIds[activeBoxIdCount++] = BOXNAVWP;
activeBoxIds[activeBoxIdCount++] = BOXHOMERESET;
activeBoxIds[activeBoxIdCount++] = BOXGCSNAV;
}
sensors(SENSOR_MAG) is false when the mag is not detected. Would be good to make sensors(SENSOR_MAG) true when the mag is configured even if it is not detected. I will PR that.
unavailable is not deleted though.
I'm not convinced that pretending configured devices are available when they are not is a good idea.
@stronnag That's how it is working for the GPS. On fixed wing you can have a bare FC (nothing connected to it but an USB cable) enable the GPS feature then you can configure the nav modes. It is not the same with MRs because of the sensors(SENSOR_MAG) becoming true only if the sensor is actually detected not only configured.
I think the presence of the mag should be checked like the GPS when arming and at least one nav flight mode is configured.
It is possible that they got deleted after i disabled the mag to be able to arm again. Wouldn't it be nice if they would not be deleted even if it gets disabled? Probably like they are there but not able to be activated.
This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. This issue / pull request will be closed if no further activity occurs within two weeks.
Automatically closing as inactive.