mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
Change revo sensors to update at 500 Hz and make sure in all cases it waits for
the relevant queue to provide data. Also disable the quaternion stabilization flag.
This commit is contained in:
parent
65065f2588
commit
836e34a483
@ -269,14 +269,20 @@ static int32_t updateAttitudeComplimentary(bool first_run)
|
||||
FlightStatusData flightStatus;
|
||||
FlightStatusGet(&flightStatus);
|
||||
if(first_run) {
|
||||
#if defined(PIOS_INCLUDE_HMC5883)
|
||||
// To initialize we need a valid mag reading
|
||||
if ( xQueueReceive(magQueue, &ev, 0 / portTICK_RATE_MS) != pdTRUE )
|
||||
return -1;
|
||||
|
||||
AttitudeActualData attitudeActual;
|
||||
AttitudeActualGet(&attitudeActual);
|
||||
MagnetometerData magData;
|
||||
MagnetometerGet(&magData);
|
||||
#else
|
||||
MagnetometerData magData;
|
||||
magData.x = 100;
|
||||
magData.y = 0;
|
||||
magData.z = 0;
|
||||
#endif
|
||||
AttitudeActualData attitudeActual;
|
||||
AttitudeActualGet(&attitudeActual);
|
||||
init = 0;
|
||||
attitudeActual.Roll = atan2f(-accelsData.y, -accelsData.z) * 180.0f / F_PI;
|
||||
attitudeActual.Pitch = atan2f(accelsData.x, -accelsData.z) * 180.0f / F_PI;
|
||||
|
@ -194,6 +194,8 @@ static void SensorsTask(void *parameters)
|
||||
|
||||
#if defined(PIOS_INCLUDE_HMC5883)
|
||||
mag_test = PIOS_HMC5883_Test();
|
||||
#else
|
||||
mag_test = 0;
|
||||
#endif
|
||||
|
||||
if(accel_test < 0 || gyro_test < 0 || mag_test < 0) {
|
||||
@ -412,16 +414,7 @@ static void SensorsTask(void *parameters)
|
||||
|
||||
PIOS_WDG_UpdateFlag(PIOS_WDG_SENSORS);
|
||||
|
||||
switch(bdinfo->board_rev) {
|
||||
case 0x01: // L3GD20 + BMA180 board
|
||||
lastSysTime = xTaskGetTickCount();
|
||||
break;
|
||||
case 0x02:
|
||||
vTaskDelayUntil(&lastSysTime, SENSOR_PERIOD / portTICK_RATE_MS);
|
||||
break;
|
||||
default:
|
||||
PIOS_DEBUG_Assert(0);
|
||||
}
|
||||
lastSysTime = xTaskGetTickCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,8 @@ endif
|
||||
FLASH_TOOL = OPENOCD
|
||||
|
||||
# List of modules to include
|
||||
MODULES = Sensors Attitude/revolution ManualControl Stabilization Altitude/revolution Actuator GPS FirmwareIAP
|
||||
MODULES = Sensors Attitude/revolution ManualControl Stabilization Actuator
|
||||
MODULES += Altitude/revolution GPS FirmwareIAP
|
||||
MODULES += AltitudeHold VtolPathFollower PathPlanner
|
||||
MODULES += CameraStab
|
||||
MODULES += OveroSync
|
||||
|
@ -94,7 +94,7 @@
|
||||
/* Flags that alter behaviors - mostly to lower resources for CC */
|
||||
#define PIOS_INCLUDE_INITCALL /* Include init call structures */
|
||||
#define PIOS_TELEM_PRIORITY_QUEUE /* Enable a priority queue in telemetry */
|
||||
#define PIOS_QUATERNION_STABILIZATION /* Stabilization options */
|
||||
//#define PIOS_QUATERNION_STABILIZATION /* Stabilization options */
|
||||
#define PIOS_GPS_SETS_HOMELOCATION /* GPS options */
|
||||
|
||||
/* Alarm Thresholds */
|
||||
|
@ -174,7 +174,7 @@ static const struct pios_mpu6000_cfg pios_mpu6000_cfg = {
|
||||
.exti_cfg = &pios_exti_mpu6000_cfg,
|
||||
.Fifo_store = PIOS_MPU6000_FIFO_TEMP_OUT | PIOS_MPU6000_FIFO_GYRO_X_OUT | PIOS_MPU6000_FIFO_GYRO_Y_OUT | PIOS_MPU6000_FIFO_GYRO_Z_OUT,
|
||||
// Clock at 8 khz, downsampled by 8 for 1khz
|
||||
.Smpl_rate_div = 7,
|
||||
.Smpl_rate_div = 15,
|
||||
.interrupt_cfg = PIOS_MPU6000_INT_CLR_ANYRD,
|
||||
.interrupt_en = PIOS_MPU6000_INTEN_DATA_RDY,
|
||||
.User_ctl = PIOS_MPU6000_USERCTL_FIFO_EN | PIOS_MPU6000_USERCTL_DIS_I2C,
|
||||
|
Loading…
x
Reference in New Issue
Block a user