Merge pull request #1625 from paparazzi/gps_modules

convert GPS subsystems to modules
This commit is contained in:
Gautier Hattenberger
2016-06-17 15:15:05 +02:00
committed by GitHub
69 changed files with 627 additions and 713 deletions
@@ -1,8 +0,0 @@
# Hey Emacs, this is a -*- makefile -*-
# UBlox Hardware In The Loop
ap.CFLAGS += -DUSE_GPS -DUBX
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_ubx.h\"
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_ubx.c $(SRC_SUBSYSTEMS)/gps.c
@@ -1,20 +0,0 @@
# Hey Emacs, this is a -*- makefile -*-
# ARDrone 2 Flightrecorder GPS unit
GPS_LED ?= none
ap.CFLAGS += -DUSE_GPS -DUSE_GPS_ARDRONE2
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_ardrone2.h\"
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_ardrone2.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
@@ -1,31 +1 @@
# Hey Emacs, this is a -*- makefile -*-
GPS_LED ?= none
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), datalink))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_datalink.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_datalink
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_datalink.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_datalink
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_datalink.h\"
endif
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_datalink.c
ap.CFLAGS += -DUSE_GPS -DGPS_DATALINK
nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps datalink subsystem has been converted to a module, replace <subsystem name="gps" type="datalink"/> by <module name="gps" type="datalink"/>)
@@ -1,3 +0,0 @@
include $(CFG_ROTORCRAFT)/gps_datalink.makefile
# Always zero to get heading update
ap.CFLAGS += -DAHRS_HEADING_UPDATE_GPS_MIN_SPEED=0
@@ -1,16 +1 @@
# Hey Emacs, this is a -*- makefile -*-
ap.CFLAGS += -DUSE_GPS -DHITL
ap.CFLAGS += -DGPS_TYPE=\"subsystems/gps/gps_sim_hitl.h\"
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_hitl.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
nps.CFLAGS += -DUSE_GPS
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
$(error Error: replace <subsystem name="gps" type="sim_hitl"/> by <module name="gps" type="sim_hitl"/>)
@@ -1,40 +1 @@
# Hey Emacs, this is a -*- makefile -*-
# Sirf GPS unit
GPS_LED ?= none
SIRF_GPS_PORT ?= $(GPS_PORT)
SIRF_GPS_BAUD ?= $(GPS_BAUD)
SIRF_GPS_PORT_LOWER=$(shell echo $(SIRF_GPS_PORT) | tr A-Z a-z)
ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DSIRF_GPS_LINK=$(SIRF_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(SIRF_GPS_PORT)
ap.CFLAGS += -D$(SIRF_GPS_PORT)_BAUD=$(SIRF_GPS_BAUD)
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), sirf))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_sirf.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_sirf
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sirf.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_sirf
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sirf.h\"
endif
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sirf.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps sirf subsystem has been converted to a module, replace <subsystem name="gps" type="sirf"/> by <module name="gps" type="sirf"/>)
@@ -1 +0,0 @@
$(error The gps_ublox_utm subsystem does not exist for the rotorcraft firmware, please replace <subsystem name="gps" type="ublox_utm"/> with <subsystem name="gps" type="ublox"/> in your airframe file.)
@@ -1,30 +1 @@
# Hey Emacs, this is a -*- makefile -*-
GPS_LED ?= none
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), udp))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_udp.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_udp
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_udp.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_udp
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_udp.h\"
endif
ap.CFLAGS += -DUSE_GPS
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_udp.c
nps.CFLAGS += -DUSE_GPS
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
$(error Error: The gps udp subsystem has been converted to a module, replace <subsystem name="gps" type="udp"/> by <module name="gps" type="udp"/>)
@@ -1,47 +1 @@
# Hey Emacs, this is a -*- makefile -*-
# Furuno NMEA GPS unit
GPS_LED ?= none
FURUNO_GPS_PORT ?= $(GPS_PORT)
FURUNO_GPS_BAUD ?= $(GPS_BAUD)
FURUNO_GPS_PORT_LOWER=$(shell echo $(FURUNO_GPS_PORT) | tr A-Z a-z)
ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DNMEA_GPS_LINK=$(FURUNO_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(FURUNO_GPS_PORT)
ap.CFLAGS += -D$(FURUNO_GPS_PORT)_BAUD=$(FURUNO_GPS_BAUD)
ap.CFLAGS += -DNMEA_PARSE_PROP
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), nmea furuno))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_nmea
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_nmea
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
endif
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_nmea.c $(SRC_SUBSYSTEMS)/gps/gps_furuno.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
sim.CFLAGS += -DUSE_GPS
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DUSE_GPS
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps furuno subsystem has been converted to a module, replace <subsystem name="gps" type="furuno"/> by <module name="gps" type="furuno"/>)
@@ -1,45 +1 @@
# Hey Emacs, this is a -*- makefile -*-
# Mediatek MT3329, DIYDrones V1.4/1.6 protocol
GPS_LED ?= none
MTK_GPS_PORT ?= $(GPS_PORT)
MTK_GPS_BAUD ?= $(GPS_BAUD)
MTK_GPS_PORT_LOWER=$(shell echo $(MTK_GPS_PORT) | tr A-Z a-z)
ap.CFLAGS += -DUSE_GPS -DGPS_CONFIGURE
ap.CFLAGS += -DMTK_GPS_LINK=$(MTK_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(MTK_GPS_PORT)
ap.CFLAGS += -D$(MTK_GPS_PORT)_BAUD=$(MTK_GPS_BAUD)
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), mtk mediatek))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_mtk.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_mtk
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_mtk.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_mtk
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_mtk.h\"
endif
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_mtk.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
sim.CFLAGS += -DUSE_GPS
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps mediatek subsystem has been converted to a module, replace <subsystem name="gps" type="mediatek_diy"/> by <module name="gps" type="mediatek_diy"/>)
@@ -1,45 +1 @@
# Hey Emacs, this is a -*- makefile -*-
# NMEA GPS unit
GPS_LED ?= none
NMEA_GPS_PORT ?= $(GPS_PORT)
NMEA_GPS_BAUD ?= $(GPS_BAUD)
NMEA_GPS_PORT_LOWER=$(shell echo $(NMEA_GPS_PORT) | tr A-Z a-z)
ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DNMEA_GPS_LINK=$(NMEA_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(NMEA_GPS_PORT)
ap.CFLAGS += -D$(NMEA_GPS_PORT)_BAUD=$(NMEA_GPS_BAUD)
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), nmea))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_nmea
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_nmea
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
endif
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_nmea.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
sim.CFLAGS += -DUSE_GPS
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps nmea subsystem has been converted to a module, replace <subsystem name="gps" type="nmea"/> with <module name="gps" type="nmea"/>)
@@ -1,48 +1 @@
# Hey Emacs, this is a -*- makefile -*-
# Swift-Nav Piksi RTK module
GPS_LED ?= none
PIKSI_GPS_PORT ?= $(GPS_PORT)
PIKSI_GPS_BAUD ?= $(GPS_BAUD)
PIKSI_GPS_PORT_LOWER=$(shell echo $(PIKSI_GPS_PORT) | tr A-Z a-z)
ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DUSE_$(PIKSI_GPS_PORT) -D$(PIKSI_GPS_PORT)_BAUD=B115200
ap.CFLAGS += -DPIKSI_GPS_LINK=$(PIKSI_GPS_PORT_LOWER)
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), piksi))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_piksi.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_piksi
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_piksi.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_piksi
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_piksi.h\"
endif
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_piksi.c
# libsbp
ap.CFLAGS += -I$(PAPARAZZI_SRC)/sw/ext/libsbp/c/include
ap.srcs += $(PAPARAZZI_SRC)/sw/ext/libsbp/c/src/sbp.c $(PAPARAZZI_SRC)/sw/ext/libsbp/c/src/edc.c
sim.CFLAGS += -DUSE_GPS
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps piksi subsystem has been converted to a module, replace <subsystem name="gps" type="piksi"/> by <module name="gps" type="piksi"/>)
@@ -1,43 +1 @@
# Hey Emacs, this is a -*- makefile -*-
GPS_LED ?= none
SKYTRAQ_GPS_PORT ?= $(GPS_PORT)
SKYTRAQ_GPS_BAUD ?= $(GPS_BAUD)
SKYTRAQ_GPS_PORT_LOWER=$(shell echo $(SKYTRAQ_GPS_PORT) | tr A-Z a-z)
ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DSKYTRAQ_GPS_LINK=$(SKYTRAQ_SKYTRAQ_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(SKYTRAQ_GPS_PORT)
ap.CFLAGS += -D$(SKYTRAQ_GPS_PORT)_BAUD=$(SKYTRAQ_GPS_BAUD)
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), skytraq))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_skytraq.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_skytraq
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_skytraq.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_skytraq
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_skytraq.h\"
endif
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_skytraq.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
sim.CFLAGS += -DUSE_GPS
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps skytraq subsystem has been converted to a module, replace <subsystem name="gps" type="skytraq"/> by <module name="gps" type="skytraq"/>)
+38
View File
@@ -0,0 +1,38 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps">
<doc>
<description>
Generic GPS functions.
This provides generic GPS functions and multi GPS support.
Still requires at least one module providing the actual GPS implementation.
</description>
<configure name="GPS_LED" value="2" description="LED number to indicate fix or none"/>
</doc>
<settings>
<dl_settings>
<dl_settings name="gps">
<dl_setting MAX="2" MIN="0" STEP="1" values="AUTO|PRIMARY|SECONDARY" module="subsystems/gps" VAR="multi_gps_mode" shortname="multi_mode" param="MULTI_GPS_MODE">
<!-- uncomment this if you want strip buttons for the multi GPS modes
<strip_button name="GPS AUTO" icon="gps.png" value="0" group="gps_mode"/>
<strip_button name="GPS PRIMARY" icon="gps1.png" value="1" group="gps_mode_setting"/>
<strip_button name="GPS SECONDARY" icon="gps2.png" value="2" group="gps_mode_setting"/> -->
</dl_setting>
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_init()"/>
<makefile>
<configure name="GPS_LED" default="none"/>
<file name="gps.c" dir="subsystems"/>
<define name="USE_GPS"/>
<define name="GPS_LED" value="$(GPS_LED)" cond="ifneq ($(GPS_LED),none)"/>
</makefile>
</module>
+39
View File
@@ -0,0 +1,39 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_datalink">
<doc>
<description>
Remote GPS via datalink.
Parses the REMOTE_GPS and REMOTE_GPS_SMALL datalink messages and publishes it onboard via ABI.
</description>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_datalink_init()"/>
<periodic fun="gps_datalink_periodic_check()" freq="1." autorun="TRUE"/>
<datalink message="REMOTE_GPS" fun="gps_datalink_parse_REMOTE_GPS()"/>
<datalink message="REMOTE_GPS_SMALL" fun="gps_datalink_parse_REMOTE_GPS_SMALL()"/>
<makefile target="ap">
<file name="gps_datalink.c" dir="subsystems/gps"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), datalink))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_datalink.h\"
ap.CFLAGS += -DSECONDARY_GPS=GPS_DATALINK
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_datalink.h\"
ap.CFLAGS += -DPRIMARY_GPS=GPS_DATALINK
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_datalink.h\"
endif
</raw>
</makefile>
</module>
+50
View File
@@ -0,0 +1,50 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_furuno">
<doc>
<description>
Furuno GPS (UART)
Driver for Furuno GPS modules parsing the NMEA protocol with Furuno extensions.
</description>
<configure name="FURUNO_GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="FURUNO_GPS_BAUD" value="B38400" description="UART baud rate"/>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_nmea_init()"/>
<periodic fun="gps_nmea_periodic_check()" freq="1." autorun="TRUE"/>
<event fun="gps_nmea_event()"/>
<makefile target="ap">
<configure name="FURUNO_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
<configure name="FURUNO_GPS_BAUD" default="$(GPS_BAUD)"/>
<file name="gps_nmea.c" dir="subsystems/gps"/>
<define name="USE_$(FURUNO_GPS_PORT_UPPER)"/>
<define name="NMEA_GPS_LINK" value="$(FURUNO_GPS_PORT_LOWER)"/>
<define name="$(FURUNO_GPS_PORT_UPPER)_BAUD" value="$(FURUNO_GPS_BAUD)"/>
<!-- furuno extension -->
<define name="NMEA_PARSE_PROP"/>
<file name="gps_furuno.c" dir="subsystems/gps"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), nmea furuno))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DSECONDARY_GPS=GPS_NMEA
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DPRIMARY_GPS=GPS_NMEA
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
endif
</raw>
</makefile>
</module>
+46
View File
@@ -0,0 +1,46 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_mediatek">
<doc>
<description>
Mediatek MT3329 GPS (UART)
Driver for Mediatek MT3329 GPS, DIYDrones V1.4/1.6 protocol
</description>
<configure name="MTK_GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="MTK_GPS_BAUD" value="B38400" description="UART baud rate"/>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_mtk_init()"/>
<periodic fun="gps_mtk_periodic_check()" freq="1." autorun="TRUE"/>
<event fun="gps_mtk_event()"/>
<makefile target="ap">
<configure name="MTK_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
<configure name="MTK_GPS_BAUD" default="$(GPS_BAUD)"/>
<file name="gps_mtk.c" dir="subsystems/gps"/>
<define name="USE_$(MTK_GPS_PORT_UPPER)"/>
<define name="MTK_GPS_LINK" value="$(MTK_GPS_PORT_LOWER)"/>
<define name="$(MTK_GPS_PORT_UPPER)_BAUD" value="$(MTK_GPS_BAUD)"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), mtk mediatek))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_mtk.h\"
ap.CFLAGS += -DSECONDARY_GPS=GPS_MTK
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_mtk.h\"
ap.CFLAGS += -DPRIMARY_GPS=GPS_MTK
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_mtk.h\"
endif
</raw>
</makefile>
</module>
+46
View File
@@ -0,0 +1,46 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_nmea">
<doc>
<description>
NMEA GPS (UART)
Driver for GPS modules using the NMEA protocol.
</description>
<configure name="NMEA_GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="NMEA_GPS_BAUD" value="B38400" description="UART baud rate"/>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_nmea_init()"/>
<periodic fun="gps_nmea_periodic_check()" freq="1." autorun="TRUE"/>
<event fun="gps_nmea_event()"/>
<makefile target="ap">
<configure name="NMEA_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
<configure name="NMEA_GPS_BAUD" default="$(GPS_BAUD)"/>
<file name="gps_nmea.c" dir="subsystems/gps"/>
<define name="USE_$(NMEA_GPS_PORT_UPPER)"/>
<define name="NMEA_GPS_LINK" value="$(NMEA_GPS_PORT_LOWER)"/>
<define name="$(NMEA_GPS_PORT_UPPER)_BAUD" value="$(NMEA_GPS_BAUD)"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), nmea))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DSECONDARY_GPS=GPS_NMEA
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DPRIMARY_GPS=GPS_NMEA
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
endif
</raw>
</makefile>
</module>
+21
View File
@@ -0,0 +1,21 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_nps">
<doc>
<description>
Simulated GPS for NPS.
For NPS simulator. Can model GPS noise, bias and latency.
The GPS sensor configuration is done in the header file referenced by NPS_SENSORS_PARAMS.
</description>
</doc>
<autoload name="gps"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_nps_init()"/>
<periodic fun="gps_nps_periodic_check()" freq="1." autorun="TRUE"/>
<makefile target="nps">
<file name="gps_sim_nps.c" dir="subsystems/gps"/>
<define name="GPS_TYPE_H" value="subsystems/gps/gps_sim_nps.h" type="string"/>
</makefile>
</module>
+20
View File
@@ -0,0 +1,20 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_optitrack">
<doc>
<description>
Optitrack used as indoor GPS.
Uses the gps_datalink implementation, but additionally sets some other defines.
Optitrack can determine the heading of a vehicle, but GPS doesn't contain heading.
So as a hack optitrack sends the heading in the GPS course field.
</description>
</doc>
<autoload name="gps"/>
<autoload name="gps_datalink"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<makefile target="ap">
<define name="AHRS_HEADING_UPDATE_GPS_MIN_SPEED" value="0"/>
</makefile>
</module>
+49
View File
@@ -0,0 +1,49 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_piksi">
<doc>
<description>
Swift-Nav Piksi RTK GPS.
Driver for Swift-Nav Piksi RTK GPS connected via UART.
</description>
<configure name="PIKSI_GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="PIKSI_GPS_BAUD" value="B115200" description="UART baud rate"/>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_piksi_init()"/>
<periodic fun="gps_piksi_periodic_check()" freq="1." autorun="TRUE"/>
<event fun="gps_piksi_event()"/>
<makefile target="ap">
<configure name="PIKSI_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
<configure name="PIKSI_GPS_BAUD" default="B115200"/>
<file name="gps_piksi.c" dir="subsystems/gps"/>
<include name="$(PAPARAZZI_SRC)/sw/ext/libsbp/c/include"/>
<file name="sbp.c" dir="$(PAPARAZZI_SRC)/sw/ext/libsbp/c/src"/>
<file name="edc.c" dir="$(PAPARAZZI_SRC)/sw/ext/libsbp/c/src"/>
<define name="USE_$(PIKSI_GPS_PORT_UPPER)"/>
<define name="PIKSI_GPS_LINK" value="$(PIKSI_GPS_PORT_LOWER)"/>
<define name="$(PIKSI_GPS_PORT_UPPER)_BAUD" value="$(PIKSI_GPS_BAUD)"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), piksi))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_piksi.h\"
ap.CFLAGS += -DSECONDARY_GPS=GPS_PIKSI
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_piksi.h\"
ap.CFLAGS += -DPRIMARY_GPS=GPS_PIKSI
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_piksi.h\"
endif
</raw>
</makefile>
</module>
+20
View File
@@ -0,0 +1,20 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_sim">
<doc>
<description>
Simulated GPS
For simple fixedwing OCaml simulator. Does not model any GPS inaccuracies/noise.
</description>
</doc>
<autoload name="gps"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_sim_init()"/>
<periodic fun="gps_sim_periodic_check()" freq="1." autorun="TRUE"/>
<makefile target="sim">
<file name="gps_sim.c" dir="subsystems/gps"/>
<define name="GPS_TYPE_H" value="subsystems/gps/gps_sim.h" type="string"/>
</makefile>
</module>
+24
View File
@@ -0,0 +1,24 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_sim_hitl">
<doc>
<description>
Sim HITL GPS
Simulate GPS for HITL (HardwareInTheLoop) from rotorcrafts horizontal/vertical reference system.
</description>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_sim_hitl_init()"/>
<event fun="gps_sim_hitl_event()"/>
<makefile target="ap" firmware="rotorcraft">
<file name="gps_sim_hitl.c" dir="subsystems/gps"/>
<define name="HITL"/>
<define name="GPS_TYPE_H" value="subsystems/gps/gps_sim_hitl.h" type="string"/>
</makefile>
</module>
+46
View File
@@ -0,0 +1,46 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_sirf">
<doc>
<description>
Sirf GPS (UART)
Driver for GPS modules using the Sirf binary protocol.
</description>
<configure name="SIRF_GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="SIRF_GPS_BAUD" value="B38400" description="UART baud rate"/>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_sirf_init()"/>
<periodic fun="gps_sirf_periodic_check()" freq="1." autorun="TRUE"/>
<event fun="gps_sirf_event()"/>
<makefile target="ap">
<configure name="SIRF_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
<configure name="SIRF_GPS_BAUD" default="$(GPS_BAUD)"/>
<file name="gps_sirf.c" dir="subsystems/gps"/>
<define name="USE_$(SIRF_GPS_PORT_UPPER)"/>
<define name="SIRF_GPS_LINK" value="$(SIRF_GPS_PORT_LOWER)"/>
<define name="$(SIRF_GPS_PORT_UPPER)_BAUD" value="$(SIRF_GPS_BAUD)"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), sirf))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_sirf.h\"
ap.CFLAGS += -DSECONDARY_GPS=GPS_SIRF
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sirf.h\"
ap.CFLAGS += -DPRIMARY_GPS=GPS_SIRF
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sirf.h\"
endif
</raw>
</makefile>
</module>
+46
View File
@@ -0,0 +1,46 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_skytraq">
<doc>
<description>
Skytraq GPS (UART)
Driver for GPS modules using the Skytraq binary protocol.
</description>
<configure name="SKYTRAQ_GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="SKYTRAQ_GPS_BAUD" value="B38400" description="UART baud rate"/>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_skytraq_init()"/>
<periodic fun="gps_skytraq_periodic_check()" freq="1." autorun="TRUE"/>
<event fun="gps_skytraq_event()"/>
<makefile target="ap">
<configure name="SKYTRAQ_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
<configure name="SKYTRAQ_GPS_BAUD" default="$(GPS_BAUD)"/>
<file name="gps_skytraq.c" dir="subsystems/gps"/>
<define name="USE_$(SKYTRAQ_GPS_PORT_UPPER)"/>
<define name="SKYTRAQ_GPS_LINK" value="$(SKYTRAQ_GPS_PORT_LOWER)"/>
<define name="$(SKYTRAQ_GPS_PORT_UPPER)_BAUD" value="$(SKYTRAQ_GPS_BAUD)"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), skytraq))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_skytraq.h\"
ap.CFLAGS += -DSECONDARY_GPS=GPS_SKYTRAQ
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_skytraq.h\"
ap.CFLAGS += -DPRIMARY_GPS=GPS_SKYTRAQ
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_skytraq.h\"
endif
</raw>
</makefile>
</module>
+12 -26
View File
@@ -6,38 +6,36 @@
U-blox GPS (UART)
Driver for u-blox GPS modules parsing the binary UBX protocol.
</description>
<configure name="GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="GPS_BAUD" value="B38400" description="UART baud rate"/>
<configure name="GPS_LED" value="2" description="LED number to indicate fix or none"/>
<configure name="UBX_GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="UBX_GPS_BAUD" value="B38400" description="UART baud rate"/>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<!-- uncomment these when not called explicitly from main anymore -->
<!--init fun="gps_init()"/-->
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<!--event fun="GpsEvent(on_gps_solution)"/-->
<init fun="gps_ubx_init()"/>
<periodic fun="gps_ubx_periodic_check()" freq="1." autorun="TRUE"/>
<event fun="gps_ubx_event()"/>
<makefile target="ap">
<configure name="UBX_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
<configure name="UBX_GPS_BAUD" default="$(GPS_BAUD)"/>
<file name="gps.c" dir="subsystems"/>
<file name="gps_ubx.c" dir="subsystems/gps"/>
<define name="USE_GPS"/>
<configure name="GPS_PORT" case="upper|lower"/>
<define name="USE_$(UBX_GPS_PORT_UPPER)"/>
<define name="UBX_GPS_LINK" value="$(UBX_GPS_PORT_LOWER)"/>
<define name="$(UBX_GPS_PORT_UPPER)_BAUD" value="$(UBX_GPS_BAUD)"/>
<configure name="GPS_LED" default="none"/>
<define name="GPS_LED" value="$(GPS_LED)" cond="ifneq ($(GPS_LED),none)"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), ublox))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_ubx.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_ubx
ap.CFLAGS += -DSECONDARY_GPS=GPS_UBX
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_ubx.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_ubx
ap.CFLAGS += -DPRIMARY_GPS=GPS_UBX
endif
else
# plain old single GPS usage
@@ -45,17 +43,5 @@
endif
</raw>
</makefile>
<makefile target="nps">
<file name="gps.c" dir="subsystems"/>
<file name="gps_sim_nps.c" dir="subsystems/gps"/>
<define name="USE_GPS"/>
<define name="GPS_TYPE_H" value="subsystems/gps/gps_sim_nps.h" type="string"/>
</makefile>
<makefile target="sim">
<file name="gps.c" dir="subsystems"/>
<file name="gps_sim.c" dir="subsystems/gps"/>
<define name="USE_GPS"/>
<define name="GPS_TYPE_H" value="subsystems/gps/gps_sim.h" type="string"/>
</makefile>
</module>
+2 -1
View File
@@ -4,6 +4,7 @@
<doc>
<description>
U-blox GPS (I2C)
Extends the gps_ublox to provide I2C connectivity.
</description>
<configure name="GPS_UBX_I2C_DEV" value="i2cX" description="set i2c peripheral (default: i2c1)"/>
</doc>
@@ -17,7 +18,7 @@
<periodic fun="gps_ubx_i2c_periodic()" freq="10."/>
<event fun="GpsUbxi2cEvent()"/>
<makefile>
<makefile target="ap">
<configure name="GPS_UBX_I2C_DEV" default="i2c1" case="upper|lower"/>
<define name="USE_$(GPS_UBX_I2C_DEV_UPPER)"/>
<define name="GPS_UBX_I2C_DEV" value="$(GPS_UBX_I2C_DEV_LOWER)"/>
+4
View File
@@ -18,6 +18,7 @@ Warning: you still need to tell the driver, which paparazzi port you use.
description="Dynamic model used by ublox GPS filter. Default:NAV5_DYN_AIRBORNE_2G"/>
<define name="USE_GPS_UBX_RXM_RAW" description="Activate raw measurments (only available on U-Blox T versions)"/>
</doc>
<settings>
<dl_settings NAME="ublox">
<dl_settings name="ucenter">
@@ -30,6 +31,9 @@ Warning: you still need to tell the driver, which paparazzi port you use.
</dl_settings>
</dl_settings>
</settings>
<depends>gps_ublox</depends>
<header>
<file name="gps_ubx_ucenter.h"/>
</header>
+39
View File
@@ -0,0 +1,39 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_udp">
<doc>
<description>
GPS via UDP.
Read GPS messages from UDP port 7000.
</description>
<define name="GPS_UDP_HOST" value="192.168.1.2" description="host sending GPS messages"/>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_udp_init()"/>
<periodic fun="gps_udp_periodic_check()" freq="1." autorun="TRUE"/>
<makefile target="ap">
<file name="gps_udp.c" dir="subsystems/gps"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), udp))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_udp.h\"
ap.CFLAGS += -DSECONDARY_GPS=GPS_UDP
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_udp.h\"
ap.CFLAGS += -DPRIMARY_GPS=GPS_UDP
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_udp.h\"
endif
</raw>
</makefile>
</module>
@@ -21,7 +21,6 @@
<dl_setting MAX="2" MIN="0" STEP="1" VAR="pprz_mode" module="autopilot" values="MANUAL|AUTO1|AUTO2|HOME|NOGPS|FAILSAFE"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="launch"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/>
<dl_setting MAX="2" MIN="0" STEP="1" VAR="gps.reset" module="subsystems/gps" handler="Reset" shortname="GPS reset"/>
<!-- <dl_setting MAX="0" MIN="0" STEP="1" VAR="estimator_flight_time" shortname="flight time"/>-->
<dl_setting MAX="1000" MIN="0" STEP="1" VAR="stage_time"/>
<!-- <dl_setting MAX="2" MIN="0" STEP="1" VAR="telemetry_mode_Ap_DefaultChannel" shortname="tele_AP" module="downlink"/>
@@ -19,7 +19,6 @@
<dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/>
<dl_setting MAX="2" MIN="0" STEP="1" VAR="telemetry_mode_Ap_DefaultChannel" shortname="tele_AP" module="downlink"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="telemetry_mode_Fbw_DefaultChannel" shortname="tele_FBW" module="downlink"/>
<dl_setting MAX="2" MIN="0" STEP="1" VAR="gps.reset" module="subsystems/gps" handler="Reset" shortname="GPS reset"/>
<dl_setting MAX="200" MIN="-200" STEP="10" VAR="nav_radius" module="subsystems/nav" handler="SetNavRadius">
<strip_button icon="circle-right.png" name="Circle right" value="1"/>
-1
View File
@@ -21,7 +21,6 @@
<dl_setting MAX="2" MIN="0" STEP="1" VAR="pprz_mode" module="autopilot" values="MANUAL|AUTO1|AUTO2|HOME|NOGPS|FAILSAFE"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="launch"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/>
<dl_setting MAX="2" MIN="0" STEP="1" VAR="gps.reset" module="subsystems/gps" handler="Reset" shortname="GPS reset"/>
</dl_settings>
</dl_settings>
+5 -5
View File
@@ -11,12 +11,12 @@
<strip_button name="POWER OFF" icon="off.png" value="0" group="power_switch"/>
</dl_setting>
<dl_setting var="autopilot_mode" min="0" step="1" max="2" module="autopilot" shortname="mode" values="KILL|Fail|HOME" handler="set_mode"/>
<dl_setting var="multi_gps_mode" min="0" step="1" max="2" module="subsystems/gps" shortname="gpsmode" values="PRIMARY|SECONDARY|AUTO">
<strip_button name="AUTO" icon="gps.png" value="2" group="gps_mode"/>
<strip_button name="PRIMARY" icon="gps1.png" value="0" group="gps_mode_setting"/>
<strip_button name="SECONDARY" icon="gps2.png" value="1" group="gps_mode_setting"/>
<dl_setting var="multi_gps_mode" min="0" step="1" max="2" module="subsystems/gps" shortname="gpsmode" values="AUTO|PRIMARY|SECONDARY">
<strip_button name="AUTO" icon="gps.png" value="0" group="gps_mode"/>
<strip_button name="PRIMARY" icon="gps1.png" value="1" group="gps_mode_setting"/>
<strip_button name="SECONDARY" icon="gps2.png" value="2" group="gps_mode_setting"/>
</dl_setting>
</dl_settings>
</dl_settings>
</settings>
</settings>
+1 -1
View File
@@ -7,7 +7,7 @@
/** From airborne/autopilot/ */
#include "generated/airframe.h"
#include "generated/flight_plan.h"
#include "subsystems/gps.h"
#include "subsystems/gps/gps_sim.h"
#include "math/pprz_geodetic_float.h"
#include "math/pprz_geodetic_int.h"
-11
View File
@@ -190,9 +190,6 @@ void init_ap(void)
stateInit();
/************* Sensors initialization ***************/
#if USE_GPS
gps_init();
#endif
#if USE_IMU
imu_init();
@@ -638,10 +635,6 @@ void sensors_task(void)
update_ahrs_from_sim();
#endif
#if USE_GPS
gps_periodic_check();
#endif
//FIXME: temporary hack, remove me
#ifdef InsPeriodic
InsPeriodic();
@@ -719,10 +712,6 @@ void event_task_ap(void)
InsEvent();
#endif
#if USE_GPS
GpsEvent();
#endif /* USE_GPS */
#if USE_BARO_BOARD
BaroEvent();
#endif
-9
View File
@@ -198,10 +198,6 @@ STATIC_INLINE void main_init(void)
ins_init();
#if USE_GPS
gps_init();
#endif
autopilot_init();
modules_init();
@@ -340,7 +336,6 @@ STATIC_INLINE void failsafe_check(void)
#endif
#if USE_GPS
gps_periodic_check();
if (autopilot_mode == AP_MODE_NAV &&
autopilot_motors_on &&
#if NO_GPS_LOST_WITH_RC_VALID
@@ -383,10 +378,6 @@ STATIC_INLINE void main_event(void)
BaroEvent();
#endif
#if USE_GPS
GpsEvent();
#endif
#if FAILSAFE_GROUND_DETECT || KILL_ON_GROUND_DETECT
DetectGroundEvent();
#endif
-9
View File
@@ -186,12 +186,3 @@ static void handle_ins_msg(void)
#endif // USE_GPS_XSENS
}
#ifdef USE_GPS_XSENS
/*
* register callbacks & structs
*/
void gps_xsens_register(void)
{
gps_register_impl(gps_xsens_init, NULL, GPS_XSENS_ID);
}
#endif
+1 -2
View File
@@ -49,10 +49,9 @@ extern void ins_xsens_event(void);
#if USE_GPS_XSENS
#ifndef PRIMARY_GPS
#define PRIMARY_GPS gps_xsens
#define PRIMARY_GPS GPS_XSENS
#endif
extern void gps_xsens_init(void);
extern void gps_xsens_register(void);
#endif
#else // SITL
-11
View File
@@ -193,14 +193,3 @@ void handle_ins_msg(void)
}
#endif // USE_GPS_XSENS
}
#ifdef USE_GPS_XSENS
/*
* register callbacks & structs
*/
void gps_xsens700_register(void)
{
gps_register_impl(gps_xsens700_init, NULL, GPS_XSENS_ID);
}
#endif
+1 -2
View File
@@ -49,10 +49,9 @@ extern void ins_xsens700_event(void);
#if USE_GPS_XSENS
#ifndef PRIMARY_GPS
#define PRIMARY_GPS gps_xsens700
#define PRIMARY_GPS GPS_XSENS
#endif
extern void gps_xsens700_init(void);
extern void gps_xsens700_register(void);
#endif
#else // SITL
@@ -44,9 +44,6 @@
#if USE_GPS
#include "subsystems/gps.h"
#endif
#if defined GPS_DATALINK
#include "subsystems/gps/gps_datalink.h"
#endif
#ifdef TRAFFIC_INFO
#include "subsystems/navigation/traffic_info.h"
@@ -189,42 +186,6 @@ void dl_parse_msg(void)
#endif // RADIO_CONTROL_TYPE_DATALINK
#if USE_GPS
#ifdef GPS_DATALINK
case DL_REMOTE_GPS_SMALL : {
// Check if the GPS is for this AC
if (DL_REMOTE_GPS_SMALL_ac_id(dl_buffer) != AC_ID) { break; }
parse_gps_datalink_small(
DL_REMOTE_GPS_SMALL_heading(dl_buffer),
DL_REMOTE_GPS_SMALL_pos_xyz(dl_buffer),
DL_REMOTE_GPS_SMALL_speed_xyz(dl_buffer),
DL_REMOTE_GPS_SMALL_tow(dl_buffer));
}
break;
case DL_REMOTE_GPS : {
// Check if the GPS is for this AC
if (DL_REMOTE_GPS_ac_id(dl_buffer) != AC_ID) { break; }
// Parse the GPS
parse_gps_datalink(
DL_REMOTE_GPS_numsv(dl_buffer),
DL_REMOTE_GPS_ecef_x(dl_buffer),
DL_REMOTE_GPS_ecef_y(dl_buffer),
DL_REMOTE_GPS_ecef_z(dl_buffer),
DL_REMOTE_GPS_lat(dl_buffer),
DL_REMOTE_GPS_lon(dl_buffer),
DL_REMOTE_GPS_alt(dl_buffer),
DL_REMOTE_GPS_hmsl(dl_buffer),
DL_REMOTE_GPS_ecef_xd(dl_buffer),
DL_REMOTE_GPS_ecef_yd(dl_buffer),
DL_REMOTE_GPS_ecef_zd(dl_buffer),
DL_REMOTE_GPS_tow(dl_buffer),
DL_REMOTE_GPS_course(dl_buffer));
}
break;
#endif // GPS_DATALINK
case DL_GPS_INJECT : {
// Check if the GPS is for this AC
if (DL_GPS_INJECT_ac_id(dl_buffer) != AC_ID) { break; }
+25 -66
View File
@@ -19,9 +19,22 @@
* Boston, MA 02111-1307, USA.
*/
/** @file gps.c
* @brief Device independent GPS code
/**
* @file gps.c
* @brief Device independent GPS code.
* This provides some general GPS functions and handles the selection of the
* currently active GPS (if multiple ones are used).
*
* Each GPS implementation sends a GPS message via ABI for each new measurement,
* which can be received by any other part (either from all or only one specific GPS).
*
* To make it easy to switch to the currently best (or simply the preferred) GPS at runtime,
* the #multi_gps_mode can be set to #GPS_MODE_PRIMARY, #GPS_MODE_SECONDARY or #GPS_MODE_AUTO.
* This re-sends the GPS message of the "selected" GPS with #GPS_MULTI_ID as sender id.
* In the (default) GPS_MODE_AUTO mode, the GPS with the best fix is selected.
*
* The global #gps struct is also updated from the "selected" GPS
* and used to send the normal GPS telemetry messages.
*/
#include "subsystems/abi.h"
@@ -40,19 +53,11 @@ PRINT_CONFIG_VAR(PRIMARY_GPS)
PRINT_CONFIG_VAR(SECONDARY_GPS)
#endif
#define __RegisterGps(_x) _x ## _register()
#define _RegisterGps(_x) __RegisterGps(_x)
#define RegisterGps(_x) _RegisterGps(_x)
/* expand GpsId(PRIMARY_GPS) to e.g. GPS_UBX_ID */
#define __GpsId(_x) _x ## _ID
#define _GpsId(_x) __GpsId(_x)
#define GpsId(_x) _GpsId(_x)
/** maximum number of GPS implementations that can register */
#ifdef SECONDARY_GPS
#define GPS_NB_IMPL 2
#else
#define GPS_NB_IMPL 1
#endif
#define PRIMARY_GPS_INSTANCE 0
#define SECONDARY_GPS_INSTANCE 1
#ifdef GPS_POWER_GPIO
#include "mcu_periph/gpio.h"
@@ -75,14 +80,6 @@ static uint8_t current_gps_id = 0;
uint8_t multi_gps_mode;
/* gps structs */
struct GpsInstance {
ImplGpsInit init;
ImplGpsEvent event;
uint8_t id;
};
struct GpsInstance GpsInstances[GPS_NB_IMPL];
#if PERIODIC_TELEMETRY
#include "subsystems/datalink/telemetry.h"
@@ -176,10 +173,10 @@ static void send_gps_sol(struct transport_tx *trans, struct link_device *dev)
}
#endif
void gps_periodic_check(void)
void gps_periodic_check(struct GpsState *gps_s)
{
if (sys_time.nb_sec - gps.last_msg_time > GPS_TIMEOUT) {
gps.fix = GPS_FIX_NONE;
if (sys_time.nb_sec - gps_s->last_msg_time > GPS_TIMEOUT) {
gps_s->fix = GPS_FIX_NONE;
}
}
@@ -188,9 +185,9 @@ static uint8_t gps_multi_switch(struct GpsState *gps_s) {
static uint32_t time_since_last_gps_switch = 0;
if (multi_gps_mode == GPS_MODE_PRIMARY){
return GpsInstances[PRIMARY_GPS_INSTANCE].id;
return GpsId(PRIMARY_GPS);
} else if (multi_gps_mode == GPS_MODE_SECONDARY){
return GpsInstances[SECONDARY_GPS_INSTANCE].id;
return GpsId(SECONDARY_GPS);
} else{
if (gps_s->fix > gps.fix){
return gps_s->comp_id;
@@ -217,6 +214,7 @@ static void gps_cb(uint8_t sender_id,
uint32_t stamp __attribute__((unused)),
struct GpsState *gps_s)
{
/* ignore callback from own AbiSendMsgGPS */
if (sender_id == GPS_MULTI_ID) {
return;
}
@@ -238,34 +236,6 @@ static void gps_cb(uint8_t sender_id,
}
}
/*
* handle gps switching and updating gps instances
*/
void GpsEvent(void) {
// run each gps event
for (int i = 0 ; i < GPS_NB_IMPL ; i++) {
if (GpsInstances[i].event != NULL) {
GpsInstances[i].event();
}
}
}
/*
* register gps structs for callback
*/
void gps_register_impl(ImplGpsInit init, ImplGpsEvent event, uint8_t id)
{
int i;
for (i=0; i < GPS_NB_IMPL; i++) {
if (GpsInstances[i].init == NULL) {
GpsInstances[i].init = init;
GpsInstances[i].event = event;
GpsInstances[i].id = id;
break;
}
}
}
void gps_init(void)
{
@@ -290,17 +260,6 @@ void gps_init(void)
LED_OFF(GPS_LED);
#endif
RegisterGps(PRIMARY_GPS);
#ifdef SECONDARY_GPS
RegisterGps(SECONDARY_GPS);
#endif
for (int i=0; i < GPS_NB_IMPL; i++) {
if (GpsInstances[i].init != NULL) {
GpsInstances[i].init();
}
}
AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb);
#if PERIODIC_TELEMETRY
+4 -22
View File
@@ -57,9 +57,9 @@
#define GPS_NB_CHANNELS 16
#endif
#define GPS_MODE_PRIMARY 0
#define GPS_MODE_SECONDARY 1
#define GPS_MODE_AUTO 2
#define GPS_MODE_AUTO 0
#define GPS_MODE_PRIMARY 1
#define GPS_MODE_SECONDARY 2
#ifndef MULTI_GPS_MODE
#define MULTI_GPS_MODE GPS_MODE_AUTO
@@ -120,17 +120,6 @@ struct GpsTimeSync {
/** global GPS state */
extern struct GpsState gps;
typedef void (*ImplGpsInit)(void);
typedef void (*ImplGpsEvent)(void);
extern void GpsEvent(void);
/**
* register callbacks and state pointers
*/
extern void gps_register_impl(ImplGpsInit init, ImplGpsEvent event, uint8_t id);
#ifdef GPS_TYPE_H
#include GPS_TYPE_H
#endif
@@ -162,14 +151,7 @@ static inline bool gps_has_been_good(void)
/** Periodic GPS check.
* Marks GPS as lost when no GPS message was received for GPS_TIMEOUT seconds
*/
extern void gps_periodic_check(void);
/**
* GPS Reset
* @todo this still needs to call gps specific stuff
*/
#define gps_Reset(_val) { \
}
extern void gps_periodic_check(struct GpsState *gps_s);
/*
+32 -9
View File
@@ -31,6 +31,7 @@
#include "subsystems/gps.h"
#include "subsystems/abi.h"
#include "subsystems/datalink/datalink.h"
struct LtpDef_i ltp_def;
@@ -55,7 +56,7 @@ void gps_datalink_init(void)
}
// Parse the REMOTE_GPS_SMALL datalink packet
void parse_gps_datalink_small(int16_t heading, uint32_t pos_xyz, uint32_t speed_xyz, uint32_t tow)
static void parse_gps_datalink_small(int16_t heading, uint32_t pos_xyz, uint32_t speed_xyz, uint32_t tow)
{
struct EnuCoor_i enu_pos, enu_speed;
@@ -121,9 +122,10 @@ void parse_gps_datalink_small(int16_t heading, uint32_t pos_xyz, uint32_t speed_
}
/** Parse the REMOTE_GPS datalink packet */
void parse_gps_datalink(uint8_t numsv, int32_t ecef_x, int32_t ecef_y, int32_t ecef_z, int32_t lat, int32_t lon,
int32_t alt,
int32_t hmsl, int32_t ecef_xd, int32_t ecef_yd, int32_t ecef_zd, uint32_t tow, int32_t course)
static void parse_gps_datalink(uint8_t numsv, int32_t ecef_x, int32_t ecef_y, int32_t ecef_z,
int32_t lat, int32_t lon, int32_t alt, int32_t hmsl,
int32_t ecef_xd, int32_t ecef_yd, int32_t ecef_zd,
uint32_t tow, int32_t course)
{
gps_datalink.lla_pos.lat = lat;
gps_datalink.lla_pos.lon = lon;
@@ -168,10 +170,31 @@ void parse_gps_datalink(uint8_t numsv, int32_t ecef_x, int32_t ecef_y, int32_t e
}
/*
* register callbacks & structs
*/
void gps_datalink_register(void)
void gps_datalink_parse_REMOTE_GPS(void)
{
gps_register_impl(gps_datalink_init, NULL, GPS_DATALINK_ID);
if (DL_REMOTE_GPS_SMALL_ac_id(dl_buffer) != AC_ID) { return; } // not for this aircraft
parse_gps_datalink(DL_REMOTE_GPS_numsv(dl_buffer),
DL_REMOTE_GPS_ecef_x(dl_buffer),
DL_REMOTE_GPS_ecef_y(dl_buffer),
DL_REMOTE_GPS_ecef_z(dl_buffer),
DL_REMOTE_GPS_lat(dl_buffer),
DL_REMOTE_GPS_lon(dl_buffer),
DL_REMOTE_GPS_alt(dl_buffer),
DL_REMOTE_GPS_hmsl(dl_buffer),
DL_REMOTE_GPS_ecef_xd(dl_buffer),
DL_REMOTE_GPS_ecef_yd(dl_buffer),
DL_REMOTE_GPS_ecef_zd(dl_buffer),
DL_REMOTE_GPS_tow(dl_buffer),
DL_REMOTE_GPS_course(dl_buffer));
}
void gps_datalink_parse_REMOTE_GPS_SMALL(void)
{
if (DL_REMOTE_GPS_SMALL_ac_id(dl_buffer) != AC_ID) { return; } // not for this aircraft
parse_gps_datalink_small(DL_REMOTE_GPS_SMALL_heading(dl_buffer),
DL_REMOTE_GPS_SMALL_pos_xyz(dl_buffer),
DL_REMOTE_GPS_SMALL_speed_xyz(dl_buffer),
DL_REMOTE_GPS_SMALL_tow(dl_buffer));
}
+4 -7
View File
@@ -35,19 +35,16 @@
#include "subsystems/gps.h"
#ifndef PRIMARY_GPS
#define PRIMARY_GPS gps_datalink
#define PRIMARY_GPS GPS_DATALINK
#endif
extern struct GpsState gps_datalink;
extern void gps_datalink_init(void);
extern void gps_datalink_register(void);
extern void parse_gps_datalink_small(int16_t heading, uint32_t pos_xyz, uint32_t speed_xyz, uint32_t tow);
#define gps_datalink_periodic_check() gps_periodic_check(&gps_datalink)
extern void parse_gps_datalink(uint8_t numsv, int32_t ecef_x, int32_t ecef_y, int32_t ecef_z,
int32_t lat, int32_t lon, int32_t alt, int32_t hmsl,
int32_t ecef_xd, int32_t ecef_yd, int32_t ecef_zd,
uint32_t tow, int32_t course);
extern void gps_datalink_parse_REMOTE_GPS(void);
extern void gps_datalink_parse_REMOTE_GPS_SMALL(void);
#endif /* GPS_DATALINK_H */
-8
View File
@@ -407,14 +407,6 @@ restart:
}
/*
* register callbacks & structs
*/
void gps_mtk_register(void)
{
gps_register_impl(gps_mtk_init, gps_mtk_event, GPS_MTK_ID);
}
/*
*
*
+6 -1
View File
@@ -42,6 +42,10 @@
#define GPS_MTK_MAX_PAYLOAD 255
#ifndef PRIMARY_GPS
#define PRIMARY_GPS GPS_MTK
#endif
struct GpsMtk {
bool msg_available;
uint8_t msg_buf[GPS_MTK_MAX_PAYLOAD] __attribute__((aligned));
@@ -66,7 +70,8 @@ extern struct GpsMtk gps_mtk;
extern void gps_mtk_event(void);
extern void gps_mtk_init(void);
extern void gps_mtk_register(void);
#define gps_mtk_periodic_check() gps_periodic_check(&gps_mtk.state)
#ifdef GPS_CONFIGURE
extern void gps_configure(void);
-8
View File
@@ -561,11 +561,3 @@ static bool nmea_parse_GSV(void)
/* indicate that msg was valid and gps_nmea.state updated */
return true;
}
/*
* register callbacks & structs
*/
void gps_nmea_register(void)
{
gps_register_impl(gps_nmea_init, gps_nmea_event, GPS_NMEA_ID);
}
+6 -6
View File
@@ -26,7 +26,6 @@
*
*/
#ifndef GPS_NMEA_H
#define GPS_NMEA_H
@@ -38,13 +37,9 @@
#define NMEA_MAXLEN 255
#ifndef PRIMARY_GPS
#define PRIMARY_GPS gps_nmea
#define PRIMARY_GPS GPS_NMEA
#endif
extern void gps_nmea_init(void);
extern void gps_nmea_event(void);
extern void gps_nmea_register(void);
struct GpsNmea {
bool msg_available; ///< flag set to TRUE if a new msg/sentence is available to be parsed
bool is_configured; ///< flag set to TRUE if configuration is finished
@@ -59,6 +54,11 @@ struct GpsNmea {
extern struct GpsNmea gps_nmea;
extern void gps_nmea_init(void);
extern void gps_nmea_event(void);
#define gps_nmea_periodic_check() gps_periodic_check(&gps_nmea.state)
/*
* This part is used by the autopilot to read data from a uart

Some files were not shown because too many files have changed in this diff Show More