Skip to content

Commit 7b21171

Browse files
committed
AP_GPS: copy GPS metadata in for pre-per-instance-parameters
allows to not break older firmware in terms of available metadata
1 parent 006d2c6 commit 7b21171

File tree

1 file changed

+149
-0
lines changed

1 file changed

+149
-0
lines changed

libraries/AP_GPS/AP_GPS.cpp

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,155 @@ bool AP_GPS::gps_yaw_deg(uint8_t instance, float &yaw_deg, float &accuracy_deg,
19871987
return true;
19881988
}
19891989

1990+
/*
1991+
* Old parameter metadata. Until we have versioned parameters, keeping
1992+
* old parameters around for a while can help with an adjustment
1993+
* period.
1994+
*/
1995+
1996+
// @Param: _TYPE
1997+
// @DisplayName: 1st GPS type
1998+
// @Description: GPS type of 1st GPS
1999+
// @Values: 0:None,1:AUTO,2:uBlox,5:NMEA,6:SiRF,7:HIL,8:SwiftNav,9:DroneCAN,10:SBF,11:GSOF,13:ERB,14:MAV,15:NOVA,16:HemisphereNMEA,17:uBlox-MovingBaseline-Base,18:uBlox-MovingBaseline-Rover,19:MSP,20:AllyStar,21:ExternalAHRS,22:DroneCAN-MovingBaseline-Base,23:DroneCAN-MovingBaseline-Rover,24:UnicoreNMEA,25:UnicoreMovingBaselineNMEA,26:SBF-DualAntenna
2000+
// @RebootRequired: True
2001+
// @User: Advanced
2002+
2003+
// @Param: _TYPE2
2004+
// @CopyFieldsFrom: GPS_TYPE
2005+
// @DisplayName: 2nd GPS type
2006+
// @Description: GPS type of 2nd GPS
2007+
2008+
// @Param: _GNSS_MODE
2009+
// @DisplayName: GNSS system configuration
2010+
// @Description: Bitmask for what GNSS system to use on the first GPS (all unchecked or zero to leave GPS as configured)
2011+
// @Bitmask: 0:GPS,1:SBAS,2:Galileo,3:Beidou,4:IMES,5:QZSS,6:GLONASS
2012+
// @User: Advanced
2013+
2014+
// @Param: _GNSS_MODE2
2015+
// @DisplayName: GNSS system configuration
2016+
// @Description: Bitmask for what GNSS system to use on the second GPS (all unchecked or zero to leave GPS as configured)
2017+
// @Bitmask: 0:GPS,1:SBAS,2:Galileo,3:Beidou,4:IMES,5:QZSS,6:GLONASS
2018+
// @User: Advanced
2019+
2020+
// @Param: _RATE_MS
2021+
// @DisplayName: GPS update rate in milliseconds
2022+
// @Description: Controls how often the GPS should provide a position update. Lowering below 5Hz(default) is not allowed. Raising the rate above 5Hz usually provides little benefit and for some GPS (eg Ublox M9N) can severely impact performance.
2023+
// @Units: ms
2024+
// @Values: 100:10Hz,125:8Hz,200:5Hz
2025+
// @Range: 50 200
2026+
// @User: Advanced
2027+
2028+
// @Param: _RATE_MS2
2029+
// @DisplayName: GPS 2 update rate in milliseconds
2030+
// @Description: Controls how often the GPS should provide a position update. Lowering below 5Hz(default) is not allowed. Raising the rate above 5Hz usually provides little benefit and for some GPS (eg Ublox M9N) can severely impact performance.
2031+
// @Units: ms
2032+
// @Values: 100:10Hz,125:8Hz,200:5Hz
2033+
// @Range: 50 200
2034+
// @User: Advanced
2035+
2036+
// @Param: _POS1_X
2037+
// @DisplayName: Antenna X position offset
2038+
// @Description: X position of the first GPS antenna in body frame. Positive X is forward of the origin. Use antenna phase centroid location if provided by the manufacturer.
2039+
// @Units: m
2040+
// @Range: -5 5
2041+
// @Increment: 0.01
2042+
// @User: Advanced
2043+
2044+
// @Param: _POS1_Y
2045+
// @DisplayName: Antenna Y position offset
2046+
// @Description: Y position of the first GPS antenna in body frame. Positive Y is to the right of the origin. Use antenna phase centroid location if provided by the manufacturer.
2047+
// @Units: m
2048+
// @Range: -5 5
2049+
// @Increment: 0.01
2050+
// @User: Advanced
2051+
2052+
// @Param: _POS1_Z
2053+
// @DisplayName: Antenna Z position offset
2054+
// @Description: Z position of the first GPS antenna in body frame. Positive Z is down from the origin. Use antenna phase centroid location if provided by the manufacturer.
2055+
// @Units: m
2056+
// @Range: -5 5
2057+
// @Increment: 0.01
2058+
// @User: Advanced
2059+
2060+
// @Param: _POS2_X
2061+
// @DisplayName: Antenna X position offset
2062+
// @Description: X position of the second GPS antenna in body frame. Positive X is forward of the origin. Use antenna phase centroid location if provided by the manufacturer.
2063+
// @Units: m
2064+
// @Range: -5 5
2065+
// @Increment: 0.01
2066+
// @User: Advanced
2067+
2068+
// @Param: _POS2_Y
2069+
// @DisplayName: Antenna Y position offset
2070+
// @Description: Y position of the second GPS antenna in body frame. Positive Y is to the right of the origin. Use antenna phase centroid location if provided by the manufacturer.
2071+
// @Units: m
2072+
// @Range: -5 5
2073+
// @Increment: 0.01
2074+
// @User: Advanced
2075+
2076+
// @Param: _POS2_Z
2077+
// @DisplayName: Antenna Z position offset
2078+
// @Description: Z position of the second GPS antenna in body frame. Positive Z is down from the origin. Use antenna phase centroid location if provided by the manufacturer.
2079+
// @Units: m
2080+
// @Range: -5 5
2081+
// @Increment: 0.01
2082+
// @User: Advanced
2083+
2084+
// @Param: _DELAY_MS
2085+
// @DisplayName: GPS delay in milliseconds
2086+
// @Description: Controls the amount of GPS measurement delay that the autopilot compensates for. Set to zero to use the default delay for the detected GPS type.
2087+
// @Units: ms
2088+
// @Range: 0 250
2089+
// @User: Advanced
2090+
// @RebootRequired: True
2091+
2092+
// @Param: _DELAY_MS2
2093+
// @DisplayName: GPS 2 delay in milliseconds
2094+
// @Description: Controls the amount of GPS measurement delay that the autopilot compensates for. Set to zero to use the default delay for the detected GPS type.
2095+
// @Units: ms
2096+
// @Range: 0 250
2097+
// @User: Advanced
2098+
// @RebootRequired: True
2099+
2100+
// @Param: _COM_PORT
2101+
// @DisplayName: GPS physical COM port
2102+
// @Description: The physical COM port on the connected device, currently only applies to SBF and GSOF GPS
2103+
// @Range: 0 10
2104+
// @Increment: 1
2105+
// @User: Advanced
2106+
// @Values: 0:COM1(RS232) on GSOF, 1:COM2(TTL) on GSOF
2107+
// @RebootRequired: True
2108+
2109+
// @Param: _COM_PORT2
2110+
// @DisplayName: GPS physical COM port
2111+
// @Description: The physical COM port on the connected device, currently only applies to SBF and GSOF GPS
2112+
// @Range: 0 10
2113+
// @Increment: 1
2114+
// @User: Advanced
2115+
// @RebootRequired: True
2116+
2117+
// @Group: _MB1_
2118+
// @Path: MovingBase.cpp
2119+
2120+
// @Group: _MB2_
2121+
// @Path: MovingBase.cpp
2122+
2123+
// @Param: _CAN_NODEID1
2124+
// @DisplayName: GPS Node ID 1
2125+
// @Description: GPS Node id for first-discovered GPS.
2126+
// @ReadOnly: True
2127+
// @User: Advanced
2128+
2129+
// @Param: _CAN_NODEID2
2130+
// @DisplayName: GPS Node ID 2
2131+
// @Description: GPS Node id for second-discovered GPS.
2132+
// @ReadOnly: True
2133+
// @User: Advanced
2134+
2135+
/*
2136+
* end old parameter metadata
2137+
*/
2138+
19902139
namespace AP {
19912140

19922141
AP_GPS &gps()

0 commit comments

Comments
 (0)