50 #include <mathlib/mathlib.h>
uint32_t _baro_device_id[SENSOR_COUNT_MAX]
baro driver device id for each uorb instance
sensor_selection_s _selection
struct containing the sensor selection to be published to the uORB
Accelerometer driver interface.
bool applyMagCalibration(DriverFramework::DevHandle &h, const struct mag_calibration_s *mcal, const int device_id)
Apply a mag calibration.
vehicle_magnetometer_s _last_magnetometer[SENSOR_COUNT_MAX]
latest sensor data from all sensors instances
Gyroscope driver interface.
void magPoll(vehicle_magnetometer_s &magnetometer)
Poll the magnetometer for updated data.
VotedSensorsUpdate(const Parameters ¶meters, bool hil_enabled)
void sensorsPoll(sensor_combined_s &raw, vehicle_air_data_s &airdata, vehicle_magnetometer_s &magnetometer)
read new sensor data
gyro scaling factors; Vout = (Vin * Vscale) + Voffset
uORB::Publication< sensor_correction_s > _sensor_correction_pub
handle to the sensor correction uORB topic
void setRelativeTimestamps(sensor_combined_s &raw)
set the relative timestamps of each sensor timestamp, based on the last sensorsPoll, so that the data can be published.
sensor_correction_s _corrections
struct containing the sensor corrections to be published to the uORB
void baroPoll(vehicle_air_data_s &airdata)
Poll the barometer for updated data.
vehicle_air_data_s _last_airdata[SENSOR_COUNT_MAX]
latest sensor data from all sensors instances
orb_advert_t _mavlink_log_pub
mag scaling factors; Vout = (Vin * Vscale) + Voffset
void initializeSensors()
This tries to find new sensor instances.
static const char * sensor_name
static int32_t device_id[max_accel_sens]
High-resolution timer with callouts and timekeeping.
int init(sensor_combined_s &raw)
initialize subscriptions etc.
void calcMagInconsistency(sensor_preflight_s &preflt)
Calculates the magnitude in Gauss of the largest difference between the primary and any other magneto...
accel scaling factors; Vout = Vscale * (Vin + Voffset)
uint32_t _gyro_device_id[SENSOR_COUNT_MAX]
gyro driver device id for each uorb instance
const bool _hil_enabled
is hardware-in-the-loop mode enabled?
class TemperatureCompensation Applies temperature compensation to sensor data.
sensor_combined_s _last_sensor_data[SENSOR_COUNT_MAX]
latest sensor data from all sensors instances
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
constexpr uint8_t ACCEL_COUNT_MAX
constexpr uint8_t MAG_COUNT_MAX
bool _selection_changed
true when a sensor selection has changed and not been published
Sensor correction methods.
uint8_t priority[SENSOR_COUNT_MAX]
sensor priority
float _gyro_diff[3][2]
filtered gyro differences between IMU uinits (rad/s)
int subscription[SENSOR_COUNT_MAX]
raw sensor data subscription
A data validation group to identify anomalies in data streams.
uint32_t _accel_device_id[SENSOR_COUNT_MAX]
accel driver device id for each uorb instance
unsigned int last_failover_count
bool _corrections_changed
uint64_t _last_accel_timestamp[ACCEL_COUNT_MAX]
latest full timestamp
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
void initSensorClass(const orb_metadata *meta, SensorData &sensor_data, uint8_t sensor_count_max)
constexpr uint8_t SENSOR_COUNT_MAX
void calcAccelInconsistency(sensor_preflight_s &preflt)
Calculates the magnitude in m/s/s of the largest difference between the primary and any other accel s...
float _mag_angle_diff[2]
filtered mag angle differences between sensor instances (Ga)
TemperatureCompensation _temperature_compensation
sensor thermal compensation
matrix::Dcmf _mag_rotation[MAG_COUNT_MAX]
rotation matrix for the orientation that the external mag0 is mounted
bool applyAccelCalibration(DriverFramework::DevHandle &h, const struct accel_calibration_s *acal, const int device_id)
Apply a accel calibration.
uint32_t _mag_device_id[SENSOR_COUNT_MAX]
mag driver device id for each uorb instance
void parametersUpdate()
call this whenever parameters got updated.
matrix::Dcmf _board_rotation
rotation matrix for the orientation that the board is mounted
uORB::Publication< sensor_selection_s > _sensor_selection_pub
handle to the sensor selection uORB topic
void accelPoll(sensor_combined_s &raw)
Poll the accelerometer for updated data.
uORB::PublicationQueued< subsystem_info_s > _info_pub
bool enabled[SENSOR_COUNT_MAX]
A data validation class to identify anomalies in data streams.
Barometric pressure sensor driver interface.
int gyroFd(int idx) const
subsystem_info_s _info
subsystem info publication
void deinit()
deinitialize the object (we cannot use the destructor because it is called on the wrong thread) ...
void checkFailover()
check if a failover event occured.
void gyroPoll(sensor_combined_s &raw)
Poll the gyro for updated data.
float _accel_diff[3][2]
filtered accel differences between IMU units (m/s/s)
void calcGyroInconsistency(sensor_preflight_s &preflt)
Calculates the magnitude in rad/s of the largest difference between the primary and any other gyro se...
const Parameters & _parameters
uint8_t last_best_vote
index of the latest best vote
bool applyGyroCalibration(DriverFramework::DevHandle &h, const struct gyro_calibration_s *gcal, const int device_id)
Apply a gyro calibration.