Firmware
Classes | Public Member Functions | List of all members
sensors::VotedSensorsUpdate Class Reference

class VotedSensorsUpdate More...

#include <voted_sensors_update.h>

Public Member Functions

 VotedSensorsUpdate (const Parameters &parameters, bool hil_enabled)
 
int init (sensor_combined_s &raw)
 initialize subscriptions etc. More...
 
void initialize_sensors ()
 This tries to find new sensor instances. More...
 
void deinit ()
 deinitialize the object (we cannot use the destructor because it is called on the wrong thread)
 
void print_status ()
 
void parameters_update ()
 call this whenever parameters got updated. More...
 
void sensors_poll (sensor_combined_s &raw, vehicle_air_data_s &airdata, vehicle_magnetometer_s &magnetometer)
 read new sensor data
 
void set_relative_timestamps (sensor_combined_s &raw)
 set the relative timestamps of each sensor timestamp, based on the last sensors_poll, so that the data can be published.
 
void check_failover ()
 check if a failover event occured. More...
 
int num_gyros () const
 
int gyro_fd (int idx) const
 
int best_gyro_fd () const
 
void calc_accel_inconsistency (sensor_preflight_s &preflt)
 Calculates the magnitude in m/s/s of the largest difference between the primary and any other accel sensor.
 
void calc_gyro_inconsistency (sensor_preflight_s &preflt)
 Calculates the magnitude in rad/s of the largest difference between the primary and any other gyro sensor.
 
void calc_mag_inconsistency (sensor_preflight_s &preflt)
 Calculates the magnitude in Gauss of the largest difference between the primary and any other magnetometers.
 

Detailed Description

class VotedSensorsUpdate

Handling of sensor updates with voting

Constructor & Destructor Documentation

§ VotedSensorsUpdate()

VotedSensorsUpdate::VotedSensorsUpdate ( const Parameters parameters,
bool  hil_enabled 
)
Parameters
parametersparameter values. These do not have to be initialized when constructing this object. Only when calling init(), they have to be initialized.

Member Function Documentation

§ check_failover()

void VotedSensorsUpdate::check_failover ( )

check if a failover event occured.

if so, report it.

§ init()

int VotedSensorsUpdate::init ( sensor_combined_s &  raw)

initialize subscriptions etc.

Returns
0 on success, <0 otherwise

§ initialize_sensors()

void VotedSensorsUpdate::initialize_sensors ( )

This tries to find new sensor instances.

This is called from init(), then it can be called periodically.

§ parameters_update()

void VotedSensorsUpdate::parameters_update ( )

call this whenever parameters got updated.

Make sure to have initialize_sensors() called at least once before calling this.


The documentation for this class was generated from the following files: