1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

LP-354 Add Ublox AssistNowAutonomous setting, file heading typos

This commit is contained in:
Laurent Lalanne 2016-07-03 03:51:44 +02:00
parent 5ca24b6d25
commit 831f8265e7
11 changed files with 96 additions and 39 deletions

View File

@ -2,7 +2,7 @@
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup GSPModule GPS Module
* @addtogroup GPSModule GPS Module
* @brief Process GPS information (DJI-Naza binary format)
* @{
*

View File

@ -2,14 +2,14 @@
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup GSPModule GPS Module
* @addtogroup GPSModule GPS Module
* @brief Process GPS information
* @{
*
* @file GPS.c
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief GPS module, handles GPS and NMEA stream
* @brief GPS module, handles GPS and various streams
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
@ -669,6 +669,7 @@ void updateGpsSettings(__attribute__((unused)) UAVObjEvent *ev)
// because ubx auto config never gets called
// setting it up completely means that if we switch from the other protocol to UBX or disabled to enabled, that it will start normally
newconfig.UbxAutoConfig = gpsSettings.UbxAutoConfig;
newconfig.AssistNowAutonomous = gpsSettings.UbxAssistNowAutonomous;
newconfig.navRate = gpsSettings.UbxRate;
newconfig.dynamicModel = gpsSettings.UbxDynamicModel == GPSSETTINGS_UBXDYNAMICMODEL_PORTABLE ? UBX_DYNMODEL_PORTABLE :
gpsSettings.UbxDynamicModel == GPSSETTINGS_UBXDYNAMICMODEL_STATIONARY ? UBX_DYNMODEL_STATIONARY :

View File

@ -2,8 +2,8 @@
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup GSPModule GPS Module
* @brief Process GPS information
* @addtogroup GPSModule GPS Module
* @brief Process GPS information (NMEA format)
* @{
*
* @file NMEA.c

View File

@ -2,14 +2,14 @@
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup GSPModule GPS Module
* @addtogroup GPSModule GPS Module
* @brief Process GPS information (UBX binary format)
* @{
*
* @file UBX.c
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @brief GPS module, handles GPS and NMEA stream
* @brief GPS module, handles GPS and UBX stream
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup GSPModule GPS Module
* @brief Process GPS information
* @addtogroup GPSModule GPS Module
* @brief Process GPS information (DJI-Naza binary format)
* @{
*
* @file DJI.h

View File

@ -2,7 +2,7 @@
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup GSPModule GPS Module
* @addtogroup GPSModule GPS Module
* @brief Process GPS information
* @{
*

View File

@ -2,8 +2,8 @@
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup GSPModule GPS Module
* @brief Process GPS information
* @addtogroup GPSModule GPS Module
* @brief Process GPS information (NMEA format)
* @{
*
* @file NMEA.h

View File

@ -2,14 +2,14 @@
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup GSPModule GPS Module
* @brief Process GPS information
* @addtogroup GPSModule GPS Module
* @brief Process GPS information (UBX binary format)
* @{
*
* @file UBX.h
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief GPS module, handles GPS and NMEA stream
* @brief GPS module, handles GPS and UBX stream
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
@ -43,6 +43,8 @@
#define UBX_HW_VERSION_8 80000
#define UBX_HW_VERSION_7 70000
#define UBX_HW_VERSION_5 50000
#define UBX_SYNC1 0xb5 // UBX protocol synchronization characters
#define UBX_SYNC2 0x62
@ -98,13 +100,14 @@ typedef enum {
} ubx_class_mon_id;
typedef enum {
UBX_ID_CFG_NAV5 = 0x24,
UBX_ID_CFG_RATE = 0x08,
UBX_ID_CFG_MSG = 0x01,
UBX_ID_CFG_CFG = 0x09,
UBX_ID_CFG_SBAS = 0x16,
UBX_ID_CFG_GNSS = 0x3E,
UBX_ID_CFG_PRT = 0x00
UBX_ID_CFG_NAV5 = 0x24,
UBX_ID_CFG_NAVX5 = 0x23,
UBX_ID_CFG_RATE = 0x08,
UBX_ID_CFG_MSG = 0x01,
UBX_ID_CFG_CFG = 0x09,
UBX_ID_CFG_SBAS = 0x16,
UBX_ID_CFG_GNSS = 0x3E,
UBX_ID_CFG_PRT = 0x00
} ubx_class_cfg_id;
typedef enum {
@ -523,6 +526,33 @@ struct UBX_CFG_NAV5 {
uint32_t reserved4;
} __attribute__((packed));
struct UBX_CFG_NAVX5 {
uint16_t version;
uint16_t mask1;
uint32_t reserved0;
uint8_t reserved1;
uint8_t reserved2;
uint8_t minSVs;
uint8_t maxSVs;
uint8_t minCN0;
uint8_t reserved5;
uint8_t iniFix3D;
uint8_t reserved6;
uint8_t reserved7;
uint8_t reserved8;
uint16_t wknRollover;
uint32_t reserved9;
uint8_t reserved10;
uint8_t reserved11;
uint8_t usePPP;
uint8_t useAOP;
uint8_t reserved12;
uint8_t reserved13;
uint16_t aopOrbMaxErr;
uint32_t reserved3;
uint32_t reserved4;
} __attribute__((packed));
// MON message Class
#define UBX_MON_MAX_EXT 5
struct UBX_MON_VER {
@ -599,13 +629,14 @@ union UBXSENTPACKET {
struct {
struct UBXSENTHEADER header;
union {
struct UBX_CFG_CFG cfg_cfg;
struct UBX_CFG_MSG cfg_msg;
struct UBX_CFG_NAV5 cfg_nav5;
struct UBX_CFG_PRT cfg_prt;
struct UBX_CFG_RATE cfg_rate;
struct UBX_CFG_SBAS cfg_sbas;
struct UBX_CFG_GNSS cfg_gnss;
struct UBX_CFG_CFG cfg_cfg;
struct UBX_CFG_MSG cfg_msg;
struct UBX_CFG_NAV5 cfg_nav5;
struct UBX_CFG_NAVX5 cfg_navx5;
struct UBX_CFG_PRT cfg_prt;
struct UBX_CFG_RATE cfg_rate;
struct UBX_CFG_SBAS cfg_sbas;
struct UBX_CFG_GNSS cfg_gnss;
} payload;
uint8_t resvd[2]; // added space for checksum bytes
} message;

View File

@ -1,13 +1,17 @@
/**
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup GPSModule GPS Module
* @brief Support code for UBX AutoConfig
* @{
*
* @file ubx_autoconfig.h
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014.
* @brief Support code for UBX AutoConfig
* @see The GNU Public License (GPL) Version 3
*
* @file %FILENAME%
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014.
* @addtogroup [Group]
* @{
* @addtogroup %CLASS%
* @{
* @brief [Brief]
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
@ -85,6 +89,7 @@ typedef enum {
#define UBX_
typedef struct {
GPSSettingsUbxAutoConfigOptions UbxAutoConfig;
GPSSettingsUbxAssistNowAutonomousOptions AssistNowAutonomous;
bool SBASRanging;
bool SBASCorrection;
bool SBASIntegrity;
@ -102,6 +107,7 @@ typedef struct {
// Sent messages for configuration support
typedef struct UBX_CFG_CFG ubx_cfg_cfg_t;
typedef struct UBX_CFG_NAV5 ubx_cfg_nav5_t;
typedef struct UBX_CFG_NAVX5 ubx_cfg_navx5_t;
typedef struct UBX_CFG_RATE ubx_cfg_rate_t;
typedef struct UBX_CFG_MSG ubx_cfg_msg_t;
typedef struct UBX_CFG_PRT ubx_cfg_prt_t;

View File

@ -2,7 +2,7 @@
******************************************************************************
* @addtogroup OpenPilotModules OpenPilot Modules
* @{
* @addtogroup GSPModule GPS Module
* @addtogroup GPSModule GPS Module
* @brief Support code for UBX AutoConfig
* @{
*
@ -317,6 +317,15 @@ static void config_nav(uint16_t *bytes_to_send)
*bytes_to_send = prepare_packet((UBXSentPacket_t *)&status->working_packet, UBX_CLASS_CFG, UBX_ID_CFG_NAV5, sizeof(ubx_cfg_nav5_t));
}
static void config_navx(uint16_t *bytes_to_send)
{
memset((uint8_t *)status->working_packet.buffer, 0, sizeof(UBXSentHeader_t) + sizeof(ubx_cfg_navx5_t));
status->working_packet.message.payload.cfg_navx5.useAOP = status->currentSettings.AssistNowAutonomous;
status->working_packet.message.payload.cfg_navx5.mask1 = 0x4000; // aop configuration
*bytes_to_send = prepare_packet((UBXSentPacket_t *)&status->working_packet, UBX_CLASS_CFG, UBX_ID_CFG_NAVX5, sizeof(ubx_cfg_navx5_t));
}
static void config_sbas(uint16_t *bytes_to_send)
{
@ -409,7 +418,6 @@ static void config_save(uint16_t *bytes_to_send)
*bytes_to_send = prepare_packet((UBXSentPacket_t *)&status->working_packet, UBX_CLASS_CFG, UBX_ID_CFG_CFG, sizeof(ubx_cfg_cfg_t));
}
static void configure(uint16_t *bytes_to_send)
{
switch (status->lastConfigSent) {
@ -423,6 +431,15 @@ static void configure(uint16_t *bytes_to_send)
break;
case LAST_CONFIG_SENT_START + 2:
if (ubxHwVersion > UBX_HW_VERSION_5) {
config_navx(bytes_to_send);
break;
} else {
// Skip and fall through to next step
status->lastConfigSent++;
}
case LAST_CONFIG_SENT_START + 3:
if (status->currentSettings.enableGLONASS || status->currentSettings.enableGPS) {
config_gnss(bytes_to_send);
break;
@ -432,7 +449,7 @@ static void configure(uint16_t *bytes_to_send)
}
// in the else case we must fall through because we must send something each time because successful send is tested externally
case LAST_CONFIG_SENT_START + 3:
case LAST_CONFIG_SENT_START + 4:
config_sbas(bytes_to_send);
break;

View File

@ -19,6 +19,8 @@
<field name="UbxSBASSats" units="" type="enum" elements="1" options="AutoScan,WAAS,EGNOS,MSAS,GAGAN,SDCM" defaultvalue="AutoScan" />
<!-- Ubx GNSS configuration, only applies to Ublox generation 7+ and concurrent GNSS only to generation 8 -->
<field name="UbxGNSSMode" units="" type="enum" elements="1" options="Default,GPS,GLONASS,GPS+GLONASS,GPS+BeiDou,GLONASS+BeiDou" defaultvalue="Default" />
<field name="UbxAssistNowAutonomous" units="" type="enum" elements="1" options="False,True" defaultvalue="True"
description="Enable or disable the AssistNow Autonomous feature"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
<telemetryflight acked="true" updatemode="onchange" period="0"/>