mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 22:17:01 +08:00
[sim_hitl] added new gps support
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
# Hey Emacs, this is a -*- makefile -*-
|
# Hey Emacs, this is a -*- makefile -*-
|
||||||
|
|
||||||
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
|
|
||||||
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_hitl.h\"
|
|
||||||
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_hitl.c
|
|
||||||
ap.CFLAGS += -DUSE_GPS -DHITL
|
ap.CFLAGS += -DUSE_GPS -DHITL
|
||||||
|
ap.CFLAGS += -DPRIMARY_GPS_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)
|
ifneq ($(GPS_LED),none)
|
||||||
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
|
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
|
||||||
@@ -11,5 +12,5 @@ endif
|
|||||||
|
|
||||||
nps.CFLAGS += -DUSE_GPS
|
nps.CFLAGS += -DUSE_GPS
|
||||||
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
|
||||||
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
|
nps.CFLAGS += -DPRIMARY_GPS_TYPE=\"subsystems/gps/gps_sim_nps.h\"
|
||||||
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
* GPS subsystem simulation from rotorcrafts horizontal/vertical reference system
|
* GPS subsystem simulation from rotorcrafts horizontal/vertical reference system
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "subsystems/gps/gps_sim_hitl.h"
|
||||||
#include "subsystems/gps.h"
|
#include "subsystems/gps.h"
|
||||||
#include "subsystems/abi.h"
|
#include "subsystems/abi.h"
|
||||||
|
|
||||||
@@ -35,12 +36,12 @@
|
|||||||
bool_t gps_available;
|
bool_t gps_available;
|
||||||
uint32_t gps_sim_hitl_timer;
|
uint32_t gps_sim_hitl_timer;
|
||||||
|
|
||||||
void gps_impl_init(void)
|
void sim_hitl_gps_impl_init(void)
|
||||||
{
|
{
|
||||||
gps.fix = GPS_FIX_NONE;
|
gps.fix = GPS_FIX_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gps_sim_hitl_event(void)
|
void sim_hitl_gps_event(void)
|
||||||
{
|
{
|
||||||
if (SysTimeTimer(gps_sim_hitl_timer) > 100000) {
|
if (SysTimeTimer(gps_sim_hitl_timer) > 100000) {
|
||||||
SysTimeTimerStart(gps_sim_hitl_timer);
|
SysTimeTimerStart(gps_sim_hitl_timer);
|
||||||
@@ -93,3 +94,11 @@ void gps_sim_hitl_event(void)
|
|||||||
AbiSendMsgGPS(GPS_SIM_ID, now_ts, &gps);
|
AbiSendMsgGPS(GPS_SIM_ID, now_ts, &gps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* register callbacks & structs
|
||||||
|
*/
|
||||||
|
void sim_hitl_gps_register(void)
|
||||||
|
{
|
||||||
|
gps_register_impl(sim_hitl_gps_impl_init, sim_hitl_gps_event, GPS_SIM_ID, 0);
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,10 +27,14 @@
|
|||||||
#ifndef GPS_SIM_HITL_H
|
#ifndef GPS_SIM_HITL_H
|
||||||
#define GPS_SIM_HITL_H
|
#define GPS_SIM_HITL_H
|
||||||
|
|
||||||
#include "std.h"
|
#ifndef PrimaryGpsImpl
|
||||||
|
#define PrimaryGpsImpl sim_hitl
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void gps_sim_hitl_event(void);
|
extern void sim_hitl_gps_event(void);
|
||||||
|
extern void sim_hitl_gps_impl_init(void);
|
||||||
|
extern void sim_hitl_gps_register(void);
|
||||||
|
|
||||||
#define GpsEvent gps_sim_hitl_event
|
// #define GpsEvent gps_sim_hitl_event
|
||||||
|
|
||||||
#endif /* GPS_SIM_HITL_H */
|
#endif /* GPS_SIM_HITL_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user