dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Acquire sensor data from sensors registered with PIOS_Sensors. More...

#include "openpilot.h"
#include "pios.h"
#include "physical_constants.h"
#include "pios_thread.h"
#include "pios_queue.h"
#include "misc_math.h"
#include "lpfilter.h"
#include "sensors.h"
#include "accels.h"
#include "attitudeactual.h"
#include "attitudesettings.h"
#include "baroaltitude.h"
#include "gyros.h"
#include "gyrosbias.h"
#include "homelocation.h"
#include "opticalflowsettings.h"
#include "opticalflow.h"
#include "sensorsettings.h"
#include "rangefinder.h"
#include "inssettings.h"
#include "magnetometer.h"
#include "magbias.h"
#include "coordinate_conversions.h"

Go to the source code of this file.

Macros

#define MAX_SENSOR_PERIOD   6
 
#define REQUIRED_GOOD_CYCLES   50
 
#define MAX_TIME_BETWEEN_VALID_BARO_DATAS_US   (100*1000)
 
#define MAX_TIME_BETWEEN_VALID_MAG_DATAS_US   (300*1000)
 

Enumerations

enum  mag_calibration_algo { MAG_CALIBRATION_PRELEMARI, MAG_CALIBRATION_NORMALIZE_LENGTH }
 

Functions

static void update_accels (struct pios_sensor_accel_data *accels)
 Apply calibration and rotation to the raw accel data. More...
 
static void update_gyros (struct pios_sensor_gyro_data *gyros)
 Apply calibration and rotation to the raw gyro data. More...
 
static void update_mags (struct pios_sensor_mag_data *mag)
 Apply calibration and rotation to the raw mag data. More...
 
static void update_baro (struct pios_sensor_baro_data *baro)
 
static void mag_calibration_prelemari (MagnetometerData *mag)
 
static void mag_calibration_fix_length (MagnetometerData *mag)
 
static void updateTemperatureComp (float temperature, float *temp_bias)
 
static void sensors_settings_update ()
 
int32_t sensors_init (void)
 
bool sensors_step ()
 

Variables

static INSSettingsData insSettings
 
static AccelsData accelsData
 
static volatile bool settings_updated = true
 
static bool bias_correct_gyro = true
 
static float mag_bias [3] = {0,0,0}
 
static float mag_scale [3] = {0,0,0}
 
static float accel_bias [3] = {0,0,0}
 
static float accel_scale [3] = {0,0,0}
 
static float gyro_scale [3] = {0,0,0}
 
static float gyro_coeff_x [4] = {0,0,0,0}
 
static float gyro_coeff_y [4] = {0,0,0,0}
 
static float gyro_coeff_z [4] = {0,0,0,0}
 
static float gyro_temp_bias [3] = {0,0,0}
 
static float z_accel_offset = 0
 
static float Rsb [3][3] = {{0}}
 
static int8_t rotate = 0
 Rotation matrix that transforms from the body frame to the sensor board frame. More...
 
static enum mag_calibration_algo mag_calibration_algo = MAG_CALIBRATION_PRELEMARI
 Select the algorithm to try and null out the magnetometer bias error. More...
 
static lpfilter_state_t gyro_filter
 
static lpfilter_state_t accel_filter
 

Detailed Description

Acquire sensor data from sensors registered with PIOS_Sensors.

Update available sensors registered with PIOS_Sensors.

Author
The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
Tau Labs, http://taulabs.org, Copyright (C) 2013-2016
dRonin, http://dronin.org Copyright (C) 2015-2017
See Also
The GNU Public License (GPL) Version 3
Author
dRonin, http://dRonin.org/, Copyright (C) 2015-2016
Tau Labs, http://taulabs.org, Copyright (C) 2013-2016
The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
See Also
The GNU Public License (GPL) Version 3

Definition in file sensors.c.