Firmware
Functions
PreflightCheck.cpp File Reference

Preflight check for main system components. More...

#include "PreflightCheck.h"
#include "health_flag_helper.h"
#include "rc_check.h"
#include <math.h>
#include <parameters/param.h>
#include <systemlib/mavlink_log.h>
#include <uORB/Subscription.hpp>
#include <uORB/topics/airspeed.h>
#include <uORB/topics/differential_pressure.h>
#include <uORB/topics/estimator_status.h>
#include <uORB/topics/sensor_accel.h>
#include <uORB/topics/sensor_baro.h>
#include <uORB/topics/sensor_gyro.h>
#include <uORB/topics/sensor_mag.h>
#include <uORB/topics/sensor_preflight.h>
#include <uORB/topics/subsystem_info.h>
#include <uORB/topics/system_power.h>

Functions

bool Preflight::preflightCheck (orb_advert_t *mavlink_log_pub, vehicle_status_s &status, vehicle_status_flags_s &status_flags, bool checkGNSS, bool reportFailures, bool prearm, const hrt_abstime &time_since_boot)
 Runs a preflight check on all sensors to see if they are properly calibrated and healthy. More...
 

Detailed Description

Preflight check for main system components.

Author
Lorenz Meier loren.nosp@m.z@px.nosp@m.4.io
Johan Jansen jnsn..nosp@m.joha.nosp@m.n@gma.nosp@m.il.c.nosp@m.om

Function Documentation

§ preflightCheck()

bool Preflight::preflightCheck ( orb_advert_t mavlink_log_pub,
vehicle_status_s &  status,
vehicle_status_flags_s &  status_flags,
bool  checkGNSS,
bool  reportFailures,
bool  prearm,
const hrt_abstime time_since_boot 
)

Runs a preflight check on all sensors to see if they are properly calibrated and healthy.

The function won't fail the test if optional sensors are not found, however, it will fail the test if optional sensors are found but not in working condition.

Parameters
mavlink_log_pubMavlink output orb handle reference for feedback when a sensor fails
checkMagtrue if the magneteometer should be checked
checkAcctrue if the accelerometers should be checked
checkGyrotrue if the gyroscopes should be checked
checkBarotrue if the barometer should be checked
checkAirspeedtrue if the airspeed sensor should be checked
checkRCtrue if the Remote Controller should be checked
checkGNSStrue if the GNSS receiver should be checked
checkPowertrue if the system power should be checked