File tree Expand file tree Collapse file tree 2 files changed +30
-10
lines changed Expand file tree Collapse file tree 2 files changed +30
-10
lines changed Original file line number Diff line number Diff line change @@ -945,6 +945,25 @@ void AP_GPS::update_primary(void)
945
945
if (i == primary_instance) {
946
946
continue ;
947
947
}
948
+
949
+ // if primary is not a F9 and altternative is a F9 with 3D fix then use the F9
950
+ if (state[i].status >= GPS_OK_FIX_3D &&
951
+ strcmp (drivers[i]->name (), " u-blox" ) == 0 && drivers[i]->hardware_generation () == AP_GPS_UBLOX::UBLOX_F9 &&
952
+ strcmp (drivers[primary_instance]->name (), " u-blox" ) == 0 && drivers[primary_instance]->hardware_generation () != AP_GPS_UBLOX::UBLOX_F9) {
953
+ primary_instance = i;
954
+ _last_instance_swap_ms = now;
955
+ continue ;
956
+ }
957
+
958
+ // if primary F9 has 3D lock, and 2nd GPS is a M8, don't switch
959
+ if (state[primary_instance].status >= GPS_OK_FIX_3D &&
960
+ strcmp (drivers[primary_instance]->name (), " u-blox" ) == 0 && drivers[primary_instance]->hardware_generation () == AP_GPS_UBLOX::UBLOX_F9 &&
961
+ strcmp (drivers[i]->name (), " u-blox" ) == 0 && drivers[i]->hardware_generation () != AP_GPS_UBLOX::UBLOX_F9) {
962
+ // don't switch away from a F9 with 3D lock to a M8
963
+ continue ;
964
+ }
965
+
966
+
948
967
if (state[i].status > state[primary_instance].status ) {
949
968
// we have a higher status lock, or primary is set to the blended GPS, change GPS
950
969
primary_instance = i;
Original file line number Diff line number Diff line change @@ -144,6 +144,17 @@ class AP_GPS_UBLOX : public AP_GPS_Backend
144
144
145
145
// ublox specific healthy checks
146
146
bool is_healthy (void ) const override ;
147
+
148
+ enum ubx_hardware_version {
149
+ ANTARIS = 0 ,
150
+ UBLOX_5,
151
+ UBLOX_6,
152
+ UBLOX_7,
153
+ UBLOX_M8,
154
+ UBLOX_F9 = 0x80 , // comes from MON_VER hwVersion string
155
+ UBLOX_UNKNOWN_HARDWARE_GENERATION = 0xff // not in the ublox spec used for
156
+ // flagging state in the driver
157
+ };
147
158
148
159
private:
149
160
// u-blox UBX protocol essentials
@@ -620,16 +631,6 @@ class AP_GPS_UBLOX : public AP_GPS_Backend
620
631
NAV_STATUS_FIX_VALID = 1 ,
621
632
NAV_STATUS_DGPS_USED = 2
622
633
};
623
- enum ubx_hardware_version {
624
- ANTARIS = 0 ,
625
- UBLOX_5,
626
- UBLOX_6,
627
- UBLOX_7,
628
- UBLOX_M8,
629
- UBLOX_F9 = 0x80 , // comes from MON_VER hwVersion string
630
- UBLOX_UNKNOWN_HARDWARE_GENERATION = 0xff // not in the ublox spec used for
631
- // flagging state in the driver
632
- };
633
634
634
635
enum config_step {
635
636
STEP_PVT = 0 ,
You can’t perform that action at this time.
0 commit comments