mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-06 21:54:15 +01:00
Merge branch 'corvuscorax/OP-946_refaktor_sensor_and_state' into corvuscorax/OP-947_stateestimator-module
This commit is contained in:
commit
d258caad3f
@ -64,8 +64,8 @@
|
|||||||
#include "gyrostate.h"
|
#include "gyrostate.h"
|
||||||
#include "gyrosensor.h"
|
#include "gyrosensor.h"
|
||||||
#include "homelocation.h"
|
#include "homelocation.h"
|
||||||
#include "magnetosensor.h"
|
#include "magsensor.h"
|
||||||
#include "magnetostate.h"
|
#include "magstate.h"
|
||||||
#include "positionstate.h"
|
#include "positionstate.h"
|
||||||
#include "ekfconfiguration.h"
|
#include "ekfconfiguration.h"
|
||||||
#include "ekfstatevariance.h"
|
#include "ekfstatevariance.h"
|
||||||
@ -125,7 +125,7 @@ static void settingsUpdatedCb(UAVObjEvent *objEv);
|
|||||||
|
|
||||||
static int32_t getNED(GPSPositionData *gpsPosition, float *NED);
|
static int32_t getNED(GPSPositionData *gpsPosition, float *NED);
|
||||||
|
|
||||||
static void magOffsetEstimation(MagnetoSensorData *mag);
|
static void magOffsetEstimation(MagSensorData *mag);
|
||||||
|
|
||||||
// check for invalid values
|
// check for invalid values
|
||||||
static inline bool invalid(float data)
|
static inline bool invalid(float data)
|
||||||
@ -167,8 +167,8 @@ int32_t AttitudeInitialize(void)
|
|||||||
GyroStateInitialize();
|
GyroStateInitialize();
|
||||||
AccelSensorInitialize();
|
AccelSensorInitialize();
|
||||||
AccelStateInitialize();
|
AccelStateInitialize();
|
||||||
MagnetoSensorInitialize();
|
MagSensorInitialize();
|
||||||
MagnetoStateInitialize();
|
MagStateInitialize();
|
||||||
AirspeedSensorInitialize();
|
AirspeedSensorInitialize();
|
||||||
AirspeedStateInitialize();
|
AirspeedStateInitialize();
|
||||||
BaroSensorInitialize();
|
BaroSensorInitialize();
|
||||||
@ -224,11 +224,13 @@ int32_t AttitudeStart(void)
|
|||||||
// Start main task
|
// Start main task
|
||||||
xTaskCreate(AttitudeTask, (signed char *)"Attitude", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &attitudeTaskHandle);
|
xTaskCreate(AttitudeTask, (signed char *)"Attitude", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &attitudeTaskHandle);
|
||||||
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_ATTITUDE, attitudeTaskHandle);
|
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_ATTITUDE, attitudeTaskHandle);
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_RegisterFlag(PIOS_WDG_ATTITUDE);
|
PIOS_WDG_RegisterFlag(PIOS_WDG_ATTITUDE);
|
||||||
|
#endif
|
||||||
|
|
||||||
GyroSensorConnectQueue(gyroQueue);
|
GyroSensorConnectQueue(gyroQueue);
|
||||||
AccelSensorConnectQueue(accelQueue);
|
AccelSensorConnectQueue(accelQueue);
|
||||||
MagnetoSensorConnectQueue(magQueue);
|
MagSensorConnectQueue(magQueue);
|
||||||
AirspeedSensorConnectQueue(airspeedQueue);
|
AirspeedSensorConnectQueue(airspeedQueue);
|
||||||
BaroSensorConnectQueue(baroQueue);
|
BaroSensorConnectQueue(baroQueue);
|
||||||
GPSPositionConnectQueue(gpsQueue);
|
GPSPositionConnectQueue(gpsQueue);
|
||||||
@ -282,7 +284,9 @@ static void AttitudeTask(__attribute__((unused)) void *parameters)
|
|||||||
initialization_required = true;
|
initialization_required = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE);
|
PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,10 +335,10 @@ static int32_t updateAttitudeComplementary(bool first_run)
|
|||||||
if (xQueueReceive(magQueue, &ev, 0 / portTICK_RATE_MS) != pdTRUE) {
|
if (xQueueReceive(magQueue, &ev, 0 / portTICK_RATE_MS) != pdTRUE) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
MagnetoSensorData magData;
|
MagSensorData magData;
|
||||||
MagnetoSensorGet(&magData);
|
MagSensorGet(&magData);
|
||||||
#else
|
#else
|
||||||
MagnetoSensorData magData;
|
MagSensorData magData;
|
||||||
magData.x = 100.0f;
|
magData.x = 100.0f;
|
||||||
magData.y = 0.0f;
|
magData.y = 0.0f;
|
||||||
magData.z = 0.0f;
|
magData.z = 0.0f;
|
||||||
@ -430,20 +434,20 @@ static int32_t updateAttitudeComplementary(bool first_run)
|
|||||||
// Rotate gravity to body frame and cross with accels
|
// Rotate gravity to body frame and cross with accels
|
||||||
float brot[3];
|
float brot[3];
|
||||||
float Rbe[3][3];
|
float Rbe[3][3];
|
||||||
MagnetoSensorData mag;
|
MagSensorData mag;
|
||||||
|
|
||||||
Quaternion2R(q, Rbe);
|
Quaternion2R(q, Rbe);
|
||||||
MagnetoSensorGet(&mag);
|
MagSensorGet(&mag);
|
||||||
|
|
||||||
// TODO: separate filter!
|
// TODO: separate filter!
|
||||||
if (revoCalibration.MagBiasNullingRate > 0) {
|
if (revoCalibration.MagBiasNullingRate > 0) {
|
||||||
magOffsetEstimation(&mag);
|
magOffsetEstimation(&mag);
|
||||||
}
|
}
|
||||||
MagnetoStateData mags;
|
MagStateData mags;
|
||||||
mags.x = mag.x;
|
mags.x = mag.x;
|
||||||
mags.y = mag.y;
|
mags.y = mag.y;
|
||||||
mags.z = mag.z;
|
mags.z = mag.z;
|
||||||
MagnetoStateSet(&mags);
|
MagStateSet(&mags);
|
||||||
|
|
||||||
// If the mag is producing bad data don't use it (normally bad calibration)
|
// If the mag is producing bad data don't use it (normally bad calibration)
|
||||||
if (!isnan(mag.x) && !isinf(mag.x) && !isnan(mag.y) && !isinf(mag.y) && !isnan(mag.z) && !isinf(mag.z)) {
|
if (!isnan(mag.x) && !isinf(mag.x) && !isnan(mag.y) && !isinf(mag.y) && !isnan(mag.z) && !isinf(mag.z)) {
|
||||||
@ -608,7 +612,7 @@ static int32_t updateAttitudeINSGPS(bool first_run, bool outdoor_mode)
|
|||||||
UAVObjEvent ev;
|
UAVObjEvent ev;
|
||||||
GyroSensorData gyroSensorData;
|
GyroSensorData gyroSensorData;
|
||||||
AccelSensorData accelSensorData;
|
AccelSensorData accelSensorData;
|
||||||
MagnetoStateData magData;
|
MagStateData magData;
|
||||||
AirspeedSensorData airspeedData;
|
AirspeedSensorData airspeedData;
|
||||||
BaroSensorData baroData;
|
BaroSensorData baroData;
|
||||||
GPSPositionData gpsData;
|
GPSPositionData gpsData;
|
||||||
@ -690,17 +694,17 @@ static int32_t updateAttitudeINSGPS(bool first_run, bool outdoor_mode)
|
|||||||
AccelSensorGet(&accelSensorData);
|
AccelSensorGet(&accelSensorData);
|
||||||
// TODO: separate filter!
|
// TODO: separate filter!
|
||||||
if (mag_updated) {
|
if (mag_updated) {
|
||||||
MagnetoSensorData mags;
|
MagSensorData mags;
|
||||||
MagnetoSensorGet(&mags);
|
MagSensorGet(&mags);
|
||||||
if (revoCalibration.MagBiasNullingRate > 0) {
|
if (revoCalibration.MagBiasNullingRate > 0) {
|
||||||
magOffsetEstimation(&mags);
|
magOffsetEstimation(&mags);
|
||||||
}
|
}
|
||||||
magData.x = mags.x;
|
magData.x = mags.x;
|
||||||
magData.y = mags.y;
|
magData.y = mags.y;
|
||||||
magData.z = mags.z;
|
magData.z = mags.z;
|
||||||
MagnetoStateSet(&magData);
|
MagStateSet(&magData);
|
||||||
}
|
}
|
||||||
MagnetoStateGet(&magData);
|
MagStateGet(&magData);
|
||||||
|
|
||||||
BaroSensorGet(&baroData);
|
BaroSensorGet(&baroData);
|
||||||
AirspeedSensorGet(&airspeedData);
|
AirspeedSensorGet(&airspeedData);
|
||||||
@ -856,7 +860,7 @@ static int32_t updateAttitudeINSGPS(bool first_run, bool outdoor_mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// xQueueReceive(magQueue, &ev, 100 / portTICK_RATE_MS);
|
// xQueueReceive(magQueue, &ev, 100 / portTICK_RATE_MS);
|
||||||
// MagnetoSensorGet(&magData);
|
// MagSensorGet(&magData);
|
||||||
|
|
||||||
AttitudeStateData attitudeState;
|
AttitudeStateData attitudeState;
|
||||||
AttitudeStateGet(&attitudeState);
|
AttitudeStateGet(&attitudeState);
|
||||||
@ -1158,10 +1162,10 @@ static void settingsUpdatedCb(UAVObjEvent *ev)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform an update of the @ref MagBias based on
|
* Perform an update of the @ref MagBias based on
|
||||||
* Magnetometer Offset Cancellation: Theory and Implementation,
|
* Magmeter Offset Cancellation: Theory and Implementation,
|
||||||
* revisited William Premerlani, October 14, 2011
|
* revisited William Premerlani, October 14, 2011
|
||||||
*/
|
*/
|
||||||
static void magOffsetEstimation(MagnetoSensorData *mag)
|
static void magOffsetEstimation(MagSensorData *mag)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
// Constants, to possibly go into a UAVO
|
// Constants, to possibly go into a UAVO
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
#include "hwsettings.h"
|
#include "hwsettings.h"
|
||||||
#include "magbaro.h"
|
#include "magbaro.h"
|
||||||
#include "barosensor.h" // object that will be updated by the module
|
#include "barosensor.h" // object that will be updated by the module
|
||||||
#include "magnetosensor.h"
|
#include "magsensor.h"
|
||||||
#include "taskinfo.h"
|
#include "taskinfo.h"
|
||||||
|
|
||||||
// Private constants
|
// Private constants
|
||||||
@ -109,7 +109,7 @@ int32_t MagBaroInitialize()
|
|||||||
|
|
||||||
if (magbaroEnabled) {
|
if (magbaroEnabled) {
|
||||||
#if defined(PIOS_INCLUDE_HMC5883)
|
#if defined(PIOS_INCLUDE_HMC5883)
|
||||||
MagnetoSensorInitialize();
|
MagSensorInitialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PIOS_INCLUDE_BMP085)
|
#if defined(PIOS_INCLUDE_BMP085)
|
||||||
@ -149,7 +149,7 @@ static void magbaroTask(__attribute__((unused)) void *parameters)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PIOS_INCLUDE_HMC5883)
|
#if defined(PIOS_INCLUDE_HMC5883)
|
||||||
MagnetoSensorData mag;
|
MagSensorData mag;
|
||||||
PIOS_HMC5883_Init(&pios_hmc5883_cfg);
|
PIOS_HMC5883_Init(&pios_hmc5883_cfg);
|
||||||
uint32_t mag_update_time = PIOS_DELAY_GetRaw();
|
uint32_t mag_update_time = PIOS_DELAY_GetRaw();
|
||||||
#endif
|
#endif
|
||||||
@ -207,7 +207,7 @@ static void magbaroTask(__attribute__((unused)) void *parameters)
|
|||||||
mag.x = mags[0];
|
mag.x = mags[0];
|
||||||
mag.y = mags[1];
|
mag.y = mags[1];
|
||||||
mag.z = mags[2];
|
mag.z = mags[2];
|
||||||
MagnetoSensorSet(&mag);
|
MagSensorSet(&mag);
|
||||||
mag_update_time = PIOS_DELAY_GetRaw();
|
mag_update_time = PIOS_DELAY_GetRaw();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* @{
|
* @{
|
||||||
* @addtogroup Sensors
|
* @addtogroup Sensors
|
||||||
* @brief Acquires sensor data
|
* @brief Acquires sensor data
|
||||||
* Specifically updates the the @ref GyroSensor, @ref AccelSensor, and @ref MagnetoSensor objects
|
* Specifically updates the the @ref GyroSensor, @ref AccelSensor, and @ref MagSensor objects
|
||||||
* @{
|
* @{
|
||||||
*
|
*
|
||||||
* @file sensors.c
|
* @file sensors.c
|
||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Input objects: None, takes sensor data via pios
|
* Input objects: None, takes sensor data via pios
|
||||||
* Output objects: @ref GyroSensor @ref AccelSensor @ref MagnetoSensor
|
* Output objects: @ref GyroSensor @ref AccelSensor @ref MagSensor
|
||||||
*
|
*
|
||||||
* The module executes in its own thread.
|
* The module executes in its own thread.
|
||||||
*
|
*
|
||||||
@ -49,7 +49,7 @@
|
|||||||
#include <openpilot.h>
|
#include <openpilot.h>
|
||||||
|
|
||||||
#include <homelocation.h>
|
#include <homelocation.h>
|
||||||
#include <magnetosensor.h>
|
#include <magsensor.h>
|
||||||
#include <accelsensor.h>
|
#include <accelsensor.h>
|
||||||
#include <gyrosensor.h>
|
#include <gyrosensor.h>
|
||||||
#include <attitudestate.h>
|
#include <attitudestate.h>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
// Private functions
|
// Private functions
|
||||||
static void SensorsTask(void *parameters);
|
static void SensorsTask(void *parameters);
|
||||||
static void settingsUpdatedCb(UAVObjEvent *objEv);
|
static void settingsUpdatedCb(UAVObjEvent *objEv);
|
||||||
// static void magOffsetEstimation(MagnetoSensorData *mag);
|
// static void magOffsetEstimation(MagSensorData *mag);
|
||||||
|
|
||||||
// Private variables
|
// Private variables
|
||||||
static xTaskHandle sensorsTaskHandle;
|
static xTaskHandle sensorsTaskHandle;
|
||||||
@ -110,7 +110,7 @@ int32_t SensorsInitialize(void)
|
|||||||
{
|
{
|
||||||
GyroSensorInitialize();
|
GyroSensorInitialize();
|
||||||
AccelSensorInitialize();
|
AccelSensorInitialize();
|
||||||
MagnetoSensorInitialize();
|
MagSensorInitialize();
|
||||||
RevoCalibrationInitialize();
|
RevoCalibrationInitialize();
|
||||||
AttitudeSettingsInitialize();
|
AttitudeSettingsInitialize();
|
||||||
|
|
||||||
@ -131,7 +131,9 @@ int32_t SensorsStart(void)
|
|||||||
// Start main task
|
// Start main task
|
||||||
xTaskCreate(SensorsTask, (signed char *)"Sensors", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &sensorsTaskHandle);
|
xTaskCreate(SensorsTask, (signed char *)"Sensors", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &sensorsTaskHandle);
|
||||||
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_SENSORS, sensorsTaskHandle);
|
PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_SENSORS, sensorsTaskHandle);
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_RegisterFlag(PIOS_WDG_SENSORS);
|
PIOS_WDG_RegisterFlag(PIOS_WDG_SENSORS);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -201,7 +203,9 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
|
|||||||
if (accel_test < 0 || gyro_test < 0 || mag_test < 0) {
|
if (accel_test < 0 || gyro_test < 0 || mag_test < 0) {
|
||||||
AlarmsSet(SYSTEMALARMS_ALARM_SENSORS, SYSTEMALARMS_ALARM_CRITICAL);
|
AlarmsSet(SYSTEMALARMS_ALARM_SENSORS, SYSTEMALARMS_ALARM_CRITICAL);
|
||||||
while (1) {
|
while (1) {
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
||||||
|
#endif
|
||||||
vTaskDelay(10);
|
vTaskDelay(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -216,7 +220,9 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
|
|||||||
timeval = PIOS_DELAY_GetRaw();
|
timeval = PIOS_DELAY_GetRaw();
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
||||||
|
#endif
|
||||||
lastSysTime = xTaskGetTickCount();
|
lastSysTime = xTaskGetTickCount();
|
||||||
vTaskDelayUntil(&lastSysTime, SENSOR_PERIOD / portTICK_RATE_MS);
|
vTaskDelayUntil(&lastSysTime, SENSOR_PERIOD / portTICK_RATE_MS);
|
||||||
AlarmsSet(SYSTEMALARMS_ALARM_SENSORS, SYSTEMALARMS_ALARM_CRITICAL);
|
AlarmsSet(SYSTEMALARMS_ALARM_SENSORS, SYSTEMALARMS_ALARM_CRITICAL);
|
||||||
@ -377,7 +383,7 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
|
|||||||
// and make it average zero (weakly)
|
// and make it average zero (weakly)
|
||||||
|
|
||||||
#if defined(PIOS_INCLUDE_HMC5883)
|
#if defined(PIOS_INCLUDE_HMC5883)
|
||||||
MagnetoSensorData mag;
|
MagSensorData mag;
|
||||||
if (PIOS_HMC5883_NewDataAvailable() || PIOS_DELAY_DiffuS(mag_update_time) > 150000) {
|
if (PIOS_HMC5883_NewDataAvailable() || PIOS_DELAY_DiffuS(mag_update_time) > 150000) {
|
||||||
int16_t values[3];
|
int16_t values[3];
|
||||||
PIOS_HMC5883_ReadMag(values);
|
PIOS_HMC5883_ReadMag(values);
|
||||||
@ -396,12 +402,14 @@ static void SensorsTask(__attribute__((unused)) void *parameters)
|
|||||||
mag.z = mags[2];
|
mag.z = mags[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
MagnetoSensorSet(&mag);
|
MagSensorSet(&mag);
|
||||||
mag_update_time = PIOS_DELAY_GetRaw();
|
mag_update_time = PIOS_DELAY_GetRaw();
|
||||||
}
|
}
|
||||||
#endif /* if defined(PIOS_INCLUDE_HMC5883) */
|
#endif /* if defined(PIOS_INCLUDE_HMC5883) */
|
||||||
|
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
||||||
|
#endif
|
||||||
|
|
||||||
lastSysTime = xTaskGetTickCount();
|
lastSysTime = xTaskGetTickCount();
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* @{
|
* @{
|
||||||
* @addtogroup Sensors
|
* @addtogroup Sensors
|
||||||
* @brief Acquires sensor data
|
* @brief Acquires sensor data
|
||||||
* Specifically updates the the @ref GyroSensor, @ref AccelSensor, and @ref MagnetoSensor objects
|
* Specifically updates the the @ref GyroSensor, @ref AccelSensor, and @ref MagSensor objects
|
||||||
* @{
|
* @{
|
||||||
*
|
*
|
||||||
* @file sensors.c
|
* @file sensors.c
|
||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Input objects: None, takes sensor data via pios
|
* Input objects: None, takes sensor data via pios
|
||||||
* Output objects: @ref GyroSensor @ref AccelSensor @ref MagnetoSensor
|
* Output objects: @ref GyroSensor @ref AccelSensor @ref MagSensor
|
||||||
*
|
*
|
||||||
* The module executes in its own thread.
|
* The module executes in its own thread.
|
||||||
*
|
*
|
||||||
@ -113,7 +113,7 @@ int32_t SensorsInitialize(void)
|
|||||||
// GyrosBiasInitialize();
|
// GyrosBiasInitialize();
|
||||||
GPSPositionInitialize();
|
GPSPositionInitialize();
|
||||||
GPSVelocityInitialize();
|
GPSVelocityInitialize();
|
||||||
MagnetoSensorInitialize();
|
MagSensorInitialize();
|
||||||
MagBiasInitialize();
|
MagBiasInitialize();
|
||||||
RevoCalibrationInitialize();
|
RevoCalibrationInitialize();
|
||||||
|
|
||||||
@ -252,11 +252,11 @@ static void simulateConstant()
|
|||||||
|
|
||||||
// Because most crafts wont get enough information from gravity to zero yaw gyro, we try
|
// Because most crafts wont get enough information from gravity to zero yaw gyro, we try
|
||||||
// and make it average zero (weakly)
|
// and make it average zero (weakly)
|
||||||
MagnetoSensorData mag;
|
MagSensorData mag;
|
||||||
mag.x = 400;
|
mag.x = 400;
|
||||||
mag.y = 0;
|
mag.y = 0;
|
||||||
mag.z = 800;
|
mag.z = 800;
|
||||||
MagnetoSensorSet(&mag);
|
MagSensorSet(&mag);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void simulateModelAgnostic()
|
static void simulateModelAgnostic()
|
||||||
@ -314,11 +314,11 @@ static void simulateModelAgnostic()
|
|||||||
|
|
||||||
// Because most crafts wont get enough information from gravity to zero yaw gyro, we try
|
// Because most crafts wont get enough information from gravity to zero yaw gyro, we try
|
||||||
// and make it average zero (weakly)
|
// and make it average zero (weakly)
|
||||||
MagnetoSensorData mag;
|
MagSensorData mag;
|
||||||
mag.x = 400;
|
mag.x = 400;
|
||||||
mag.y = 0;
|
mag.y = 0;
|
||||||
mag.z = 800;
|
mag.z = 800;
|
||||||
MagnetoSensorSet(&mag);
|
MagSensorSet(&mag);
|
||||||
}
|
}
|
||||||
|
|
||||||
float thrustToDegs = 50;
|
float thrustToDegs = 50;
|
||||||
@ -528,12 +528,12 @@ static void simulateModelQuadcopter()
|
|||||||
// Update mag periodically
|
// Update mag periodically
|
||||||
static uint32_t last_mag_time = 0;
|
static uint32_t last_mag_time = 0;
|
||||||
if (PIOS_DELAY_DiffuS(last_mag_time) / 1.0e6 > MAG_PERIOD) {
|
if (PIOS_DELAY_DiffuS(last_mag_time) / 1.0e6 > MAG_PERIOD) {
|
||||||
MagnetoSensorData mag;
|
MagSensorData mag;
|
||||||
mag.x = homeLocation.Be[0] * Rbe[0][0] + homeLocation.Be[1] * Rbe[0][1] + homeLocation.Be[2] * Rbe[0][2];
|
mag.x = homeLocation.Be[0] * Rbe[0][0] + homeLocation.Be[1] * Rbe[0][1] + homeLocation.Be[2] * Rbe[0][2];
|
||||||
mag.y = homeLocation.Be[0] * Rbe[1][0] + homeLocation.Be[1] * Rbe[1][1] + homeLocation.Be[2] * Rbe[1][2];
|
mag.y = homeLocation.Be[0] * Rbe[1][0] + homeLocation.Be[1] * Rbe[1][1] + homeLocation.Be[2] * Rbe[1][2];
|
||||||
mag.z = homeLocation.Be[0] * Rbe[2][0] + homeLocation.Be[1] * Rbe[2][1] + homeLocation.Be[2] * Rbe[2][2];
|
mag.z = homeLocation.Be[0] * Rbe[2][0] + homeLocation.Be[1] * Rbe[2][1] + homeLocation.Be[2] * Rbe[2][2];
|
||||||
|
|
||||||
MagnetoSensorSet(&mag);
|
MagSensorSet(&mag);
|
||||||
last_mag_time = PIOS_DELAY_GetRaw();
|
last_mag_time = PIOS_DELAY_GetRaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -811,11 +811,11 @@ static void simulateModelAirplane()
|
|||||||
// Update mag periodically
|
// Update mag periodically
|
||||||
static uint32_t last_mag_time = 0;
|
static uint32_t last_mag_time = 0;
|
||||||
if (PIOS_DELAY_DiffuS(last_mag_time) / 1.0e6 > MAG_PERIOD) {
|
if (PIOS_DELAY_DiffuS(last_mag_time) / 1.0e6 > MAG_PERIOD) {
|
||||||
MagnetoSensorData mag;
|
MagSensorData mag;
|
||||||
mag.x = 100 + homeLocation.Be[0] * Rbe[0][0] + homeLocation.Be[1] * Rbe[0][1] + homeLocation.Be[2] * Rbe[0][2];
|
mag.x = 100 + homeLocation.Be[0] * Rbe[0][0] + homeLocation.Be[1] * Rbe[0][1] + homeLocation.Be[2] * Rbe[0][2];
|
||||||
mag.y = 100 + homeLocation.Be[0] * Rbe[1][0] + homeLocation.Be[1] * Rbe[1][1] + homeLocation.Be[2] * Rbe[1][2];
|
mag.y = 100 + homeLocation.Be[0] * Rbe[1][0] + homeLocation.Be[1] * Rbe[1][1] + homeLocation.Be[2] * Rbe[1][2];
|
||||||
mag.z = 100 + homeLocation.Be[0] * Rbe[2][0] + homeLocation.Be[1] * Rbe[2][1] + homeLocation.Be[2] * Rbe[2][2];
|
mag.z = 100 + homeLocation.Be[0] * Rbe[2][0] + homeLocation.Be[1] * Rbe[2][1] + homeLocation.Be[2] * Rbe[2][2];
|
||||||
MagnetoSensorSet(&mag);
|
MagSensorSet(&mag);
|
||||||
last_mag_time = PIOS_DELAY_GetRaw();
|
last_mag_time = PIOS_DELAY_GetRaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ ifndef TESTAPP
|
|||||||
SRC += $(OPUAVSYNTHDIR)/gpstime.c
|
SRC += $(OPUAVSYNTHDIR)/gpstime.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/osdsettings.c
|
SRC += $(OPUAVSYNTHDIR)/osdsettings.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/barosensor.c
|
SRC += $(OPUAVSYNTHDIR)/barosensor.c
|
||||||
SRC += $(OPUAVSYNTHDIR)/magnetosensor.c
|
SRC += $(OPUAVSYNTHDIR)/magsensor.c
|
||||||
else
|
else
|
||||||
## Test Code
|
## Test Code
|
||||||
SRC += $(OPTESTS)/test_common.c
|
SRC += $(OPTESTS)/test_common.c
|
||||||
|
@ -30,8 +30,8 @@ UAVOBJSRCFILENAMES += gyrostate
|
|||||||
UAVOBJSRCFILENAMES += gyrosensor
|
UAVOBJSRCFILENAMES += gyrosensor
|
||||||
UAVOBJSRCFILENAMES += accelstate
|
UAVOBJSRCFILENAMES += accelstate
|
||||||
UAVOBJSRCFILENAMES += accelsensor
|
UAVOBJSRCFILENAMES += accelsensor
|
||||||
UAVOBJSRCFILENAMES += magnetosensor
|
UAVOBJSRCFILENAMES += magsensor
|
||||||
UAVOBJSRCFILENAMES += magnetostate
|
UAVOBJSRCFILENAMES += magstate
|
||||||
UAVOBJSRCFILENAMES += barosensor
|
UAVOBJSRCFILENAMES += barosensor
|
||||||
UAVOBJSRCFILENAMES += airspeedsensor
|
UAVOBJSRCFILENAMES += airspeedsensor
|
||||||
UAVOBJSRCFILENAMES += airspeedsettings
|
UAVOBJSRCFILENAMES += airspeedsettings
|
||||||
|
@ -391,7 +391,9 @@ void PIOS_Board_Init(void)
|
|||||||
PIOS_IAP_WriteBootCmd(1, 0);
|
PIOS_IAP_WriteBootCmd(1, 0);
|
||||||
PIOS_IAP_WriteBootCmd(2, 0);
|
PIOS_IAP_WriteBootCmd(2, 0);
|
||||||
}
|
}
|
||||||
|
#ifdef PIOS_INCLUDE_WDG
|
||||||
PIOS_WDG_Init();
|
PIOS_WDG_Init();
|
||||||
|
#endif
|
||||||
/* Initialize UAVObject libraries */
|
/* Initialize UAVObject libraries */
|
||||||
EventDispatcherInitialize();
|
EventDispatcherInitialize();
|
||||||
UAVObjInitialize();
|
UAVObjInitialize();
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include <barosensor.h>
|
#include <barosensor.h>
|
||||||
#include <gpsposition.h>
|
#include <gpsposition.h>
|
||||||
#include <gyrosensor.h>
|
#include <gyrosensor.h>
|
||||||
#include <magnetosensor.h>
|
#include <magsensor.h>
|
||||||
#include <manualcontrolsettings.h>
|
#include <manualcontrolsettings.h>
|
||||||
|
|
||||||
void Stack_Change() {}
|
void Stack_Change() {}
|
||||||
@ -138,7 +138,7 @@ void PIOS_Board_Init(void)
|
|||||||
|
|
||||||
AccelSensorInitialize();
|
AccelSensorInitialize();
|
||||||
BaroSensorInitialize();
|
BaroSensorInitialize();
|
||||||
MagnetoSensorInitialize();
|
MagSensorInitialize();
|
||||||
GPSPositionInitialize();
|
GPSPositionInitialize();
|
||||||
GyroSensorInitialize();
|
GyroSensorInitialize();
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ UAVOBJSRCFILENAMES += gyrostate
|
|||||||
UAVOBJSRCFILENAMES += gyrosensor
|
UAVOBJSRCFILENAMES += gyrosensor
|
||||||
UAVOBJSRCFILENAMES += accelstate
|
UAVOBJSRCFILENAMES += accelstate
|
||||||
UAVOBJSRCFILENAMES += accelsensor
|
UAVOBJSRCFILENAMES += accelsensor
|
||||||
UAVOBJSRCFILENAMES += magnetostate
|
UAVOBJSRCFILENAMES += magstate
|
||||||
UAVOBJSRCFILENAMES += magnetosensor
|
UAVOBJSRCFILENAMES += magsensor
|
||||||
UAVOBJSRCFILENAMES += barosensor
|
UAVOBJSRCFILENAMES += barosensor
|
||||||
UAVOBJSRCFILENAMES += airspeedsensor
|
UAVOBJSRCFILENAMES += airspeedsensor
|
||||||
UAVOBJSRCFILENAMES += airspeedsettings
|
UAVOBJSRCFILENAMES += airspeedsettings
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include <barosensor.h>
|
#include <barosensor.h>
|
||||||
#include <gpsposition.h>
|
#include <gpsposition.h>
|
||||||
#include <gyrosensor.h>
|
#include <gyrosensor.h>
|
||||||
#include <magnetosensor.h>
|
#include <magsensor.h>
|
||||||
#include <manualcontrolsettings.h>
|
#include <manualcontrolsettings.h>
|
||||||
|
|
||||||
void Stack_Change() {}
|
void Stack_Change() {}
|
||||||
@ -138,7 +138,7 @@ void PIOS_Board_Init(void)
|
|||||||
|
|
||||||
AccelSensorInitialize();
|
AccelSensorInitialize();
|
||||||
BaroSensorInitialize();
|
BaroSensorInitialize();
|
||||||
MagnetoSensorInitialize();
|
MagSensorInitialize();
|
||||||
GPSPositionInitialize();
|
GPSPositionInitialize();
|
||||||
GyroStatInitialize();
|
GyroStatInitialize();
|
||||||
GyroSensorInitialize();
|
GyroSensorInitialize();
|
||||||
|
@ -35,8 +35,8 @@ UAVOBJSRCFILENAMES += gyrostate
|
|||||||
UAVOBJSRCFILENAMES += gyrosensor
|
UAVOBJSRCFILENAMES += gyrosensor
|
||||||
UAVOBJSRCFILENAMES += accelstate
|
UAVOBJSRCFILENAMES += accelstate
|
||||||
UAVOBJSRCFILENAMES += accelsensor
|
UAVOBJSRCFILENAMES += accelsensor
|
||||||
UAVOBJSRCFILENAMES += magnetosensor
|
UAVOBJSRCFILENAMES += magsensor
|
||||||
UAVOBJSRCFILENAMES += magnetostate
|
UAVOBJSRCFILENAMES += magstate
|
||||||
UAVOBJSRCFILENAMES += barosensor
|
UAVOBJSRCFILENAMES += barosensor
|
||||||
UAVOBJSRCFILENAMES += barostate
|
UAVOBJSRCFILENAMES += barostate
|
||||||
UAVOBJSRCFILENAMES += airspeedsensor
|
UAVOBJSRCFILENAMES += airspeedsensor
|
||||||
|
@ -69,7 +69,3 @@ const struct fw_version_info fw_version_blob __attribute__((used)) __attribute__
|
|||||||
.sha1sum = { ${SHA1} },
|
.sha1sum = { ${SHA1} },
|
||||||
.uavosha1 = { ${UAVOSHA1} },
|
.uavosha1 = { ${UAVOSHA1} },
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
@ -2233,7 +2233,7 @@
|
|||||||
<color>4294901760</color>
|
<color>4294901760</color>
|
||||||
<mathFunction>None</mathFunction>
|
<mathFunction>None</mathFunction>
|
||||||
<uavField>x</uavField>
|
<uavField>x</uavField>
|
||||||
<uavObject>MagnetoState</uavObject>
|
<uavObject>MagState</uavObject>
|
||||||
<yMaximum>6.92916505601691e-310</yMaximum>
|
<yMaximum>6.92916505601691e-310</yMaximum>
|
||||||
<yMeanSamples>1</yMeanSamples>
|
<yMeanSamples>1</yMeanSamples>
|
||||||
<yMinimum>3.86203233966055e-312</yMinimum>
|
<yMinimum>3.86203233966055e-312</yMinimum>
|
||||||
@ -2243,7 +2243,7 @@
|
|||||||
<color>4283782655</color>
|
<color>4283782655</color>
|
||||||
<mathFunction>None</mathFunction>
|
<mathFunction>None</mathFunction>
|
||||||
<uavField>y</uavField>
|
<uavField>y</uavField>
|
||||||
<uavObject>MagnetoState</uavObject>
|
<uavObject>MagState</uavObject>
|
||||||
<yMaximum>1.72723371101889e-77</yMaximum>
|
<yMaximum>1.72723371101889e-77</yMaximum>
|
||||||
<yMeanSamples>1</yMeanSamples>
|
<yMeanSamples>1</yMeanSamples>
|
||||||
<yMinimum>-1</yMinimum>
|
<yMinimum>-1</yMinimum>
|
||||||
@ -2253,7 +2253,7 @@
|
|||||||
<color>4283804160</color>
|
<color>4283804160</color>
|
||||||
<mathFunction>None</mathFunction>
|
<mathFunction>None</mathFunction>
|
||||||
<uavField>z</uavField>
|
<uavField>z</uavField>
|
||||||
<uavObject>MagnetoState</uavObject>
|
<uavObject>MagState</uavObject>
|
||||||
<yMaximum>1.72723371102028e-77</yMaximum>
|
<yMaximum>1.72723371102028e-77</yMaximum>
|
||||||
<yMeanSamples>1</yMeanSamples>
|
<yMeanSamples>1</yMeanSamples>
|
||||||
<yMinimum>7.21478569792807e-313</yMinimum>
|
<yMinimum>7.21478569792807e-313</yMinimum>
|
||||||
|
@ -2264,7 +2264,7 @@
|
|||||||
<color>4294901760</color>
|
<color>4294901760</color>
|
||||||
<mathFunction>None</mathFunction>
|
<mathFunction>None</mathFunction>
|
||||||
<uavField>x</uavField>
|
<uavField>x</uavField>
|
||||||
<uavObject>MagnetoState</uavObject>
|
<uavObject>MagState</uavObject>
|
||||||
<yMaximum>0</yMaximum>
|
<yMaximum>0</yMaximum>
|
||||||
<yMeanSamples>1</yMeanSamples>
|
<yMeanSamples>1</yMeanSamples>
|
||||||
<yMinimum>0</yMinimum>
|
<yMinimum>0</yMinimum>
|
||||||
@ -2274,7 +2274,7 @@
|
|||||||
<color>4283782655</color>
|
<color>4283782655</color>
|
||||||
<mathFunction>None</mathFunction>
|
<mathFunction>None</mathFunction>
|
||||||
<uavField>y</uavField>
|
<uavField>y</uavField>
|
||||||
<uavObject>MagnetoState</uavObject>
|
<uavObject>MagState</uavObject>
|
||||||
<yMaximum>0</yMaximum>
|
<yMaximum>0</yMaximum>
|
||||||
<yMeanSamples>1</yMeanSamples>
|
<yMeanSamples>1</yMeanSamples>
|
||||||
<yMinimum>0</yMinimum>
|
<yMinimum>0</yMinimum>
|
||||||
@ -2284,7 +2284,7 @@
|
|||||||
<color>4283804160</color>
|
<color>4283804160</color>
|
||||||
<mathFunction>None</mathFunction>
|
<mathFunction>None</mathFunction>
|
||||||
<uavField>z</uavField>
|
<uavField>z</uavField>
|
||||||
<uavObject>MagnetoState</uavObject>
|
<uavObject>MagState</uavObject>
|
||||||
<yMaximum>0</yMaximum>
|
<yMaximum>0</yMaximum>
|
||||||
<yMeanSamples>1</yMeanSamples>
|
<yMeanSamples>1</yMeanSamples>
|
||||||
<yMinimum>0</yMinimum>
|
<yMinimum>0</yMinimum>
|
||||||
|
@ -2242,7 +2242,7 @@
|
|||||||
<color>4294901760</color>
|
<color>4294901760</color>
|
||||||
<mathFunction>None</mathFunction>
|
<mathFunction>None</mathFunction>
|
||||||
<uavField>x</uavField>
|
<uavField>x</uavField>
|
||||||
<uavObject>MagnetoState</uavObject>
|
<uavObject>MagState</uavObject>
|
||||||
<yMaximum>0</yMaximum>
|
<yMaximum>0</yMaximum>
|
||||||
<yMeanSamples>1</yMeanSamples>
|
<yMeanSamples>1</yMeanSamples>
|
||||||
<yMinimum>0</yMinimum>
|
<yMinimum>0</yMinimum>
|
||||||
@ -2252,7 +2252,7 @@
|
|||||||
<color>4283782655</color>
|
<color>4283782655</color>
|
||||||
<mathFunction>None</mathFunction>
|
<mathFunction>None</mathFunction>
|
||||||
<uavField>y</uavField>
|
<uavField>y</uavField>
|
||||||
<uavObject>MagnetoState</uavObject>
|
<uavObject>MagState</uavObject>
|
||||||
<yMaximum>0</yMaximum>
|
<yMaximum>0</yMaximum>
|
||||||
<yMeanSamples>1</yMeanSamples>
|
<yMeanSamples>1</yMeanSamples>
|
||||||
<yMinimum>0</yMinimum>
|
<yMinimum>0</yMinimum>
|
||||||
@ -2262,7 +2262,7 @@
|
|||||||
<color>4283804160</color>
|
<color>4283804160</color>
|
||||||
<mathFunction>None</mathFunction>
|
<mathFunction>None</mathFunction>
|
||||||
<uavField>z</uavField>
|
<uavField>z</uavField>
|
||||||
<uavObject>MagnetoState</uavObject>
|
<uavObject>MagState</uavObject>
|
||||||
<yMaximum>0</yMaximum>
|
<yMaximum>0</yMaximum>
|
||||||
<yMeanSamples>1</yMeanSamples>
|
<yMeanSamples>1</yMeanSamples>
|
||||||
<yMinimum>0</yMinimum>
|
<yMinimum>0</yMinimum>
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#include <homelocation.h>
|
#include <homelocation.h>
|
||||||
#include <accelstate.h>
|
#include <accelstate.h>
|
||||||
#include <gyrostate.h>
|
#include <gyrostate.h>
|
||||||
#include <magnetostate.h>
|
#include <magstate.h>
|
||||||
|
|
||||||
#define GRAVITY 9.81f
|
#define GRAVITY 9.81f
|
||||||
#include "assertions.h"
|
#include "assertions.h"
|
||||||
@ -585,10 +585,10 @@ void ConfigRevoWidget::doStartSixPointCalibration()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Need to get as many mag updates as possible */
|
/* Need to get as many mag updates as possible */
|
||||||
MagnetoState *mag = MagnetoState::GetInstance(getObjectManager());
|
MagState *mag = MagState::GetInstance(getObjectManager());
|
||||||
Q_ASSERT(mag);
|
Q_ASSERT(mag);
|
||||||
initialMagnetoStateMdata = mag->getMetadata();
|
initialMagStateMdata = mag->getMetadata();
|
||||||
mdata = initialMagnetoStateMdata;
|
mdata = initialMagStateMdata;
|
||||||
UAVObject::SetFlightTelemetryUpdateMode(mdata, UAVObject::UPDATEMODE_PERIODIC);
|
UAVObject::SetFlightTelemetryUpdateMode(mdata, UAVObject::UPDATEMODE_PERIODIC);
|
||||||
mdata.flightTelemetryUpdatePeriod = 100;
|
mdata.flightTelemetryUpdatePeriod = 100;
|
||||||
mag->setMetadata(mdata);
|
mag->setMetadata(mdata);
|
||||||
@ -624,7 +624,7 @@ void ConfigRevoWidget::savePositionData()
|
|||||||
|
|
||||||
AccelState *accelState = AccelState::GetInstance(getObjectManager());
|
AccelState *accelState = AccelState::GetInstance(getObjectManager());
|
||||||
Q_ASSERT(accelState);
|
Q_ASSERT(accelState);
|
||||||
MagnetoState *mag = MagnetoState::GetInstance(getObjectManager());
|
MagState *mag = MagState::GetInstance(getObjectManager());
|
||||||
Q_ASSERT(mag);
|
Q_ASSERT(mag);
|
||||||
|
|
||||||
connect(accelState, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(doGetSixPointCalibrationMeasurement(UAVObject *)));
|
connect(accelState, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(doGetSixPointCalibrationMeasurement(UAVObject *)));
|
||||||
@ -653,10 +653,10 @@ void ConfigRevoWidget::doGetSixPointCalibrationMeasurement(UAVObject *obj)
|
|||||||
accel_accum_y.append(accelStateData.y);
|
accel_accum_y.append(accelStateData.y);
|
||||||
accel_accum_z.append(accelStateData.z);
|
accel_accum_z.append(accelStateData.z);
|
||||||
#endif
|
#endif
|
||||||
} else if (obj->getObjID() == MagnetoState::OBJID) {
|
} else if (obj->getObjID() == MagState::OBJID) {
|
||||||
MagnetoState *mag = MagnetoState::GetInstance(getObjectManager());
|
MagState *mag = MagState::GetInstance(getObjectManager());
|
||||||
Q_ASSERT(mag);
|
Q_ASSERT(mag);
|
||||||
MagnetoState::DataFields magData = mag->getData();
|
MagState::DataFields magData = mag->getData();
|
||||||
mag_accum_x.append(magData.x);
|
mag_accum_x.append(magData.x);
|
||||||
mag_accum_y.append(magData.y);
|
mag_accum_y.append(magData.y);
|
||||||
mag_accum_z.append(magData.z);
|
mag_accum_z.append(magData.z);
|
||||||
@ -685,7 +685,7 @@ void ConfigRevoWidget::doGetSixPointCalibrationMeasurement(UAVObject *obj)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Store the mean for this position for the mag
|
// Store the mean for this position for the mag
|
||||||
MagnetoState *mag = MagnetoState::GetInstance(getObjectManager());
|
MagState *mag = MagState::GetInstance(getObjectManager());
|
||||||
Q_ASSERT(mag);
|
Q_ASSERT(mag);
|
||||||
disconnect(mag, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(doGetSixPointCalibrationMeasurement(UAVObject *)));
|
disconnect(mag, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(doGetSixPointCalibrationMeasurement(UAVObject *)));
|
||||||
mag_data_x[position] = listMean(mag_accum_x);
|
mag_data_x[position] = listMean(mag_accum_x);
|
||||||
@ -722,7 +722,7 @@ void ConfigRevoWidget::doGetSixPointCalibrationMeasurement(UAVObject *obj)
|
|||||||
#ifdef SIX_POINT_CAL_ACCEL
|
#ifdef SIX_POINT_CAL_ACCEL
|
||||||
accelState->setMetadata(initialAccelStateMdata);
|
accelState->setMetadata(initialAccelStateMdata);
|
||||||
#endif
|
#endif
|
||||||
mag->setMetadata(initialMagnetoStateMdata);
|
mag->setMetadata(initialMagStateMdata);
|
||||||
|
|
||||||
// Recall saved board rotation
|
// Recall saved board rotation
|
||||||
recallBoardRotation();
|
recallBoardRotation();
|
||||||
@ -928,7 +928,7 @@ void ConfigRevoWidget::doStartNoiseMeasurement()
|
|||||||
Q_ASSERT(accelState);
|
Q_ASSERT(accelState);
|
||||||
GyroState *gyroState = GyroState::GetInstance(getObjectManager());
|
GyroState *gyroState = GyroState::GetInstance(getObjectManager());
|
||||||
Q_ASSERT(gyroState);
|
Q_ASSERT(gyroState);
|
||||||
MagnetoState *mag = MagnetoState::GetInstance(getObjectManager());
|
MagState *mag = MagState::GetInstance(getObjectManager());
|
||||||
Q_ASSERT(mag);
|
Q_ASSERT(mag);
|
||||||
|
|
||||||
UAVObject::Metadata mdata;
|
UAVObject::Metadata mdata;
|
||||||
@ -945,8 +945,8 @@ void ConfigRevoWidget::doStartNoiseMeasurement()
|
|||||||
mdata.flightTelemetryUpdatePeriod = 100;
|
mdata.flightTelemetryUpdatePeriod = 100;
|
||||||
gyroState->setMetadata(mdata);
|
gyroState->setMetadata(mdata);
|
||||||
|
|
||||||
initialMagnetoStateMdata = mag->getMetadata();
|
initialMagStateMdata = mag->getMetadata();
|
||||||
mdata = initialMagnetoStateMdata;
|
mdata = initialMagStateMdata;
|
||||||
UAVObject::SetFlightTelemetryUpdateMode(mdata, UAVObject::UPDATEMODE_PERIODIC);
|
UAVObject::SetFlightTelemetryUpdateMode(mdata, UAVObject::UPDATEMODE_PERIODIC);
|
||||||
mdata.flightTelemetryUpdatePeriod = 100;
|
mdata.flightTelemetryUpdatePeriod = 100;
|
||||||
mag->setMetadata(mdata);
|
mag->setMetadata(mdata);
|
||||||
@ -990,11 +990,11 @@ void ConfigRevoWidget::doGetNoiseSample(UAVObject *obj)
|
|||||||
accel_accum_z.append(accelStateData.z);
|
accel_accum_z.append(accelStateData.z);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MagnetoState::OBJID:
|
case MagState::OBJID:
|
||||||
{
|
{
|
||||||
MagnetoState *mags = MagnetoState::GetInstance(getObjectManager());
|
MagState *mags = MagState::GetInstance(getObjectManager());
|
||||||
Q_ASSERT(mags);
|
Q_ASSERT(mags);
|
||||||
MagnetoState::DataFields magData = mags->getData();
|
MagState::DataFields magData = mags->getData();
|
||||||
mag_accum_x.append(magData.x);
|
mag_accum_x.append(magData.x);
|
||||||
mag_accum_y.append(magData.y);
|
mag_accum_y.append(magData.y);
|
||||||
mag_accum_z.append(magData.z);
|
mag_accum_z.append(magData.z);
|
||||||
@ -1017,7 +1017,7 @@ void ConfigRevoWidget::doGetNoiseSample(UAVObject *obj)
|
|||||||
gyro_accum_x.length() >= NOISE_SAMPLES &&
|
gyro_accum_x.length() >= NOISE_SAMPLES &&
|
||||||
accel_accum_x.length() >= NOISE_SAMPLES) {
|
accel_accum_x.length() >= NOISE_SAMPLES) {
|
||||||
// No need to for more updates
|
// No need to for more updates
|
||||||
MagnetoState *mags = MagnetoState::GetInstance(getObjectManager());
|
MagState *mags = MagState::GetInstance(getObjectManager());
|
||||||
AccelState *accelState = AccelState::GetInstance(getObjectManager());
|
AccelState *accelState = AccelState::GetInstance(getObjectManager());
|
||||||
GyroState *gyroState = GyroState::GetInstance(getObjectManager());
|
GyroState *gyroState = GyroState::GetInstance(getObjectManager());
|
||||||
disconnect(accelState, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(doGetNoiseSample(UAVObject *)));
|
disconnect(accelState, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(doGetNoiseSample(UAVObject *)));
|
||||||
|
@ -92,7 +92,7 @@ private:
|
|||||||
|
|
||||||
UAVObject::Metadata initialAccelStateMdata;
|
UAVObject::Metadata initialAccelStateMdata;
|
||||||
UAVObject::Metadata initialGyroStateMdata;
|
UAVObject::Metadata initialGyroStateMdata;
|
||||||
UAVObject::Metadata initialMagnetoStateMdata;
|
UAVObject::Metadata initialMagStateMdata;
|
||||||
UAVObject::Metadata initialBaroSensorMdata;
|
UAVObject::Metadata initialBaroSensorMdata;
|
||||||
float initialMagCorrectionRate;
|
float initialMagCorrectionRate;
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ void AutoUpdatePage::updateStatus(uploader::AutoUpdateStep status, QVariant valu
|
|||||||
getWizard()->setWindowIcon(qApp->windowIcon());
|
getWizard()->setWindowIcon(qApp->windowIcon());
|
||||||
enableButtons(true);
|
enableButtons(true);
|
||||||
getWizard()->show();
|
getWizard()->show();
|
||||||
ui->statusLabel->setText("Something went wrong, you will have to manualy upgrade the board using the uploader plugin");
|
ui->statusLabel->setText("Something went wrong, you will have to manually upgrade the board using the uploader plugin");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,8 +42,8 @@ HEADERS += $$UAVOBJECT_SYNTHETICS/accessorydesired.h \
|
|||||||
$$UAVOBJECT_SYNTHETICS/gyrosensor.h \
|
$$UAVOBJECT_SYNTHETICS/gyrosensor.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/accelsensor.h \
|
$$UAVOBJECT_SYNTHETICS/accelsensor.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/accelstate.h \
|
$$UAVOBJECT_SYNTHETICS/accelstate.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/magnetosensor.h \
|
$$UAVOBJECT_SYNTHETICS/magsensor.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/magnetostate.h \
|
$$UAVOBJECT_SYNTHETICS/magstate.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/camerastabsettings.h \
|
$$UAVOBJECT_SYNTHETICS/camerastabsettings.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/flighttelemetrystats.h \
|
$$UAVOBJECT_SYNTHETICS/flighttelemetrystats.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/systemstats.h \
|
$$UAVOBJECT_SYNTHETICS/systemstats.h \
|
||||||
@ -126,8 +126,8 @@ SOURCES += $$UAVOBJECT_SYNTHETICS/accessorydesired.cpp \
|
|||||||
$$UAVOBJECT_SYNTHETICS/accelstate.cpp \
|
$$UAVOBJECT_SYNTHETICS/accelstate.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/gyrostate.cpp \
|
$$UAVOBJECT_SYNTHETICS/gyrostate.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/gyrosensor.cpp \
|
$$UAVOBJECT_SYNTHETICS/gyrosensor.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/magnetosensor.cpp \
|
$$UAVOBJECT_SYNTHETICS/magsensor.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/magnetostate.cpp \
|
$$UAVOBJECT_SYNTHETICS/magstate.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/camerastabsettings.cpp \
|
$$UAVOBJECT_SYNTHETICS/camerastabsettings.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/flighttelemetrystats.cpp \
|
$$UAVOBJECT_SYNTHETICS/flighttelemetrystats.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/systemstats.cpp \
|
$$UAVOBJECT_SYNTHETICS/systemstats.cpp \
|
||||||
|
@ -7,15 +7,67 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>822</width>
|
<width>822</width>
|
||||||
<height>350</height>
|
<height>523</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>804</width>
|
||||||
|
<height>505</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="buttonFrame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<property name="lineWidth">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="autoUpdateButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Start a guided procedure to manually
|
||||||
|
recover a system which does not boot.
|
||||||
|
|
||||||
|
Rescue is possible in USB mode only.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Auto Update</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="haltButton">
|
<widget class="QPushButton" name="haltButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -32,6 +84,21 @@ through serial or USB)</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="resetButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Reset the system.
|
||||||
|
(Only enabled if telemetry link is established, either
|
||||||
|
through serial or USB)</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="bootButton">
|
<widget class="QPushButton" name="bootButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -68,34 +135,6 @@ menu on the right.</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="eraseBootButton">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Reboot the board and clear its settings memory.</p><p> Useful if the board cannot boot properly.</p><p> Blue led starts blinking quick for 20-30 seconds than the board will start normally</p><p><br/></p><p>If telemetry is not running, select the link using the dropdown</p><p>menu on the right.</p><p>PLEASE NOTE: Supported with bootloader versions 4.0 and earlier</p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Erase settings</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="resetButton">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Reset the system.
|
|
||||||
(Only enabled if telemetry link is established, either
|
|
||||||
through serial or USB)</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Reset</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="rescueButton">
|
<widget class="QPushButton" name="rescueButton">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -109,6 +148,19 @@ Rescue is possible in USB mode only.</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="eraseBootButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Reboot the board and clear its settings memory.</p><p> Useful if the board cannot boot properly.</p><p> Blue led starts blinking quick for 20-30 seconds than the board will start normally</p><p><br/></p><p>If telemetry is not running, select the link using the dropdown</p><p>menu on the right.</p><p>PLEASE NOTE: Supported with bootloader versions 4.0 and earlier</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Erase settings</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -124,6 +176,12 @@ Rescue is possible in USB mode only.</string>
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="telemetryLink">
|
<widget class="QComboBox" name="telemetryLink">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>When telemetry is not connected, select the communication
|
<string>When telemetry is not connected, select the communication
|
||||||
method using this combo box.
|
method using this combo box.
|
||||||
@ -179,6 +237,42 @@ halting a running board.</string>
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="autoUpdateGroupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Auto update</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QPushButton" name="autoUpdateOkButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>OK</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QProgressBar" name="autoUpdateProgressBar">
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="textVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="autoUpdateLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Progress</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSplitter" name="splitter">
|
<widget class="QSplitter" name="splitter">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -200,7 +294,10 @@ halting a running board.</string>
|
|||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">To upgrade the firmware in your boards, proceed as follows:</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">To upgrade the firmware in your boards,</span></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">press Auto Update and follow instructions</span></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">or</span></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">proceed as follows:</span></p>
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- Connect telemetry</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- Connect telemetry</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- Once telemetry is running, press &quot;Halt&quot; above</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;">- Once telemetry is running, press &quot;Halt&quot; above</span></p>
|
||||||
@ -229,6 +326,10 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../coreplugin/core.qrc"/>
|
<include location="../coreplugin/core.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -60,6 +60,11 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent)
|
|||||||
connect(cm, SIGNAL(deviceConnected(QIODevice *)), this, SLOT(onPhisicalHWConnect()));
|
connect(cm, SIGNAL(deviceConnected(QIODevice *)), this, SLOT(onPhisicalHWConnect()));
|
||||||
getSerialPorts();
|
getSerialPorts();
|
||||||
|
|
||||||
|
m_config->autoUpdateButton->setEnabled(autoUpdateCapable());
|
||||||
|
connect(m_config->autoUpdateButton, SIGNAL(clicked()), this, SLOT(startAutoUpdate()));
|
||||||
|
connect(m_config->autoUpdateOkButton, SIGNAL(clicked()), this, SLOT(closeAutoUpdate()));
|
||||||
|
m_config->autoUpdateGroupBox->setVisible(false);
|
||||||
|
|
||||||
QIcon rbi;
|
QIcon rbi;
|
||||||
rbi.addFile(QString(":uploader/images/view-refresh.svg"));
|
rbi.addFile(QString(":uploader/images/view-refresh.svg"));
|
||||||
m_config->refreshPorts->setIcon(rbi);
|
m_config->refreshPorts->setIcon(rbi);
|
||||||
@ -816,6 +821,67 @@ void UploaderGadgetWidget::downloadEnded(bool succeed)
|
|||||||
m_config->rescueButton->setEnabled(true);
|
m_config->rescueButton->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UploaderGadgetWidget::startAutoUpdate()
|
||||||
|
{
|
||||||
|
m_config->buttonFrame->setEnabled(false);
|
||||||
|
m_config->splitter->setEnabled(false);
|
||||||
|
m_config->autoUpdateGroupBox->setVisible(true);
|
||||||
|
m_config->autoUpdateOkButton->setEnabled(false);
|
||||||
|
connect(this, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::AutoUpdateStep, QVariant)));
|
||||||
|
autoUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UploaderGadgetWidget::finishAutoUpdate()
|
||||||
|
{
|
||||||
|
disconnect(this, SIGNAL(autoUpdateSignal(uploader::AutoUpdateStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::AutoUpdateStep, QVariant)));
|
||||||
|
m_config->autoUpdateOkButton->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UploaderGadgetWidget::closeAutoUpdate()
|
||||||
|
{
|
||||||
|
m_config->autoUpdateGroupBox->setVisible(false);
|
||||||
|
m_config->buttonFrame->setEnabled(true);
|
||||||
|
m_config->splitter->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UploaderGadgetWidget::autoUpdateStatus(uploader::AutoUpdateStep status, QVariant value)
|
||||||
|
{
|
||||||
|
switch (status) {
|
||||||
|
case uploader::WAITING_DISCONNECT:
|
||||||
|
m_config->autoUpdateLabel->setText("Waiting for all OpenPilot boards to be disconnected from USB.");
|
||||||
|
break;
|
||||||
|
case uploader::WAITING_CONNECT:
|
||||||
|
m_config->autoUpdateLabel->setText("Please connect the OpenPilot board to the USB port.");
|
||||||
|
m_config->autoUpdateProgressBar->setValue(value.toInt());
|
||||||
|
break;
|
||||||
|
case uploader::JUMP_TO_BL:
|
||||||
|
m_config->autoUpdateProgressBar->setValue(0);
|
||||||
|
m_config->autoUpdateLabel->setText("Bringing the board into boot loader mode.");
|
||||||
|
break;
|
||||||
|
case uploader::LOADING_FW:
|
||||||
|
m_config->autoUpdateLabel->setText("Preparing to upload firmware to the board.");
|
||||||
|
break;
|
||||||
|
case uploader::UPLOADING_FW:
|
||||||
|
m_config->autoUpdateLabel->setText("Uploading firmware to the board.");
|
||||||
|
m_config->autoUpdateProgressBar->setValue(value.toInt());
|
||||||
|
break;
|
||||||
|
case uploader::UPLOADING_DESC:
|
||||||
|
m_config->autoUpdateLabel->setText("Uploading description of the new firmware to the board.");
|
||||||
|
break;
|
||||||
|
case uploader::BOOTING:
|
||||||
|
m_config->autoUpdateLabel->setText("Rebooting the board.");
|
||||||
|
break;
|
||||||
|
case uploader::SUCCESS:
|
||||||
|
m_config->autoUpdateLabel->setText("<font color='green'>Board was updated successfully, press OK to finish.</font>");
|
||||||
|
finishAutoUpdate();
|
||||||
|
break;
|
||||||
|
case uploader::FAILURE:
|
||||||
|
m_config->autoUpdateLabel->setText("<font color='red'>Something went wrong, you will have to manually upgrade the board. Press OK to continue.</font>");
|
||||||
|
finishAutoUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Update log entry
|
Update log entry
|
||||||
*/
|
*/
|
||||||
|
@ -118,6 +118,10 @@ private slots:
|
|||||||
void uploadEnded(bool succeed);
|
void uploadEnded(bool succeed);
|
||||||
void downloadStarted();
|
void downloadStarted();
|
||||||
void downloadEnded(bool succeed);
|
void downloadEnded(bool succeed);
|
||||||
|
void startAutoUpdate();
|
||||||
|
void finishAutoUpdate();
|
||||||
|
void closeAutoUpdate();
|
||||||
|
void autoUpdateStatus(uploader::AutoUpdateStep status, QVariant value);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // UPLOADERGADGETWIDGET_H
|
#endif // UPLOADERGADGETWIDGET_H
|
||||||
|
4
make/.gitattributes
vendored
4
make/.gitattributes
vendored
@ -6,8 +6,6 @@
|
|||||||
*.py text eol=lf
|
*.py text eol=lf
|
||||||
*.sh text eol=lf
|
*.sh text eol=lf
|
||||||
|
|
||||||
/doxygen/*.cfg text eol=lf
|
/doxygen/* text eol=lf
|
||||||
/templates/firmware_info.c.template text eol=lf
|
|
||||||
/templates/gcs_version_info.h.template text eol=crlf
|
|
||||||
/templates/*.txt text eol=crlf
|
/templates/*.txt text eol=crlf
|
||||||
/uncrustify/*.cfg text eol=lf
|
/uncrustify/*.cfg text eol=lf
|
||||||
|
@ -133,10 +133,10 @@ endef
|
|||||||
define OPFW_TEMPLATE
|
define OPFW_TEMPLATE
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
$(1).firmware_info.c: $(1) $(ROOT_DIR)/make/templates/firmware_info.c.template FORCE
|
$(1).firmware_info.c: $(1) $(ROOT_DIR)/flight/templates/firmware_info.c.template FORCE
|
||||||
@$(ECHO) $(MSG_FWINFO) $$(call toprel, $$@)
|
@$(ECHO) $(MSG_FWINFO) $$(call toprel, $$@)
|
||||||
$(V1) $(VERSION_INFO) \
|
$(V1) $(VERSION_INFO) \
|
||||||
--template=$(ROOT_DIR)/make/templates/firmware_info.c.template \
|
--template=$(ROOT_DIR)/flight/templates/firmware_info.c.template \
|
||||||
--outfile=$$@ \
|
--outfile=$$@ \
|
||||||
--image=$(1) \
|
--image=$(1) \
|
||||||
--type=$(2) \
|
--type=$(2) \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<xml>
|
<xml>
|
||||||
<object name="MagnetoSensor" singleinstance="true" settings="false">
|
<object name="MagSensor" singleinstance="true" settings="false">
|
||||||
<description>The mag data.</description>
|
<description>The mag data.</description>
|
||||||
<field name="x" units="mGa" type="float" elements="1"/>
|
<field name="x" units="mGa" type="float" elements="1"/>
|
||||||
<field name="y" units="mGa" type="float" elements="1"/>
|
<field name="y" units="mGa" type="float" elements="1"/>
|
@ -1,5 +1,5 @@
|
|||||||
<xml>
|
<xml>
|
||||||
<object name="MagnetoState" singleinstance="true" settings="false">
|
<object name="MagState" singleinstance="true" settings="false">
|
||||||
<description>The mag data.</description>
|
<description>The mag data.</description>
|
||||||
<field name="x" units="mGa" type="float" elements="1"/>
|
<field name="x" units="mGa" type="float" elements="1"/>
|
||||||
<field name="y" units="mGa" type="float" elements="1"/>
|
<field name="y" units="mGa" type="float" elements="1"/>
|
Loading…
x
Reference in New Issue
Block a user