mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-28 09:58:23 +08:00
[modules] Support dual ublox GPS modules (#3267)
* [modules] Support dual ublox GPS modules * Fix UCenter * Fix make test_modules * Fix: tell ins_ekf2 when no YAW is available --------- Co-authored-by: Christophe De Wagter <dewagter@gmail.com>
This commit is contained in:
+34
-16
@@ -19,7 +19,7 @@
|
||||
<settings>
|
||||
<dl_settings>
|
||||
<dl_settings name="gps_ublox">
|
||||
<dl_setting MIN="1" MAX="3" STEP="1" values="Hotstart|Warmstart|Coldstart" module="gps/gps_ubx" VAR="gps_ubx.reset" shortname="reset"/>
|
||||
<dl_setting MIN="1" MAX="3" STEP="1" values="Hotstart|Warmstart|Coldstart" module="gps/gps_ubx" VAR="gps_ubx_reset" shortname="reset"/>
|
||||
</dl_settings>
|
||||
</dl_settings>
|
||||
</settings>
|
||||
@@ -36,33 +36,51 @@
|
||||
<event fun="gps_ubx_event()"/>
|
||||
<datalink message="HITL_UBX" fun="gps_ubx_parse_HITL_UBX(buf)"/>
|
||||
<makefile target="ap|fbw">
|
||||
<configure name="UBX_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
|
||||
<configure name="UBX_GPS_BAUD" default="$(GPS_BAUD)"/>
|
||||
|
||||
<file name="gps_ubx.c"/>
|
||||
|
||||
<!-- GPS Ublox 1 -->
|
||||
<configure name="UBX_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
|
||||
<configure name="UBX_GPS_BAUD" default="$(GPS_BAUD)"/>
|
||||
<define name="USE_$(UBX_GPS_PORT_UPPER)"/>
|
||||
<define name="UBX_GPS_LINK" value="$(UBX_GPS_PORT_LOWER)"/>
|
||||
<define name="UBX_GPS_PORT" value="$(UBX_GPS_PORT_LOWER)"/>
|
||||
<define name="$(UBX_GPS_PORT_UPPER)_BAUD" value="$(UBX_GPS_BAUD)"/>
|
||||
|
||||
<!-- GPS Ublox 2 -->
|
||||
<configure name="UBX2_GPS_PORT" default="$(GPS2_PORT)" case="upper|lower"/>
|
||||
<configure name="UBX2_GPS_BAUD" default="$(GPS2_BAUD)"/>
|
||||
<define name="USE_$(UBX2_GPS_PORT_UPPER)" cond="ifneq ($(UBX2_GPS_PORT)$(SECONDARY_GPS),)"/>
|
||||
<define name="UBX2_GPS_PORT" value="$(UBX2_GPS_PORT_LOWER)" cond="ifneq ($(UBX2_GPS_PORT)$(SECONDARY_GPS),)"/>
|
||||
<define name="$(UBX2_GPS_PORT_UPPER)_BAUD" value="$(UBX2_GPS_BAUD)" cond="ifneq ($(UBX2_GPS_BAUD)$(SECONDARY_GPS),)"/>
|
||||
<define name="GPS_UBX_NB" value="2" cond="ifneq ($(UBX2_GPS_PORT)$(SECONDARY_GPS),)"/>
|
||||
|
||||
<raw>
|
||||
ifdef SECONDARY_GPS
|
||||
ifneq (,$(findstring $(SECONDARY_GPS), ublox))
|
||||
# this is the secondary GPS
|
||||
$(TARGET).CFLAGS += -DGPS_SECONDARY_TYPE_H=\"modules/gps/gps_ubx.h\"
|
||||
$(TARGET).CFLAGS += -DSECONDARY_GPS=GPS_UBX
|
||||
ifneq (,$(findstring ublox2, $(SECONDARY_GPS)))
|
||||
# this is the secondary GPS
|
||||
$(TARGET).CFLAGS += -DGPS_SECONDARY_TYPE_H=\"modules/gps/gps_ubx.h\"
|
||||
$(TARGET).CFLAGS += -DSECONDARY_GPS=GPS_UBX2
|
||||
else ifneq (,$(findstring ublox, $(SECONDARY_GPS)))
|
||||
# this is the secondary GPS
|
||||
$(TARGET).CFLAGS += -DGPS_SECONDARY_TYPE_H=\"modules/gps/gps_ubx.h\"
|
||||
$(TARGET).CFLAGS += -DSECONDARY_GPS=GPS_UBX
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring ublox2, $(PRIMARY_GPS)))
|
||||
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"modules/gps/gps_ubx.h\"
|
||||
$(TARGET).CFLAGS += -DPRIMARY_GPS=GPS_UBX2
|
||||
else ifneq (,$(findstring ublox, $(PRIMARY_GPS)))
|
||||
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"modules/gps/gps_ubx.h\"
|
||||
$(TARGET).CFLAGS += -DPRIMARY_GPS=GPS_UBX
|
||||
endif
|
||||
else
|
||||
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"modules/gps/gps_ubx.h\"
|
||||
$(TARGET).CFLAGS += -DPRIMARY_GPS=GPS_UBX
|
||||
endif
|
||||
else
|
||||
# plain old single GPS usage
|
||||
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"modules/gps/gps_ubx.h\"
|
||||
# plain old single GPS usage
|
||||
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"modules/gps/gps_ubx.h\"
|
||||
endif
|
||||
</raw>
|
||||
<test>
|
||||
<define name="PRIMARY_GPS" value="GPS_UBX"/>
|
||||
<define name="USE_UART2"/>
|
||||
<define name="UBX_GPS_LINK" value="uart2"/>
|
||||
<define name="UBX_GPS_PORT" value="uart2"/>
|
||||
</test>
|
||||
</makefile>
|
||||
</module>
|
||||
|
||||
Reference in New Issue
Block a user