inav icon indicating copy to clipboard operation
inav copied to clipboard

Navigation flight modes get deleted at hardware fault.

Open Antiheld86 opened this issue 8 years ago • 10 comments

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

Antiheld86 avatar Mar 29 '18 14:03 Antiheld86

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).

shellixyz avatar Mar 29 '18 18:03 shellixyz

Correct, it does not delete anything

stronnag avatar Mar 29 '18 18:03 stronnag

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.

shellixyz avatar Mar 29 '18 18:03 shellixyz

unavailable is not deleted though.

stronnag avatar Mar 29 '18 18:03 stronnag

I'm not convinced that pretending configured devices are available when they are not is a good idea.

stronnag avatar Mar 29 '18 18:03 stronnag

@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.

shellixyz avatar Mar 29 '18 18:03 shellixyz

I think the presence of the mag should be checked like the GPS when arming and at least one nav flight mode is configured.

shellixyz avatar Mar 29 '18 18:03 shellixyz

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.

Antiheld86 avatar Mar 29 '18 19:03 Antiheld86

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.

stale[bot] avatar May 28 '18 19:05 stale[bot]

Automatically closing as inactive.

stale[bot] avatar Jun 11 '18 19:06 stale[bot]