Firmware
|
class VotedSensorsUpdate More...
#include <voted_sensors_update.h>
Public Member Functions | |
VotedSensorsUpdate (const Parameters ¶meters, 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. | |
class VotedSensorsUpdate
Handling of sensor updates with voting
VotedSensorsUpdate::VotedSensorsUpdate | ( | const Parameters & | parameters, |
bool | hil_enabled | ||
) |
parameters | parameter values. These do not have to be initialized when constructing this object. Only when calling init(), they have to be initialized. |
void VotedSensorsUpdate::check_failover | ( | ) |
check if a failover event occured.
if so, report it.
int VotedSensorsUpdate::init | ( | sensor_combined_s & | raw | ) |
initialize subscriptions etc.
void VotedSensorsUpdate::initialize_sensors | ( | ) |
This tries to find new sensor instances.
This is called from init(), then it can be called periodically.
void VotedSensorsUpdate::parameters_update | ( | ) |
call this whenever parameters got updated.
Make sure to have initialize_sensors() called at least once before calling this.