mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-21 11:54:15 +01:00
Merge remote-tracking branch 'origin/corvuscorax/CC_GPS' into next
This commit is contained in:
commit
f0b22519be
@ -43,23 +43,12 @@
|
|||||||
#define PIOS_INCLUDE_OPAHRS
|
#define PIOS_INCLUDE_OPAHRS
|
||||||
#define PIOS_INCLUDE_COM
|
#define PIOS_INCLUDE_COM
|
||||||
#define PIOS_INCLUDE_GPIO
|
#define PIOS_INCLUDE_GPIO
|
||||||
#define PIOS_NO_GPS
|
|
||||||
//#define DEBUG_SSP
|
//#define DEBUG_SSP
|
||||||
|
|
||||||
/* Defaults for Logging */
|
/* Defaults for Logging */
|
||||||
#define LOG_FILENAME "PIOS.LOG"
|
#define LOG_FILENAME "PIOS.LOG"
|
||||||
#define STARTUP_LOG_ENABLED 1
|
#define STARTUP_LOG_ENABLED 1
|
||||||
|
|
||||||
/* COM Module */
|
|
||||||
#define GPS_BAUDRATE 19200
|
|
||||||
#define TELEM_BAUDRATE 19200
|
|
||||||
#define AUXUART_ENABLED 0
|
|
||||||
#define AUXUART_BAUDRATE 19200
|
|
||||||
|
|
||||||
/* Servos */
|
|
||||||
#define SERVOS_POSITION_MIN 800
|
|
||||||
#define SERVOS_POSITION_MAX 2200
|
|
||||||
|
|
||||||
#endif /* PIOS_CONFIG_H */
|
#endif /* PIOS_CONFIG_H */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
@ -40,23 +40,12 @@
|
|||||||
#define PIOS_INCLUDE_USB_HID
|
#define PIOS_INCLUDE_USB_HID
|
||||||
#define PIOS_INCLUDE_COM
|
#define PIOS_INCLUDE_COM
|
||||||
#define PIOS_INCLUDE_GPIO
|
#define PIOS_INCLUDE_GPIO
|
||||||
#define PIOS_NO_GPS
|
|
||||||
//#define DEBUG_SSP
|
//#define DEBUG_SSP
|
||||||
|
|
||||||
/* Defaults for Logging */
|
/* Defaults for Logging */
|
||||||
#define LOG_FILENAME "PIOS.LOG"
|
#define LOG_FILENAME "PIOS.LOG"
|
||||||
#define STARTUP_LOG_ENABLED 1
|
#define STARTUP_LOG_ENABLED 1
|
||||||
|
|
||||||
/* COM Module */
|
|
||||||
#define GPS_BAUDRATE 19200
|
|
||||||
#define TELEM_BAUDRATE 19200
|
|
||||||
#define AUXUART_ENABLED 0
|
|
||||||
#define AUXUART_BAUDRATE 19200
|
|
||||||
|
|
||||||
/* Servos */
|
|
||||||
#define SERVOS_POSITION_MIN 800
|
|
||||||
#define SERVOS_POSITION_MAX 2200
|
|
||||||
|
|
||||||
#endif /* PIOS_CONFIG_H */
|
#endif /* PIOS_CONFIG_H */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
@ -48,7 +48,7 @@ ENABLE_DEBUG_PINS ?= NO
|
|||||||
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
# Set to Yes to enable the AUX UART which is mapped on the S1 (Tx) and S2 (Rx) servo outputs
|
||||||
ENABLE_AUX_UART ?= NO
|
ENABLE_AUX_UART ?= NO
|
||||||
|
|
||||||
USE_GPS ?= NO
|
USE_GPS ?= YES
|
||||||
|
|
||||||
USE_I2C ?= NO
|
USE_I2C ?= NO
|
||||||
|
|
||||||
@ -65,8 +65,13 @@ endif
|
|||||||
FLASH_TOOL = OPENOCD
|
FLASH_TOOL = OPENOCD
|
||||||
|
|
||||||
# List of modules to include
|
# List of modules to include
|
||||||
MODULES = Attitude Stabilization Actuator ManualControl FirmwareIAP CameraStab
|
OPTMODULES = CameraStab
|
||||||
# Telemetry must be last to grab the optional modules
|
ifeq ($(USE_GPS), YES)
|
||||||
|
OPTMODULES += GPS
|
||||||
|
endif
|
||||||
|
|
||||||
|
MODULES = Attitude Stabilization Actuator ManualControl FirmwareIAP
|
||||||
|
# Telemetry must be last to grab the optional modules (why?)
|
||||||
MODULES += Telemetry
|
MODULES += Telemetry
|
||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
@ -120,6 +125,7 @@ OPUAVSYNTHDIR = $(OUTDIR)/../uavobject-synthetics/flight
|
|||||||
|
|
||||||
ifndef TESTAPP
|
ifndef TESTAPP
|
||||||
## MODULES
|
## MODULES
|
||||||
|
SRC += ${foreach MOD, ${OPTMODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
||||||
SRC += ${foreach MOD, ${MODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
SRC += ${foreach MOD, ${MODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
||||||
## OPENPILOT CORE:
|
## OPENPILOT CORE:
|
||||||
SRC += ${OPMODULEDIR}/System/systemmod.c
|
SRC += ${OPMODULEDIR}/System/systemmod.c
|
||||||
@ -159,13 +165,13 @@ SRC += $(OPUAVSYNTHDIR)/attitudeactual.c
|
|||||||
SRC += $(OPUAVSYNTHDIR)/manualcontrolcommand.c
|
SRC += $(OPUAVSYNTHDIR)/manualcontrolcommand.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/i2cstats.c
|
SRC += $(OPUAVSYNTHDIR)/i2cstats.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/watchdogstatus.c
|
SRC += $(OPUAVSYNTHDIR)/watchdogstatus.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/telemetrysettings.c
|
|
||||||
SRC += $(OPUAVSYNTHDIR)/manualcontrolsettings.c
|
SRC += $(OPUAVSYNTHDIR)/manualcontrolsettings.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/mixersettings.c
|
SRC += $(OPUAVSYNTHDIR)/mixersettings.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/firmwareiapobj.c
|
SRC += $(OPUAVSYNTHDIR)/firmwareiapobj.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/attitudesettings.c
|
SRC += $(OPUAVSYNTHDIR)/attitudesettings.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/camerastabsettings.c
|
SRC += $(OPUAVSYNTHDIR)/camerastabsettings.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/cameradesired.c
|
SRC += $(OPUAVSYNTHDIR)/cameradesired.c
|
||||||
|
SRC += $(OPUAVSYNTHDIR)/gpsposition.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/hwsettings.c
|
SRC += $(OPUAVSYNTHDIR)/hwsettings.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/gcsreceiver.c
|
SRC += $(OPUAVSYNTHDIR)/gcsreceiver.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/receiveractivity.c
|
SRC += $(OPUAVSYNTHDIR)/receiveractivity.c
|
||||||
@ -332,7 +338,7 @@ EXTRAINCDIRS += $(RTOSSRCDIR)/portable/GCC/ARM_CM3
|
|||||||
EXTRAINCDIRS += $(AHRSBOOTLOADERINC)
|
EXTRAINCDIRS += $(AHRSBOOTLOADERINC)
|
||||||
EXTRAINCDIRS += $(PYMITEINC)
|
EXTRAINCDIRS += $(PYMITEINC)
|
||||||
|
|
||||||
EXTRAINCDIRS += ${foreach MOD, ${MODULES}, ${OPMODULEDIR}/${MOD}/inc} ${OPMODULEDIR}/System/inc
|
EXTRAINCDIRS += ${foreach MOD, ${OPTMODULES} ${MODULES}, ${OPMODULEDIR}/${MOD}/inc} ${OPMODULEDIR}/System/inc
|
||||||
|
|
||||||
|
|
||||||
# List any extra directories to look for library files here.
|
# List any extra directories to look for library files here.
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include "openpilot.h"
|
#include "openpilot.h"
|
||||||
#include "uavobjectsinit.h"
|
#include "uavobjectsinit.h"
|
||||||
#include "hwsettings.h"
|
#include "hwsettings.h"
|
||||||
#include "camerastab.h"
|
|
||||||
#include "systemmod.h"
|
#include "systemmod.h"
|
||||||
|
|
||||||
/* Task Priorities */
|
/* Task Priorities */
|
||||||
@ -74,14 +73,6 @@ int main()
|
|||||||
/* Initialize modules */
|
/* Initialize modules */
|
||||||
MODULE_INITIALISE_ALL
|
MODULE_INITIALISE_ALL
|
||||||
|
|
||||||
/* Optional module initialization. This code might want to go somewhere else as
|
|
||||||
* it grows */
|
|
||||||
uint8_t optionalModules[HWSETTINGS_OPTIONALMODULES_NUMELEM];
|
|
||||||
HwSettingsOptionalModulesGet(optionalModules);
|
|
||||||
if(optionalModules[HWSETTINGS_OPTIONALMODULES_CAMERASTABILIZATION] == HWSETTINGS_OPTIONALMODULES_ENABLED) {
|
|
||||||
CameraStabInitialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* swap the stack to use the IRQ stack */
|
/* swap the stack to use the IRQ stack */
|
||||||
Stack_Change();
|
Stack_Change();
|
||||||
|
|
||||||
|
@ -54,7 +54,8 @@
|
|||||||
|
|
||||||
/* Supported USART-based PIOS modules */
|
/* Supported USART-based PIOS modules */
|
||||||
#define PIOS_INCLUDE_TELEMETRY_RF
|
#define PIOS_INCLUDE_TELEMETRY_RF
|
||||||
//#define PIOS_INCLUDE_GPS
|
#define PIOS_INCLUDE_GPS
|
||||||
|
#define PIOS_GPS_MINIMAL
|
||||||
|
|
||||||
#define PIOS_INCLUDE_SERVO
|
#define PIOS_INCLUDE_SERVO
|
||||||
#define PIOS_INCLUDE_SPI
|
#define PIOS_INCLUDE_SPI
|
||||||
@ -80,12 +81,6 @@
|
|||||||
#define LOG_FILENAME "PIOS.LOG"
|
#define LOG_FILENAME "PIOS.LOG"
|
||||||
#define STARTUP_LOG_ENABLED 1
|
#define STARTUP_LOG_ENABLED 1
|
||||||
|
|
||||||
/* COM Module */
|
|
||||||
#define GPS_BAUDRATE 19200
|
|
||||||
#define TELEM_BAUDRATE 19200
|
|
||||||
#define AUXUART_ENABLED 0
|
|
||||||
#define AUXUART_BAUDRATE 19200
|
|
||||||
|
|
||||||
/* Alarm Thresholds */
|
/* Alarm Thresholds */
|
||||||
#define HEAP_LIMIT_WARNING 220
|
#define HEAP_LIMIT_WARNING 220
|
||||||
#define HEAP_LIMIT_CRITICAL 40
|
#define HEAP_LIMIT_CRITICAL 40
|
||||||
@ -107,6 +102,9 @@
|
|||||||
// This can't be too high to stop eventdispatcher thread overflowing
|
// This can't be too high to stop eventdispatcher thread overflowing
|
||||||
#define PIOS_EVENTDISAPTCHER_QUEUE 10
|
#define PIOS_EVENTDISAPTCHER_QUEUE 10
|
||||||
|
|
||||||
|
/* PIOS Initcall infrastructure */
|
||||||
|
#define PIOS_INCLUDE_INITCALL
|
||||||
|
|
||||||
#endif /* PIOS_CONFIG_H */
|
#endif /* PIOS_CONFIG_H */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
@ -44,11 +44,4 @@
|
|||||||
#define LOG_FILENAME "PIOS.LOG"
|
#define LOG_FILENAME "PIOS.LOG"
|
||||||
#define STARTUP_LOG_ENABLED 1
|
#define STARTUP_LOG_ENABLED 1
|
||||||
|
|
||||||
/* COM Module */
|
|
||||||
#define GPS_BAUDRATE 19200
|
|
||||||
#define TELEM_BAUDRATE 19200
|
|
||||||
#define AUXUART_ENABLED 0
|
|
||||||
#define AUXUART_BAUDRATE 19200
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* PIOS_CONFIG_POSIX_H */
|
#endif /* PIOS_CONFIG_POSIX_H */
|
||||||
|
@ -865,7 +865,7 @@ static const struct pios_sbus_cfg pios_sbus_cfg = {
|
|||||||
#define PIOS_COM_TELEM_RF_RX_BUF_LEN 192
|
#define PIOS_COM_TELEM_RF_RX_BUF_LEN 192
|
||||||
#define PIOS_COM_TELEM_RF_TX_BUF_LEN 192
|
#define PIOS_COM_TELEM_RF_TX_BUF_LEN 192
|
||||||
|
|
||||||
#define PIOS_COM_GPS_RX_BUF_LEN 96
|
#define PIOS_COM_GPS_RX_BUF_LEN 32
|
||||||
|
|
||||||
#define PIOS_COM_TELEM_USB_RX_BUF_LEN 192
|
#define PIOS_COM_TELEM_USB_RX_BUF_LEN 192
|
||||||
#define PIOS_COM_TELEM_USB_TX_BUF_LEN 192
|
#define PIOS_COM_TELEM_USB_TX_BUF_LEN 192
|
||||||
|
@ -54,13 +54,7 @@
|
|||||||
|
|
||||||
#define PIOS_INCLUDE_BMA180
|
#define PIOS_INCLUDE_BMA180
|
||||||
|
|
||||||
/* COM Module */
|
|
||||||
#define GPS_BAUDRATE 19200
|
|
||||||
#define AUXUART_ENABLED 0
|
|
||||||
#define AUXUART_BAUDRATE 19200
|
|
||||||
|
|
||||||
#endif /* PIOS_CONFIG_H */
|
#endif /* PIOS_CONFIG_H */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
* @}
|
* @}
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
#include "attitudeactual.h"
|
#include "attitudeactual.h"
|
||||||
#include "camerastabsettings.h"
|
#include "camerastabsettings.h"
|
||||||
#include "cameradesired.h"
|
#include "cameradesired.h"
|
||||||
|
#include "hwsettings.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Configuration
|
// Configuration
|
||||||
@ -61,6 +62,8 @@
|
|||||||
|
|
||||||
// Private variables
|
// Private variables
|
||||||
|
|
||||||
|
static uint8_t camerastabEnabled = 0;
|
||||||
|
|
||||||
// Private functions
|
// Private functions
|
||||||
static void attitudeUpdated(UAVObjEvent* ev);
|
static void attitudeUpdated(UAVObjEvent* ev);
|
||||||
static float bound(float val);
|
static float bound(float val);
|
||||||
@ -72,18 +75,43 @@ static float bound(float val);
|
|||||||
int32_t CameraStabInitialize(void)
|
int32_t CameraStabInitialize(void)
|
||||||
{
|
{
|
||||||
static UAVObjEvent ev;
|
static UAVObjEvent ev;
|
||||||
ev.obj = AttitudeActualHandle();
|
|
||||||
ev.instId = 0;
|
|
||||||
ev.event = 0;
|
|
||||||
|
|
||||||
CameraStabSettingsInitialize();
|
HwSettingsInitialize();
|
||||||
CameraDesiredInitialize();
|
uint8_t optionalModules[HWSETTINGS_OPTIONALMODULES_NUMELEM];
|
||||||
|
HwSettingsOptionalModulesGet(optionalModules);
|
||||||
|
if (optionalModules[HWSETTINGS_OPTIONALMODULES_CAMERASTAB]==HWSETTINGS_OPTIONALMODULES_ENABLED) {
|
||||||
|
camerastabEnabled=1;
|
||||||
|
} else {
|
||||||
|
camerastabEnabled=0;
|
||||||
|
}
|
||||||
|
|
||||||
EventPeriodicCallbackCreate(&ev, attitudeUpdated, SAMPLE_PERIOD_MS / portTICK_RATE_MS);
|
if (camerastabEnabled) {
|
||||||
|
|
||||||
|
AttitudeActualInitialize();
|
||||||
|
|
||||||
|
ev.obj = AttitudeActualHandle();
|
||||||
|
ev.instId = 0;
|
||||||
|
ev.event = 0;
|
||||||
|
|
||||||
|
CameraStabSettingsInitialize();
|
||||||
|
CameraDesiredInitialize();
|
||||||
|
|
||||||
|
EventPeriodicCallbackCreate(&ev, attitudeUpdated, SAMPLE_PERIOD_MS / portTICK_RATE_MS);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* stub: module has no module thread */
|
||||||
|
int32_t CameraStabStart(void)
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MODULE_INITCALL(CameraStabInitialize, CameraStabStart)
|
||||||
|
|
||||||
static void attitudeUpdated(UAVObjEvent* ev)
|
static void attitudeUpdated(UAVObjEvent* ev)
|
||||||
{
|
{
|
||||||
if (ev->obj != AttitudeActualHandle())
|
if (ev->obj != AttitudeActualHandle())
|
||||||
|
@ -43,11 +43,14 @@
|
|||||||
#include "gpssatellites.h"
|
#include "gpssatellites.h"
|
||||||
#include "WorldMagModel.h"
|
#include "WorldMagModel.h"
|
||||||
#include "CoordinateConversions.h"
|
#include "CoordinateConversions.h"
|
||||||
|
#include "hwsettings.h"
|
||||||
|
|
||||||
|
|
||||||
// ****************
|
// ****************
|
||||||
// Private functions
|
// Private functions
|
||||||
|
|
||||||
static void gpsTask(void *parameters);
|
static void gpsTask(void *parameters);
|
||||||
|
static void updateSettings();
|
||||||
|
|
||||||
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
||||||
static void setHomeLocation(GPSPositionData * gpsData);
|
static void setHomeLocation(GPSPositionData * gpsData);
|
||||||
@ -75,6 +78,7 @@ static float GravityAccel(float latitude, float longitude, float altitude);
|
|||||||
// Private variables
|
// Private variables
|
||||||
|
|
||||||
static uint32_t gpsPort;
|
static uint32_t gpsPort;
|
||||||
|
static uint8_t gpsEnabled = 0;
|
||||||
|
|
||||||
static xTaskHandle gpsTaskHandle;
|
static xTaskHandle gpsTaskHandle;
|
||||||
|
|
||||||
@ -95,12 +99,19 @@ static uint32_t numParsingErrors;
|
|||||||
|
|
||||||
int32_t GPSStart(void)
|
int32_t GPSStart(void)
|
||||||
{
|
{
|
||||||
// Start gps task
|
if (gpsEnabled) {
|
||||||
xTaskCreate(gpsTask, (signed char *)"GPS", STACK_SIZE_BYTES/4, NULL, TASK_PRIORITY, &gpsTaskHandle);
|
if (gpsPort) {
|
||||||
TaskMonitorAdd(TASKINFO_RUNNING_GPS, gpsTaskHandle);
|
// Start gps task
|
||||||
|
xTaskCreate(gpsTask, (signed char *)"GPS", STACK_SIZE_BYTES/4, NULL, TASK_PRIORITY, &gpsTaskHandle);
|
||||||
|
TaskMonitorAdd(TASKINFO_RUNNING_GPS, gpsTaskHandle);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
AlarmsSet(SYSTEMALARMS_ALARM_GPS, SYSTEMALARMS_ALARM_CRITICAL);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise the gps module
|
* Initialise the gps module
|
||||||
* \return -1 if initialisation failed
|
* \return -1 if initialisation failed
|
||||||
@ -108,20 +119,35 @@ int32_t GPSStart(void)
|
|||||||
*/
|
*/
|
||||||
int32_t GPSInitialize(void)
|
int32_t GPSInitialize(void)
|
||||||
{
|
{
|
||||||
GPSPositionInitialize();
|
|
||||||
GPSTimeInitialize();
|
|
||||||
GPSSatellitesInitialize();
|
|
||||||
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
|
||||||
HomeLocationInitialize();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO: Get gps settings object
|
|
||||||
gpsPort = PIOS_COM_GPS;
|
gpsPort = PIOS_COM_GPS;
|
||||||
|
HwSettingsInitialize();
|
||||||
|
uint8_t optionalModules[HWSETTINGS_OPTIONALMODULES_NUMELEM];
|
||||||
|
HwSettingsOptionalModulesGet(optionalModules);
|
||||||
|
if (optionalModules[HWSETTINGS_OPTIONALMODULES_GPS]==HWSETTINGS_OPTIONALMODULES_ENABLED) {
|
||||||
|
gpsEnabled=1;
|
||||||
|
} else {
|
||||||
|
gpsEnabled=0;
|
||||||
|
}
|
||||||
|
|
||||||
gps_rx_buffer = pvPortMalloc(NMEA_MAX_PACKET_LENGTH);
|
if (gpsPort && gpsEnabled) {
|
||||||
PIOS_Assert(gps_rx_buffer);
|
GPSPositionInitialize();
|
||||||
|
#if !defined(PIOS_GPS_MINIMAL)
|
||||||
|
GPSTimeInitialize();
|
||||||
|
GPSSatellitesInitialize();
|
||||||
|
#endif
|
||||||
|
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
||||||
|
HomeLocationInitialize();
|
||||||
|
#endif
|
||||||
|
HwSettingsInitialize();
|
||||||
|
updateSettings();
|
||||||
|
|
||||||
return 0;
|
gps_rx_buffer = pvPortMalloc(NMEA_MAX_PACKET_LENGTH);
|
||||||
|
PIOS_Assert(gps_rx_buffer);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
MODULE_INITCALL(GPSInitialize, GPSStart)
|
MODULE_INITCALL(GPSInitialize, GPSStart)
|
||||||
|
|
||||||
@ -330,7 +356,47 @@ static void setHomeLocation(GPSPositionData * gpsData)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ****************
|
/**
|
||||||
|
* Update the GPS settings, called on startup.
|
||||||
|
* FIXME: This should be in the GPSSettings object. But objects have
|
||||||
|
* too much overhead yet. Also the GPS has no any specific settings
|
||||||
|
* like protocol, etc. Thus the HwSettings object which contains the
|
||||||
|
* GPS port speed is used for now.
|
||||||
|
*/
|
||||||
|
static void updateSettings()
|
||||||
|
{
|
||||||
|
if (gpsPort) {
|
||||||
|
|
||||||
|
// Retrieve settings
|
||||||
|
uint8_t speed;
|
||||||
|
HwSettingsGPSSpeedGet(&speed);
|
||||||
|
|
||||||
|
// Set port speed
|
||||||
|
switch (speed) {
|
||||||
|
case HWSETTINGS_GPSSPEED_2400:
|
||||||
|
PIOS_COM_ChangeBaud(gpsPort, 2400);
|
||||||
|
break;
|
||||||
|
case HWSETTINGS_GPSSPEED_4800:
|
||||||
|
PIOS_COM_ChangeBaud(gpsPort, 4800);
|
||||||
|
break;
|
||||||
|
case HWSETTINGS_GPSSPEED_9600:
|
||||||
|
PIOS_COM_ChangeBaud(gpsPort, 9600);
|
||||||
|
break;
|
||||||
|
case HWSETTINGS_GPSSPEED_19200:
|
||||||
|
PIOS_COM_ChangeBaud(gpsPort, 19200);
|
||||||
|
break;
|
||||||
|
case HWSETTINGS_GPSSPEED_38400:
|
||||||
|
PIOS_COM_ChangeBaud(gpsPort, 38400);
|
||||||
|
break;
|
||||||
|
case HWSETTINGS_GPSSPEED_57600:
|
||||||
|
PIOS_COM_ChangeBaud(gpsPort, 57600);
|
||||||
|
break;
|
||||||
|
case HWSETTINGS_GPSSPEED_115200:
|
||||||
|
PIOS_COM_ChangeBaud(gpsPort, 115200);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
@ -70,8 +70,10 @@ static bool nmeaProcessGPGGA(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
|
|||||||
static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
|
static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
|
||||||
static bool nmeaProcessGPVTG(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
|
static bool nmeaProcessGPVTG(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
|
||||||
static bool nmeaProcessGPGSA(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
|
static bool nmeaProcessGPGSA(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
|
||||||
static bool nmeaProcessGPZDA(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
|
#if !defined(PIOS_GPS_MINIMAL)
|
||||||
static bool nmeaProcessGPGSV(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
|
static bool nmeaProcessGPZDA(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
|
||||||
|
static bool nmeaProcessGPGSV(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
|
||||||
|
#endif //PIOS_GPS_MINIMAL
|
||||||
|
|
||||||
|
|
||||||
static struct nmea_parser nmea_parsers[] = {
|
static struct nmea_parser nmea_parsers[] = {
|
||||||
@ -95,6 +97,7 @@ static struct nmea_parser nmea_parsers[] = {
|
|||||||
.handler = nmeaProcessGPRMC,
|
.handler = nmeaProcessGPRMC,
|
||||||
.cnt = 0,
|
.cnt = 0,
|
||||||
},
|
},
|
||||||
|
#if !defined(PIOS_GPS_MINIMAL)
|
||||||
{
|
{
|
||||||
.prefix = "GPZDA",
|
.prefix = "GPZDA",
|
||||||
.handler = nmeaProcessGPZDA,
|
.handler = nmeaProcessGPZDA,
|
||||||
@ -105,6 +108,7 @@ static struct nmea_parser nmea_parsers[] = {
|
|||||||
.handler = nmeaProcessGPGSV,
|
.handler = nmeaProcessGPGSV,
|
||||||
.cnt = 0,
|
.cnt = 0,
|
||||||
},
|
},
|
||||||
|
#endif //PIOS_GPS_MINIMAL
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct nmea_parser *NMEA_find_parser_by_prefix(const char *prefix)
|
static struct nmea_parser *NMEA_find_parser_by_prefix(const char *prefix)
|
||||||
@ -428,6 +432,7 @@ static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
|
|||||||
|
|
||||||
*gpsDataUpdated = true;
|
*gpsDataUpdated = true;
|
||||||
|
|
||||||
|
#if !defined(PIOS_GPS_MINIMAL)
|
||||||
GPSTimeData gpst;
|
GPSTimeData gpst;
|
||||||
GPSTimeGet(&gpst);
|
GPSTimeGet(&gpst);
|
||||||
|
|
||||||
@ -436,6 +441,7 @@ static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
|
|||||||
gpst.Second = (int)hms % 100;
|
gpst.Second = (int)hms % 100;
|
||||||
gpst.Minute = (((int)hms - gpst.Second) / 100) % 100;
|
gpst.Minute = (((int)hms - gpst.Second) / 100) % 100;
|
||||||
gpst.Hour = (int)hms / 10000;
|
gpst.Hour = (int)hms / 10000;
|
||||||
|
#endif //PIOS_GPS_MINIMAL
|
||||||
|
|
||||||
// get latitude [DDMM.mmmmm] [N|S]
|
// get latitude [DDMM.mmmmm] [N|S]
|
||||||
if (!NMEA_latlon_to_fixed_point(&GpsData->Latitude, param[3], param[4][0] == 'S')) {
|
if (!NMEA_latlon_to_fixed_point(&GpsData->Latitude, param[3], param[4][0] == 'S')) {
|
||||||
@ -453,6 +459,7 @@ static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
|
|||||||
// get True course
|
// get True course
|
||||||
GpsData->Heading = NMEA_real_to_float(param[8]);
|
GpsData->Heading = NMEA_real_to_float(param[8]);
|
||||||
|
|
||||||
|
#if !defined(PIOS_GPS_MINIMAL)
|
||||||
// get Date of fix
|
// get Date of fix
|
||||||
// TODO: Should really not use a float here to be safe
|
// TODO: Should really not use a float here to be safe
|
||||||
float date = NMEA_real_to_float(param[9]);
|
float date = NMEA_real_to_float(param[9]);
|
||||||
@ -461,6 +468,7 @@ static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
|
|||||||
gpst.Day = (int)(date / 10000);
|
gpst.Day = (int)(date / 10000);
|
||||||
gpst.Year += 2000;
|
gpst.Year += 2000;
|
||||||
GPSTimeSet(&gpst);
|
GPSTimeSet(&gpst);
|
||||||
|
#endif //PIOS_GPS_MINIMAL
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -488,6 +496,7 @@ static bool nmeaProcessGPVTG(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(PIOS_GPS_MINIMAL)
|
||||||
/**
|
/**
|
||||||
* Parse an NMEA GPZDA sentence and update the @ref GPSTime object
|
* Parse an NMEA GPZDA sentence and update the @ref GPSTime object
|
||||||
* \param[in] A pointer to a GPSPosition UAVObject to be updated (unused).
|
* \param[in] A pointer to a GPSPosition UAVObject to be updated (unused).
|
||||||
@ -610,6 +619,7 @@ static bool nmeaProcessGPGSV(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif //PIOS_GPS_MINIMAL
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse an NMEA GPGSA sentence and update the given UAVObject
|
* Parse an NMEA GPGSA sentence and update the given UAVObject
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
#include "systemsettings.h"
|
#include "systemsettings.h"
|
||||||
#include "i2cstats.h"
|
#include "i2cstats.h"
|
||||||
#include "taskinfo.h"
|
#include "taskinfo.h"
|
||||||
|
#include "hwsettings.h"
|
||||||
#include "watchdogstatus.h"
|
#include "watchdogstatus.h"
|
||||||
#include "taskmonitor.h"
|
#include "taskmonitor.h"
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include "telemetry.h"
|
#include "telemetry.h"
|
||||||
#include "flighttelemetrystats.h"
|
#include "flighttelemetrystats.h"
|
||||||
#include "gcstelemetrystats.h"
|
#include "gcstelemetrystats.h"
|
||||||
#include "telemetrysettings.h"
|
#include "hwsettings.h"
|
||||||
|
|
||||||
// Private constants
|
// Private constants
|
||||||
#define MAX_QUEUE_SIZE TELEM_QUEUE_SIZE
|
#define MAX_QUEUE_SIZE TELEM_QUEUE_SIZE
|
||||||
@ -65,7 +65,6 @@ static xTaskHandle telemetryTxTaskHandle;
|
|||||||
static xTaskHandle telemetryRxTaskHandle;
|
static xTaskHandle telemetryRxTaskHandle;
|
||||||
static uint32_t txErrors;
|
static uint32_t txErrors;
|
||||||
static uint32_t txRetries;
|
static uint32_t txRetries;
|
||||||
static TelemetrySettingsData settings;
|
|
||||||
static uint32_t timeOfLastObjectUpdate;
|
static uint32_t timeOfLastObjectUpdate;
|
||||||
static UAVTalkConnection uavTalkCon;
|
static UAVTalkConnection uavTalkCon;
|
||||||
|
|
||||||
@ -94,7 +93,6 @@ int32_t TelemetryStart(void)
|
|||||||
|
|
||||||
// Listen to objects of interest
|
// Listen to objects of interest
|
||||||
GCSTelemetryStatsConnectQueue(priorityQueue);
|
GCSTelemetryStatsConnectQueue(priorityQueue);
|
||||||
TelemetrySettingsConnectQueue(priorityQueue);
|
|
||||||
|
|
||||||
// Start telemetry tasks
|
// Start telemetry tasks
|
||||||
xTaskCreate(telemetryTxTask, (signed char *)"TelTx", STACK_SIZE_BYTES/4, NULL, TASK_PRIORITY_TX, &telemetryTxTaskHandle);
|
xTaskCreate(telemetryTxTask, (signed char *)"TelTx", STACK_SIZE_BYTES/4, NULL, TASK_PRIORITY_TX, &telemetryTxTaskHandle);
|
||||||
@ -117,11 +115,8 @@ int32_t TelemetryStart(void)
|
|||||||
*/
|
*/
|
||||||
int32_t TelemetryInitialize(void)
|
int32_t TelemetryInitialize(void)
|
||||||
{
|
{
|
||||||
UAVObjEvent ev;
|
|
||||||
|
|
||||||
FlightTelemetryStatsInitialize();
|
FlightTelemetryStatsInitialize();
|
||||||
GCSTelemetryStatsInitialize();
|
GCSTelemetryStatsInitialize();
|
||||||
TelemetrySettingsInitialize();
|
|
||||||
|
|
||||||
// Initialize vars
|
// Initialize vars
|
||||||
timeOfLastObjectUpdate = 0;
|
timeOfLastObjectUpdate = 0;
|
||||||
@ -132,7 +127,9 @@ int32_t TelemetryInitialize(void)
|
|||||||
priorityQueue = xQueueCreate(MAX_QUEUE_SIZE, sizeof(UAVObjEvent));
|
priorityQueue = xQueueCreate(MAX_QUEUE_SIZE, sizeof(UAVObjEvent));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Get telemetry settings object
|
// Update telemetry settings
|
||||||
|
telemetryPort = PIOS_COM_TELEM_RF;
|
||||||
|
HwSettingsInitialize();
|
||||||
updateSettings();
|
updateSettings();
|
||||||
|
|
||||||
// Initialise UAVTalk
|
// Initialise UAVTalk
|
||||||
@ -141,10 +138,10 @@ int32_t TelemetryInitialize(void)
|
|||||||
// Create periodic event that will be used to update the telemetry stats
|
// Create periodic event that will be used to update the telemetry stats
|
||||||
txErrors = 0;
|
txErrors = 0;
|
||||||
txRetries = 0;
|
txRetries = 0;
|
||||||
|
UAVObjEvent ev;
|
||||||
memset(&ev, 0, sizeof(UAVObjEvent));
|
memset(&ev, 0, sizeof(UAVObjEvent));
|
||||||
EventPeriodicQueueCreate(&ev, priorityQueue, STATS_UPDATE_PERIOD_MS);
|
EventPeriodicQueueCreate(&ev, priorityQueue, STATS_UPDATE_PERIOD_MS);
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,8 +223,6 @@ static void processObjEvent(UAVObjEvent * ev)
|
|||||||
updateTelemetryStats();
|
updateTelemetryStats();
|
||||||
} else if (ev->obj == GCSTelemetryStatsHandle()) {
|
} else if (ev->obj == GCSTelemetryStatsHandle()) {
|
||||||
gcsTelemetryStatsUpdated();
|
gcsTelemetryStatsUpdated();
|
||||||
} else if (ev->obj == TelemetrySettingsHandle()) {
|
|
||||||
updateSettings();
|
|
||||||
} else {
|
} else {
|
||||||
// Only process event if connected to GCS or if object FlightTelemetryStats is updated
|
// Only process event if connected to GCS or if object FlightTelemetryStats is updated
|
||||||
FlightTelemetryStatsGet(&flightStats);
|
FlightTelemetryStatsGet(&flightStats);
|
||||||
@ -509,27 +504,45 @@ static void updateTelemetryStats()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the telemetry settings, called on startup and
|
* Update the telemetry settings, called on startup.
|
||||||
* each time the settings object is updated
|
* FIXME: This should be in the TelemetrySettings object. But objects
|
||||||
|
* have too much overhead yet. Also the telemetry has no any specific
|
||||||
|
* settings, etc. Thus the HwSettings object which contains the
|
||||||
|
* telemetry port speed is used for now.
|
||||||
*/
|
*/
|
||||||
static void updateSettings()
|
static void updateSettings()
|
||||||
{
|
{
|
||||||
// Set port
|
if (telemetryPort) {
|
||||||
telemetryPort = PIOS_COM_TELEM_RF;
|
|
||||||
|
|
||||||
// Retrieve settings
|
// Retrieve settings
|
||||||
TelemetrySettingsGet(&settings);
|
uint8_t speed;
|
||||||
|
HwSettingsTelemetrySpeedGet(&speed);
|
||||||
|
|
||||||
if (telemetryPort) {
|
// Set port speed
|
||||||
// Set port speed
|
switch (speed) {
|
||||||
if (settings.Speed == TELEMETRYSETTINGS_SPEED_2400) PIOS_COM_ChangeBaud(telemetryPort, 2400);
|
case HWSETTINGS_TELEMETRYSPEED_2400:
|
||||||
else if (settings.Speed == TELEMETRYSETTINGS_SPEED_4800) PIOS_COM_ChangeBaud(telemetryPort, 4800);
|
PIOS_COM_ChangeBaud(telemetryPort, 2400);
|
||||||
else if (settings.Speed == TELEMETRYSETTINGS_SPEED_9600) PIOS_COM_ChangeBaud(telemetryPort, 9600);
|
break;
|
||||||
else if (settings.Speed == TELEMETRYSETTINGS_SPEED_19200) PIOS_COM_ChangeBaud(telemetryPort, 19200);
|
case HWSETTINGS_TELEMETRYSPEED_4800:
|
||||||
else if (settings.Speed == TELEMETRYSETTINGS_SPEED_38400) PIOS_COM_ChangeBaud(telemetryPort, 38400);
|
PIOS_COM_ChangeBaud(telemetryPort, 4800);
|
||||||
else if (settings.Speed == TELEMETRYSETTINGS_SPEED_57600) PIOS_COM_ChangeBaud(telemetryPort, 57600);
|
break;
|
||||||
else if (settings.Speed == TELEMETRYSETTINGS_SPEED_115200) PIOS_COM_ChangeBaud(telemetryPort, 115200);
|
case HWSETTINGS_TELEMETRYSPEED_9600:
|
||||||
}
|
PIOS_COM_ChangeBaud(telemetryPort, 9600);
|
||||||
|
break;
|
||||||
|
case HWSETTINGS_TELEMETRYSPEED_19200:
|
||||||
|
PIOS_COM_ChangeBaud(telemetryPort, 19200);
|
||||||
|
break;
|
||||||
|
case HWSETTINGS_TELEMETRYSPEED_38400:
|
||||||
|
PIOS_COM_ChangeBaud(telemetryPort, 38400);
|
||||||
|
break;
|
||||||
|
case HWSETTINGS_TELEMETRYSPEED_57600:
|
||||||
|
PIOS_COM_ChangeBaud(telemetryPort, 57600);
|
||||||
|
break;
|
||||||
|
case HWSETTINGS_TELEMETRYSPEED_115200:
|
||||||
|
PIOS_COM_ChangeBaud(telemetryPort, 115200);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,6 +37,9 @@ OUTDIR := $(TOP)/build/$(TARGET)
|
|||||||
# Set to YES to compile for debugging
|
# Set to YES to compile for debugging
|
||||||
DEBUG ?= YES
|
DEBUG ?= YES
|
||||||
|
|
||||||
|
# Include objects that are just nice information to show
|
||||||
|
DIAGNOSTICS ?= YES
|
||||||
|
|
||||||
# Set to YES to use the Servo output pins for debugging via scope or logic analyser
|
# Set to YES to use the Servo output pins for debugging via scope or logic analyser
|
||||||
ENABLE_DEBUG_PINS ?= NO
|
ENABLE_DEBUG_PINS ?= NO
|
||||||
|
|
||||||
@ -55,13 +58,16 @@ endif
|
|||||||
|
|
||||||
FLASH_TOOL = OPENOCD
|
FLASH_TOOL = OPENOCD
|
||||||
|
|
||||||
|
|
||||||
# List of modules to include
|
# List of modules to include
|
||||||
MODULES = Actuator Telemetry GPS ManualControl Altitude AHRSComms Stabilization Guidance FirmwareIAP
|
OPTMODULES = CameraStab GPS
|
||||||
|
MODULES = Actuator ManualControl Altitude AHRSComms Stabilization Guidance FirmwareIAP
|
||||||
PYMODULES = FlightPlan
|
PYMODULES = FlightPlan
|
||||||
#MODULES = Telemetry Example
|
#MODULES = Telemetry Example
|
||||||
#MODULES = Telemetry MK/MKSerial
|
#MODULES = Telemetry MK/MKSerial
|
||||||
#MODULES = Telemetry
|
#MODULES = Telemetry
|
||||||
#MODULES += Osd/OsdEtStd
|
#MODULES += Osd/OsdEtStd
|
||||||
|
MODULES += Telemetry
|
||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
OPSYSTEM = ./System
|
OPSYSTEM = ./System
|
||||||
@ -125,6 +131,7 @@ PYSRC += ${foreach MOD, ${PYMODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
|||||||
SRC += $(PYSRC)
|
SRC += $(PYSRC)
|
||||||
|
|
||||||
## MODULES
|
## MODULES
|
||||||
|
SRC += ${foreach MOD, ${OPTMODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
||||||
SRC += ${foreach MOD, ${MODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
SRC += ${foreach MOD, ${MODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
||||||
## OPENPILOT CORE:
|
## OPENPILOT CORE:
|
||||||
SRC += ${OPMODULEDIR}/System/systemmod.c
|
SRC += ${OPMODULEDIR}/System/systemmod.c
|
||||||
@ -307,7 +314,7 @@ EXTRAINCDIRS += $(RTOSSRCDIR)/portable/GCC/ARM_CM3
|
|||||||
EXTRAINCDIRS += $(AHRSBOOTLOADERINC)
|
EXTRAINCDIRS += $(AHRSBOOTLOADERINC)
|
||||||
EXTRAINCDIRS += $(PYMITEINC)
|
EXTRAINCDIRS += $(PYMITEINC)
|
||||||
|
|
||||||
EXTRAINCDIRS += ${foreach MOD, ${MODULES} ${PYMODULES}, $(OPMODULEDIR)/${MOD}/inc} ${OPMODULEDIR}/System/inc
|
EXTRAINCDIRS += ${foreach MOD, ${OPTMODULES} ${MODULES} ${PYMODULES}, $(OPMODULEDIR)/${MOD}/inc} ${OPMODULEDIR}/System/inc
|
||||||
|
|
||||||
|
|
||||||
# List any extra directories to look for library files here.
|
# List any extra directories to look for library files here.
|
||||||
@ -385,12 +392,14 @@ CSTANDARD = -std=gnu99
|
|||||||
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
||||||
|
|
||||||
ifeq ($(DEBUG),YES)
|
ifeq ($(DEBUG),YES)
|
||||||
CFLAGS = -g$(DEBUGF) -DDEBUG
|
CFLAGS = -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OP has enough memory to always enable optional objects
|
ifeq ($(DIAGNOSTICS),YES)
|
||||||
CFLAGS += -DDIAGNOSTICS
|
CFLAGS = -DDIAGNOSTICS
|
||||||
|
endif
|
||||||
|
|
||||||
|
CFLAGS += -g$(DEBUGF)
|
||||||
CFLAGS += -O$(OPT)
|
CFLAGS += -O$(OPT)
|
||||||
CFLAGS += -mcpu=$(MCU)
|
CFLAGS += -mcpu=$(MCU)
|
||||||
CFLAGS += $(CDEFS)
|
CFLAGS += $(CDEFS)
|
||||||
@ -472,9 +481,6 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Generate intermediate code
|
# Generate intermediate code
|
||||||
gencode: ${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/pmlibusr_nat.c ${OUTDIR}/pmfeatures.h
|
|
||||||
|
|
||||||
$(PYSRC): gencode
|
|
||||||
|
|
||||||
# Generate code for PyMite
|
# Generate code for PyMite
|
||||||
${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/pmlibusr_nat.c ${OUTDIR}/pmfeatures.h: $(wildcard ${PYMITELIB}/*.py) $(wildcard ${PYMITEPLAT}/*.py) $(wildcard ${FLIGHTPLANLIB}/*.py) $(wildcard ${FLIGHTPLANS}/*.py)
|
${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/pmlibusr_nat.c ${OUTDIR}/pmfeatures.h: $(wildcard ${PYMITELIB}/*.py) $(wildcard ${PYMITEPLAT}/*.py) $(wildcard ${FLIGHTPLANLIB}/*.py) $(wildcard ${FLIGHTPLANS}/*.py)
|
||||||
@ -582,4 +588,4 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Listing of phony targets.
|
# Listing of phony targets.
|
||||||
.PHONY : all build clean clean_list gencode install
|
.PHONY : all build clean clean_list install
|
||||||
|
@ -27,6 +27,9 @@
|
|||||||
# Set to YES to compile for debugging
|
# Set to YES to compile for debugging
|
||||||
DEBUG ?= YES
|
DEBUG ?= YES
|
||||||
|
|
||||||
|
# Include objects that are just nice information to show
|
||||||
|
DIAGNOSTICS ?= YES
|
||||||
|
|
||||||
# Set to YES to use the Servo output pins for debugging via scope or logic analyser
|
# Set to YES to use the Servo output pins for debugging via scope or logic analyser
|
||||||
ENABLE_DEBUG_PINS ?= NO
|
ENABLE_DEBUG_PINS ?= NO
|
||||||
|
|
||||||
@ -53,10 +56,12 @@ FLASH_TOOL = OPENOCD
|
|||||||
USE_THUMB_MODE = YES
|
USE_THUMB_MODE = YES
|
||||||
|
|
||||||
# List of modules to include
|
# List of modules to include
|
||||||
MODULES = Telemetry Actuator Stabilization Guidance ManualControl FlightPlan GPS
|
OPTMODULES = CameraStab GPS
|
||||||
|
MODULES = Telemetry Actuator Stabilization Guidance ManualControl
|
||||||
#MODULES = Telemetry ManualControl Actuator Attitude Stabilization
|
#MODULES = Telemetry ManualControl Actuator Attitude Stabilization
|
||||||
#MODULES = Telemetry Example
|
#MODULES = Telemetry Example
|
||||||
#MODULES = Telemetry MK/MKSerial
|
#MODULES = Telemetry MK/MKSerial
|
||||||
|
PYMODULES = FlightPlan
|
||||||
|
|
||||||
#MODULES += Osd/OsdEtStd
|
#MODULES += Osd/OsdEtStd
|
||||||
|
|
||||||
@ -121,6 +126,7 @@ UAVOBJPYTHONSYNTHDIR = $(OUTDIR)/../uavobject-synthetics/python
|
|||||||
# use file-extension c for "c-only"-files
|
# use file-extension c for "c-only"-files
|
||||||
|
|
||||||
MODNAMES = $(notdir ${MODULES})
|
MODNAMES = $(notdir ${MODULES})
|
||||||
|
MODNAMES += $(notdir ${OPTMODULES})
|
||||||
|
|
||||||
ifndef TESTAPP
|
ifndef TESTAPP
|
||||||
|
|
||||||
@ -129,10 +135,13 @@ SRC += $(OUTDIR)/pmlib_img.c
|
|||||||
SRC += $(OUTDIR)/pmlib_nat.c
|
SRC += $(OUTDIR)/pmlib_nat.c
|
||||||
SRC += $(OUTDIR)/pmlibusr_img.c
|
SRC += $(OUTDIR)/pmlibusr_img.c
|
||||||
SRC += $(OUTDIR)/pmlibusr_nat.c
|
SRC += $(OUTDIR)/pmlibusr_nat.c
|
||||||
SRC += $(wildcard ${PYMITEVM}/*.c)
|
PYSRC += $(wildcard ${PYMITEVM}/*.c)
|
||||||
SRC += $(wildcard ${PYMITEPLAT}/*.c)
|
PYSRC += $(wildcard ${PYMITEPLAT}/*.c)
|
||||||
|
PYSRC += ${foreach MOD, ${PYMODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
||||||
|
SRC += $(PYSRC)
|
||||||
|
|
||||||
## MODULES
|
## MODULES
|
||||||
|
SRC += ${foreach MOD, ${OPTMODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
||||||
SRC += ${foreach MOD, ${MODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
SRC += ${foreach MOD, ${MODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
|
||||||
SRC += ${OUTDIR}/InitMods.c
|
SRC += ${OUTDIR}/InitMods.c
|
||||||
## OPENPILOT CORE:
|
## OPENPILOT CORE:
|
||||||
@ -228,7 +237,7 @@ EXTRAINCDIRS += $(APPLIBDIR)
|
|||||||
EXTRAINCDIRS += $(RTOSSRCDIR)/portable/GCC/Posix
|
EXTRAINCDIRS += $(RTOSSRCDIR)/portable/GCC/Posix
|
||||||
EXTRAINCDIRS += $(PYMITEINC)
|
EXTRAINCDIRS += $(PYMITEINC)
|
||||||
|
|
||||||
EXTRAINCDIRS += ${foreach MOD, ${MODULES}, $(OPMODULEDIR)/${MOD}/inc} ${OPMODULEDIR}/System/inc
|
EXTRAINCDIRS += ${foreach MOD, ${PYMODULES} ${OPTMODULES} ${MODULES}, $(OPMODULEDIR)/${MOD}/inc} ${OPMODULEDIR}/System/inc
|
||||||
|
|
||||||
|
|
||||||
# List any extra directories to look for library files here.
|
# List any extra directories to look for library files here.
|
||||||
@ -306,6 +315,10 @@ ifeq ($(DEBUG),YES)
|
|||||||
CFLAGS = -g$(DEBUGF) -DDEBUG
|
CFLAGS = -g$(DEBUGF) -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(DIAGNOSTICS),YES)
|
||||||
|
CFLAGS = -DDIAGNOSTICS
|
||||||
|
endif
|
||||||
|
|
||||||
CFLAGS += $(CFLAGS_UAVOBJECTS)
|
CFLAGS += $(CFLAGS_UAVOBJECTS)
|
||||||
CFLAGS += -DARCH_POSIX
|
CFLAGS += -DARCH_POSIX
|
||||||
CFLAGS += -O$(OPT)
|
CFLAGS += -O$(OPT)
|
||||||
@ -436,9 +449,6 @@ else
|
|||||||
quote =
|
quote =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Generate intermediate code
|
|
||||||
gencode: ${OUTDIR}/InitMods.c ${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/pmlibusr_nat.c ${OUTDIR}/pmfeatures.h
|
|
||||||
|
|
||||||
# Generate code for module initialization
|
# Generate code for module initialization
|
||||||
${OUTDIR}/InitMods.c: Makefile.posix
|
${OUTDIR}/InitMods.c: Makefile.posix
|
||||||
@echo ${MSG_MODINIT}
|
@echo ${MSG_MODINIT}
|
||||||
@ -453,9 +463,9 @@ ${OUTDIR}/InitMods.c: Makefile.posix
|
|||||||
@echo ${quote}}${quote} >> ${OUTDIR}/InitMods.c
|
@echo ${quote}}${quote} >> ${OUTDIR}/InitMods.c
|
||||||
|
|
||||||
# Generate code for PyMite
|
# Generate code for PyMite
|
||||||
${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/pmlibusr_nat.c ${OUTDIR}/pmfeatures.h: $(wildcard ${PYMITELIB}/*.py) $(wildcard ${PYMITEPLAT}/*.py) $(wildcard ${FLIGHTPLANLIB}/*.py) $(wildcard ${FLIGHTPLANS}/*.py) $(wildcard $(UAVOBJPYTHONSYNTHDIR)/*.py)
|
${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/pmlibusr_nat.c ${OUTDIR}/pmfeatures.h: $(wildcard ${PYMITELIB}/*.py) $(wildcard ${PYMITEPLAT}/*.py) $(wildcard ${FLIGHTPLANLIB}/*.py) $(wildcard ${FLIGHTPLANS}/*.py)
|
||||||
@echo ${MSG_PYMITEINIT}
|
@echo $(MSG_PYMITEINIT) $(call toprel, $@)
|
||||||
@$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -s --memspace=flash -o $(OUTDIR)/pmlib_img.c --native-file=$(OUTDIR)/pmlib_nat.c $(PYMITELIB)/list.py $(PYMITELIB)/dict.py $(PYMITELIB)/__bi.py $(PYMITELIB)/sys.py $(PYMITELIB)/string.py $(wildcard $(FLIGHTPLANLIB)/*.py) $(wildcard $(UAVOBJPYTHONSYNTHDIR)/*.py)
|
@$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -s --memspace=flash -o $(OUTDIR)/pmlib_img.c --native-file=$(OUTDIR)/pmlib_nat.c $(PYMITELIB)/list.py $(PYMITELIB)/dict.py $(PYMITELIB)/__bi.py $(PYMITELIB)/sys.py $(PYMITELIB)/string.py $(wildcard $(FLIGHTPLANLIB)/*.py)
|
||||||
@$(PYTHON) $(PYMITETOOLS)/pmGenPmFeatures.py $(PYMITEPLAT)/pmfeatures.py > $(OUTDIR)/pmfeatures.h
|
@$(PYTHON) $(PYMITETOOLS)/pmGenPmFeatures.py $(PYMITEPLAT)/pmfeatures.py > $(OUTDIR)/pmfeatures.h
|
||||||
@$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py
|
@$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py
|
||||||
|
|
||||||
@ -651,5 +661,5 @@ endif
|
|||||||
|
|
||||||
# Listing of phony targets.
|
# Listing of phony targets.
|
||||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||||
build elf hex bin lss sym clean clean_list program gencode
|
build elf hex bin lss sym clean clean_list program
|
||||||
|
|
||||||
|
@ -78,12 +78,6 @@
|
|||||||
/* Enable a priority queue in telemetry */
|
/* Enable a priority queue in telemetry */
|
||||||
#define PIOS_TELEM_PRIORITY_QUEUE
|
#define PIOS_TELEM_PRIORITY_QUEUE
|
||||||
|
|
||||||
/* COM Module */
|
|
||||||
#define GPS_BAUDRATE 19200
|
|
||||||
#define TELEM_BAUDRATE 19200
|
|
||||||
#define AUXUART_ENABLED 0
|
|
||||||
#define AUXUART_BAUDRATE 19200
|
|
||||||
|
|
||||||
/* Alarm Thresholds */
|
/* Alarm Thresholds */
|
||||||
#define HEAP_LIMIT_WARNING 4000
|
#define HEAP_LIMIT_WARNING 4000
|
||||||
#define HEAP_LIMIT_CRITICAL 1000
|
#define HEAP_LIMIT_CRITICAL 1000
|
||||||
@ -98,6 +92,8 @@
|
|||||||
/* GPS options */
|
/* GPS options */
|
||||||
#define PIOS_GPS_SETS_HOMELOCATION
|
#define PIOS_GPS_SETS_HOMELOCATION
|
||||||
|
|
||||||
|
/* PIOS Initcall infrastructure */
|
||||||
|
#define PIOS_INCLUDE_INITCALL
|
||||||
|
|
||||||
#endif /* PIOS_CONFIG_H */
|
#endif /* PIOS_CONFIG_H */
|
||||||
/**
|
/**
|
||||||
|
@ -50,15 +50,17 @@
|
|||||||
#define LOG_FILENAME "PIOS.LOG"
|
#define LOG_FILENAME "PIOS.LOG"
|
||||||
#define STARTUP_LOG_ENABLED 1
|
#define STARTUP_LOG_ENABLED 1
|
||||||
|
|
||||||
/* COM Module */
|
|
||||||
#define GPS_BAUDRATE 19200
|
|
||||||
#define TELEM_BAUDRATE 19200
|
|
||||||
#define AUXUART_ENABLED 0
|
|
||||||
#define AUXUART_BAUDRATE 19200
|
|
||||||
|
|
||||||
#define TELEM_QUEUE_SIZE 20
|
#define TELEM_QUEUE_SIZE 20
|
||||||
#define PIOS_TELEM_STACK_SIZE 2048
|
#define PIOS_TELEM_STACK_SIZE 2048
|
||||||
|
|
||||||
|
/* Alarm Thresholds */
|
||||||
|
#define HEAP_LIMIT_WARNING 4000
|
||||||
|
#define HEAP_LIMIT_CRITICAL 1000
|
||||||
|
#define IRQSTACK_LIMIT_WARNING 150
|
||||||
|
#define IRQSTACK_LIMIT_CRITICAL 80
|
||||||
|
#define CPULOAD_LIMIT_WARNING 80
|
||||||
|
#define CPULOAD_LIMIT_CRITICAL 95
|
||||||
|
|
||||||
/* Stabilization options */
|
/* Stabilization options */
|
||||||
#define PIOS_QUATERNION_STABILIZATION
|
#define PIOS_QUATERNION_STABILIZATION
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include <openpilot.h>
|
#include <openpilot.h>
|
||||||
#include <uavobjectsinit.h>
|
#include <uavobjectsinit.h>
|
||||||
#include <hwsettings.h>
|
#include <hwsettings.h>
|
||||||
#include "manualcontrolsettings.h"
|
#include <manualcontrolsettings.h>
|
||||||
|
|
||||||
//#define I2C_DEBUG_PIN 0
|
//#define I2C_DEBUG_PIN 0
|
||||||
//#define USART_GPS_DEBUG_PIN 1
|
//#define USART_GPS_DEBUG_PIN 1
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <openpilot.h>
|
#include <openpilot.h>
|
||||||
#include <uavobjectsinit.h>
|
#include <uavobjectsinit.h>
|
||||||
|
|
||||||
|
#include "hwsettings.h"
|
||||||
#include "attituderaw.h"
|
#include "attituderaw.h"
|
||||||
#include "attitudeactual.h"
|
#include "attitudeactual.h"
|
||||||
#include "positionactual.h"
|
#include "positionactual.h"
|
||||||
@ -187,6 +188,7 @@ void PIOS_Board_Init(void) {
|
|||||||
AttitudeActualInitialize();
|
AttitudeActualInitialize();
|
||||||
VelocityActualInitialize();
|
VelocityActualInitialize();
|
||||||
PositionActualInitialize();
|
PositionActualInitialize();
|
||||||
|
HwSettingsInitialize();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@ UAVOBJSRCFILENAMES += systemalarms
|
|||||||
UAVOBJSRCFILENAMES += systemsettings
|
UAVOBJSRCFILENAMES += systemsettings
|
||||||
UAVOBJSRCFILENAMES += systemstats
|
UAVOBJSRCFILENAMES += systemstats
|
||||||
UAVOBJSRCFILENAMES += taskinfo
|
UAVOBJSRCFILENAMES += taskinfo
|
||||||
UAVOBJSRCFILENAMES += telemetrysettings
|
|
||||||
UAVOBJSRCFILENAMES += velocityactual
|
UAVOBJSRCFILENAMES += velocityactual
|
||||||
UAVOBJSRCFILENAMES += velocitydesired
|
UAVOBJSRCFILENAMES += velocitydesired
|
||||||
UAVOBJSRCFILENAMES += watchdogstatus
|
UAVOBJSRCFILENAMES += watchdogstatus
|
||||||
|
@ -59,7 +59,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Generic initcall infrastructure */
|
/* Generic initcall infrastructure */
|
||||||
|
#if defined(PIOS_INCLUDE_INITCALL)
|
||||||
#include "pios_initcall.h"
|
#include "pios_initcall.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* PIOS Board Specific Device Configuration */
|
/* PIOS Board Specific Device Configuration */
|
||||||
#include "pios_board.h"
|
#include "pios_board.h"
|
||||||
|
@ -102,18 +102,42 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<property name="text">
|
<item row="0" column="0">
|
||||||
<string>Telemetry speed:</string>
|
<widget class="QLabel" name="telemetrySpeedLabel">
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>Telemetry speed:</string>
|
||||||
</item>
|
</property>
|
||||||
<item>
|
</widget>
|
||||||
<widget class="QComboBox" name="telemetrySpeed">
|
</item>
|
||||||
<property name="toolTip">
|
<item row="1" column="0">
|
||||||
<string>Select the speed here.</string>
|
<widget class="QLabel" name="GpsSpeedLabel">
|
||||||
</property>
|
<property name="minimumSize">
|
||||||
</widget>
|
<size>
|
||||||
|
<width>55</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>GPS speed:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="telemetrySpeed">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Select the speed here.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="gpsSpeed">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Select the speed here.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_3">
|
<spacer name="horizontalSpacer_3">
|
||||||
@ -130,6 +154,19 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="problems">
|
<widget class="QLabel" name="problems">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@ -149,19 +186,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
|
@ -41,10 +41,11 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
|
|||||||
m_telemetry = new Ui_CC_HW_Widget();
|
m_telemetry = new Ui_CC_HW_Widget();
|
||||||
m_telemetry->setupUi(this);
|
m_telemetry->setupUi(this);
|
||||||
setupButtons(m_telemetry->saveTelemetryToRAM,m_telemetry->saveTelemetryToSD);
|
setupButtons(m_telemetry->saveTelemetryToRAM,m_telemetry->saveTelemetryToSD);
|
||||||
addUAVObjectToWidgetRelation("TelemetrySettings","Speed",m_telemetry->telemetrySpeed);
|
|
||||||
addUAVObjectToWidgetRelation("HwSettings","CC_FlexiPort",m_telemetry->cbFlexi);
|
addUAVObjectToWidgetRelation("HwSettings","CC_FlexiPort",m_telemetry->cbFlexi);
|
||||||
addUAVObjectToWidgetRelation("HwSettings","CC_MainPort",m_telemetry->cbTele);
|
addUAVObjectToWidgetRelation("HwSettings","CC_MainPort",m_telemetry->cbTele);
|
||||||
addUAVObjectToWidgetRelation("HwSettings","CC_RcvrPort",m_telemetry->cbRcvr);
|
addUAVObjectToWidgetRelation("HwSettings","CC_RcvrPort",m_telemetry->cbRcvr);
|
||||||
|
addUAVObjectToWidgetRelation("HwSettings","TelemetrySpeed",m_telemetry->telemetrySpeed);
|
||||||
|
addUAVObjectToWidgetRelation("HwSettings","GPSSpeed",m_telemetry->gpsSpeed);
|
||||||
connect(m_telemetry->cchwHelp,SIGNAL(clicked()),this,SLOT(openHelp()));
|
connect(m_telemetry->cchwHelp,SIGNAL(clicked()),this,SLOT(openHelp()));
|
||||||
enableControls(false);
|
enableControls(false);
|
||||||
populateWidgets();
|
populateWidgets();
|
||||||
|
@ -40,7 +40,7 @@ ConfigProHWWidget::ConfigProHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
|
|||||||
m_telemetry->setupUi(this);
|
m_telemetry->setupUi(this);
|
||||||
|
|
||||||
setupButtons(m_telemetry->saveTelemetryToRAM,m_telemetry->saveTelemetryToSD);
|
setupButtons(m_telemetry->saveTelemetryToRAM,m_telemetry->saveTelemetryToSD);
|
||||||
addUAVObjectToWidgetRelation("TelemetrySettings","Speed",m_telemetry->telemetrySpeed);
|
addUAVObjectToWidgetRelation("HwSettings","TelemetrySpeed",m_telemetry->telemetrySpeed);
|
||||||
enableControls(false);
|
enableControls(false);
|
||||||
populateWidgets();
|
populateWidgets();
|
||||||
refreshWidgetsValues();
|
refreshWidgetsValues();
|
||||||
|
@ -101,7 +101,7 @@ void ConfigCameraStabilizationWidget::applySettings()
|
|||||||
// Enable or disable the settings
|
// Enable or disable the settings
|
||||||
HwSettings * hwSettings = HwSettings::GetInstance(getObjectManager());
|
HwSettings * hwSettings = HwSettings::GetInstance(getObjectManager());
|
||||||
HwSettings::DataFields hwSettingsData = hwSettings->getData();
|
HwSettings::DataFields hwSettingsData = hwSettings->getData();
|
||||||
hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_CAMERASTABILIZATION] =
|
hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_CAMERASTAB] =
|
||||||
m_camerastabilization->enableCameraStabilization->isChecked() ?
|
m_camerastabilization->enableCameraStabilization->isChecked() ?
|
||||||
HwSettings::OPTIONALMODULES_ENABLED :
|
HwSettings::OPTIONALMODULES_ENABLED :
|
||||||
HwSettings::OPTIONALMODULES_DISABLED;
|
HwSettings::OPTIONALMODULES_DISABLED;
|
||||||
@ -195,7 +195,7 @@ void ConfigCameraStabilizationWidget::refreshValues()
|
|||||||
HwSettings * hwSettings = HwSettings::GetInstance(getObjectManager());
|
HwSettings * hwSettings = HwSettings::GetInstance(getObjectManager());
|
||||||
HwSettings::DataFields hwSettingsData = hwSettings->getData();
|
HwSettings::DataFields hwSettingsData = hwSettings->getData();
|
||||||
m_camerastabilization->enableCameraStabilization->setChecked(
|
m_camerastabilization->enableCameraStabilization->setChecked(
|
||||||
hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_CAMERASTABILIZATION] ==
|
hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_CAMERASTAB] ==
|
||||||
HwSettings::OPTIONALMODULES_ENABLED);
|
HwSettings::OPTIONALMODULES_ENABLED);
|
||||||
|
|
||||||
CameraStabSettings * cameraStabSettings = CameraStabSettings::GetInstance(getObjectManager());
|
CameraStabSettings * cameraStabSettings = CameraStabSettings::GetInstance(getObjectManager());
|
||||||
|
@ -36,7 +36,6 @@ HEADERS += $$UAVOBJECT_SYNTHETICS/accessorydesired.h \
|
|||||||
$$UAVOBJECT_SYNTHETICS/systemstats.h \
|
$$UAVOBJECT_SYNTHETICS/systemstats.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/systemalarms.h \
|
$$UAVOBJECT_SYNTHETICS/systemalarms.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/objectpersistence.h \
|
$$UAVOBJECT_SYNTHETICS/objectpersistence.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/telemetrysettings.h \
|
|
||||||
$$UAVOBJECT_SYNTHETICS/systemsettings.h \
|
$$UAVOBJECT_SYNTHETICS/systemsettings.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/stabilizationsettings.h \
|
$$UAVOBJECT_SYNTHETICS/stabilizationsettings.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/manualcontrolsettings.h \
|
$$UAVOBJECT_SYNTHETICS/manualcontrolsettings.h \
|
||||||
@ -88,7 +87,6 @@ SOURCES += $$UAVOBJECT_SYNTHETICS/accessorydesired.cpp \
|
|||||||
$$UAVOBJECT_SYNTHETICS/systemstats.cpp \
|
$$UAVOBJECT_SYNTHETICS/systemstats.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/systemalarms.cpp \
|
$$UAVOBJECT_SYNTHETICS/systemalarms.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/objectpersistence.cpp \
|
$$UAVOBJECT_SYNTHETICS/objectpersistence.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/telemetrysettings.cpp \
|
|
||||||
$$UAVOBJECT_SYNTHETICS/systemsettings.cpp \
|
$$UAVOBJECT_SYNTHETICS/systemsettings.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/stabilizationsettings.cpp \
|
$$UAVOBJECT_SYNTHETICS/stabilizationsettings.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/manualcontrolsettings.cpp \
|
$$UAVOBJECT_SYNTHETICS/manualcontrolsettings.cpp \
|
||||||
|
@ -9,7 +9,10 @@
|
|||||||
<field name="OP_MainPort" units="function" type="enum" elements="1" options="Disabled,Telemetry" defaultvalue="Telemetry"/>
|
<field name="OP_MainPort" units="function" type="enum" elements="1" options="Disabled,Telemetry" defaultvalue="Telemetry"/>
|
||||||
<field name="OP_FlexiPort" units="function" type="enum" elements="1" options="Disabled,GPS" defaultvalue="GPS"/>
|
<field name="OP_FlexiPort" units="function" type="enum" elements="1" options="Disabled,GPS" defaultvalue="GPS"/>
|
||||||
|
|
||||||
<field name="OptionalModules" units="" type="enum" elementnames="CameraStabilization,GPS" options="Disabled,Enabled" defaultvalue="Disabled"/>
|
<field name="TelemetrySpeed" units="bps" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200" defaultvalue="57600"/>
|
||||||
|
<field name="GPSSpeed" units="bps" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200" defaultvalue="57600"/>
|
||||||
|
|
||||||
|
<field name="OptionalModules" units="" type="enum" elementnames="CameraStab,GPS" options="Disabled,Enabled" defaultvalue="Disabled"/>
|
||||||
<field name="DSMxBind" units="" type="uint8" elements="1" defaultvalue="0"/>
|
<field name="DSMxBind" units="" type="uint8" elements="1" defaultvalue="0"/>
|
||||||
|
|
||||||
<access gcs="readwrite" flight="readwrite"/>
|
<access gcs="readwrite" flight="readwrite"/>
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
<xml>
|
|
||||||
<object name="TelemetrySettings" singleinstance="true" settings="true">
|
|
||||||
<description>Select baud rate of telemetry. Warning - this must match your modem.</description>
|
|
||||||
<field name="Speed" units="" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200" defaultvalue="57600"/>
|
|
||||||
<access gcs="readwrite" flight="readwrite"/>
|
|
||||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
|
||||||
<telemetryflight acked="true" updatemode="onchange" period="0"/>
|
|
||||||
<logging updatemode="never" period="0"/>
|
|
||||||
</object>
|
|
||||||
</xml>
|
|
Loading…
x
Reference in New Issue
Block a user