Base class for all analyzers.
@description Extend this class to create a new analyzer.
An Analyzer tracks changes to a vehicle model over time to determine if anything untoward is happening. “evaluate()” is called repeatedly when the model’s state changes, and “end_of_log” is called when no more input will be forthcoming. An Analyzer is expected to output Analyzer_Result objects through the “add_result” object.
Public Functions
Constructor for Analyzer.
vehicle – The vehicle model to be analyzed.
data_sources – A mapping of abstract data source names to their concrete data sources (e.g. ATTITUDE -> [ ATT.Pitch, ATT.Roll ]).
Configure an analyzer from a .ini config file.
config – The configuration source.
true if configuration succeeded.
Outlines the reason this test exists.
Provide analyzer output in the provided Json::Value.
root – [out] Object to populate with output
Return the analyzer’s status represented as a string.
Set whether to produce output compatible with older versions.
purity – True if compatability fields should not be produced
Returns true if compatability fields will not be produced.
true if compatability fields will not be produced.
Return all results this analyzer has produced.
Return the number of results this analyzer has produced.
Returns a number “score” indicating how significant this result may be.
Called whenever the vehicle’s state changes.
Called when no more input will be forthcoming.
packet_count – The number of packets processed to update the model.
Provide the Analyzer’s overall status.
The Analyzer overall status.
Protected Functions
Provide the Analyzer Result’s status.
The Analyzer_Result’s status.
Protected Attributes
Vehicle model.
Updated by LA_MsgHandler* and analyzing_mavlink_message_handler, analyzed by analyzer_*.
Map from abstract data source to concrete data source.
e.g. BATTERY_REMAINING -> SYS_STATUS.battery_remaining.
Base class for analyzer results; extend this to provide a custom result object.
You probably do not want to directly extend Analyzer_Result, but one of its immediate subclasses.
Subclassed by Analyzer_Result_Event, Analyzer_Result_Period, Analyzer_Result_Summary
Public Functions
Construct an Analyzer_Result.
Provides a textual description of the Analyzer Result’s status.
A text string e.g. “OK” or “FAIL”.
Provide the Analyzer_Result’s status.
The Analyzer_Result’s status.
Set the Analyzer Result’s status.
status – The new status for this Result.
Set a simple, human-readable explanation of the result.
reason – The reason for the existence of this result.
Provide a simple, human-readable explanation if the result.
Provide analyzer output in the provided Json::Value.
Root – [out] object to populate with output.
Provide textual free-form evidence for the “reason”.
f – Textual free-form evidence.
Indicate that a particular data source was used to come to the conclusion returned by reason().
f – A Data_Source relevant to the conclusion in reason().
Indicate the result is incrementally more significant.
evilness – Degree to which this result is more significant.
Indicate how significant this result is.
evilness – Degree of significance of this result.
Return a number indicating the relative significance of this result.
The relative significance of this result.
Base class for an Analyzer Result which does not span any time.
Examples would include a “Crash” event present in a log.
Base class for an Analyzer Result which spans a period.
Examples would include a momentary attitude control loss.
Public Functions
Provide analyzer output in the provided Json::Value.
Root – [out] object to populate with output.
Base class for an Analyzer Result which provides information derived over the entire period of data input.
Examples would include “How many bytes of the input were processed”.
Public Functions
Base class from which all vehicles inherit.
Subclassed by AnalyzerVehicle::Copter, AnalyzerVehicle::Plane, AnalyzerVehicle::Rover
Public Types
Public Functions
Returns a short string describing the vehicle.
A short string describing the vehicle e.g. “Copter”.
Time since autopilot boot (microseconds).
Time since autopilot boot (microseconds).
The timestamp at which the “time_since_boot()” timestamp was updated.
This timestamp may reflect time on a different system - for example, a MAVLink tlog often uses a Ground Control Station’s concept of time.
Timestamp that the autopilot boot time was last changed.
Set the number of microseconds the autopilot has been booted.
time_since_boot – Microseconds since autopilot boot.
Evaluation of whether the vehicle is flying.
true
if it is believed the vehicle is flying.
Vehicle arm status.
true
if it believed the vehicle is armed.
Set the vehicle arm status.
value – The new vehicle arm status.
Vehicle type forced status. @detail Sometimes the vehicle type can not be determined from a log and must be forced.
true
if the vehicle type has been forced.
Indicates that the vehicle type has been forced.
value – true
if the vehicle type has been forced.
Vehicle type. @detail Until the vehicle type is determined, this returns invalid. After the vehicle type is determined (e.g. from a log), this will return a specific value from the vehicletype_t enumeration indication the vehicle type.
The current vehicle type.
Set a variance value by name.
name – Name of variance to set (e.g. “pos_horiz”).
value – New value of the variance.
Variance modification time.
name – Name of variance to retrieve modification time for.
timestamp Timestamp at which variance was last changed (microseconds).
Set EKF status flags.
flags – EKF self-assessment status flags.
EKF status flags modification time.
timestamp Timestamp at which the EKF self-assessment flags were last changed (microseconds).
All EKF variances.
Returns all EKF variances as a map from name to value.
Set a variance value by name.
name – Name of variance to set (e.g. “pos_horiz”).
value – New value of the variance.
Set NKF (EKFv2) status flags.
flags – NKF (EKFv2 self-assessment status flags.
NKF status flags.
NKF self-assessment status flags.
NKF (EKF2) status flags modification time.
timestamp Timestamp at which the NKF self-assessment flags were last changed (microseconds).
All NKF (EKF2) variances.
Returns all NKF (EKF2) variances as a map from name to value.
Set a variance value by name.
name – Name of variance to set (e.g. “pos_horiz”).
value – New value of the variance.
Set XKF (EKF3) status flags.
flags – XKF (EKF3 self-assessment status flags.
XKF status flags.
XKF self-assessment status flags.
XKF (EKF3) status flags modification time.
timestamp Timestamp at which the XKF self-assessment flags were last changed (microseconds).
All XKF (EKF3) variances.
Returns all XKF (EKF3) variances as a map from name to value.
Retrieve parameter value.
name – Parameter value to retrieve. @detail This function will abort if the parameter has not been seen and no default is known.
Parameter value from log or defaults.
Retrieve parameter value. @detail Returns parameter value ONLY from input, not from defaults.
name – Parameter value to retrieve.
ret – [out] Parameter value.
true
if the parameter has been seen in the log.
Retrieve parameter value. @detail Returns parameter value ONLY from input, not from defaults.
name – Parameter value to retrieve.
ret – [out] Parameter value.
true
if the parameter has been seen in the log.
Number of parameters seen.
Number of parameters seen in input.
Parameter status.
true
if the parameter has been seen in the log.
Timestamp at which a parameter was last modified (microseconds).
name – Parameter modification time to retrieve.
Parameter modification time (microseconds).
Set a parameter.
name – Parameter to set.
value – New value of parameter.
Return the default value for a parameter. @detail Default parameters are supplied so that some analysis can be done even in the absence of parameters in the logs.
name – Parameter to retrieve default value for.
ret – [out] Value of parameter.
true
if a default was found for the parameters.
Retrieve a parameter value. @detail Returns the value last set for this parameter, or a default if it has not been set yet.
name – Parameter to retrieve default value for.
ret – [out] Value of parameter.
true
if the parameter value was found.
Retrieves a parameter value and abort()s if it not found. @detail Returns the value last set for this parameter, or a default if it has not been set yet.
name – Parameter to retrieve default value for.
Value of parameter.
Set outputs for all servos.
ch1 – current output for servo 1 (ppm).
ch2 – current output for servo 2 (ppm).
ch3 – current output for servo 3 (ppm).
ch4 – current output for servo 4 (ppm).
ch5 – current output for servo 5 (ppm).
ch6 – current output for servo 6 (ppm).
ch7 – current output for servo 7 (ppm).
ch8 – current output for servo 8 (ppm).
Set outputs for single servo.
channel_number – Servo to set value for.
value – New value for servo output (ppm).
Return current output for a specific servo.
channel_number – Servo number.
Current servo output (ppm).
Set timestamp distinguishing logging events. @detail This may or may not be a real wall-clock time.
time_us – New timestamp (microseconds).
Current timestamp.
Current universe timestamp.
Canonical vehicle attitude - roll.
Canonical attitude - roll (degrees).
Canonical vehicle attitude - pitch (degrees).
Canonical attitude - pitch.
Canonical vehicle attitude - yaw.
Canonical attitude - yaw (degrees).
Modification time - roll.
Timestamp roll was last modified (microseconds).
Modification time - pitch.
Timestamp pitch was last modified (microseconds).
Modification time - yaw.
Timestamp yaw was last modified (microseconds).
Set canonical vehicle atttiude - roll.
new – Canonical attitude - roll (degrees).
Set canonical vehicle atttiude - pitch.
new – Canonical attitude - pitch (degrees).
Set canonical vehicle atttiude - yaw.
new – Canonical attitude - yaw (degrees).
set Navigation Controller desired attitude - roll.
roll – New desired attitude - roll.
Set Navigation Controller desired attitude - pitch.
roll – New desired attitude - pitch.
Set Navigation Controller desired attitude - yaw.
roll – New desired attitude - yaw.
Navigation Controller desired attitude - roll.
Navigation Controller desired attitude - pitch.
Navigation Controller desired attitude - yaw.
Set canonical vehicle altitude.
value – New vehicle altitude.
Canonical vehicle altitude.
The vehicle’s canonical altitude.
Canonical vehicle altitude modification time.
Timestamp The canonical vehicle altitude was modified (microseconds).
Set vehicle canonical latitude.
lat – New vehicle canonical latitude.
Set vehicle canonical longitude.
lat – New vehicle canonical latitude.
Retrieve named position estimate.
name – Name of position estimate to retrieve.
A position estimate.
Retrieve named attitude estimate.
name – Name of attitude estimate to retrieve.
An attitude estimate.
Retrieve named altitude estimate.
name – Name of altitude estimate to retrieve.
An altitude estimate.
Retrieve named velocity estimate.
name – Name of velocity estimate to retrieve.
A velocity estimate.
Distance from canonical vehicle position to canonical origin.
Distance from origin, or -1 if we just don’t know.
Hardware diagnostics.
Map of sensor name to its boolean health.
Set the health status of a sensor by name.
name – Name of sensor.
value – New health value of sensor.
Subsystem health.
Map of subsystem ID to its status
Set an error flag value.
subsys – subsystem ID
code – error code
Indicate amount of flight battery remaining.
percent – Percentage of charge remaining.
Amount of battery remaining.
Amount of battery remaining (percentage).
Battery remaining modification time.
Timestamp when battery remaining was last modified (microseconds).
Indicate a battery is in failsafe.
in_failsafe – true
if battery is in failsafe.
Battery failsafe status.
true
if the battery is in failsafe.
Battery in failsafe modification time.
Timestamp when battery failsafe was last modified (microseconds).
Attitude estimates.
Map of attitude estimate name to attitude estimate.
Altitude estimates.
Map of altitude estimate name to altitude estimate.
Position estimates.
Map of position estimate name to position estimate.
Velocity estimates.
Map of velocity estimate name to velocity estimate.
Autopilot status information.
Object containing autopilot status information.
Set number of autopilot scheduler overruns.
scheduler – Overruns in last loopcount() loops.
Set number of loops for scheduler data.
count – Number of loops for scheduler data.
Maximum number of slices moved in a scheduler loop.
slices – Maximum number of slices used.
Minimum number of slices moved in a scheduler loop.
slices – Minimum number of slices used.
Average number of slices moved in a scheduler loop.
slices – Average number of slices used.
Stddev number of slices moved in a scheduler loop.
slices – Stddev from average number of slices used.
Set vcc of autopilot.
vcc – vcc supplied to autopilot
Information from global positioning systems.
Map from GPS name to GPS information object.
Information from a specific global positioning system.
name – Name of GPS unit to return information for.
Magnetometer information.
Map from compass name to compass data.
Magnetometer information for specific named compass.
Canonical vehicle attitude.
The vehicle’s current canonical attitude.
Canonical vehicle attitude rates.
The vehicle’s current canonical attitude rates.
Canonical vehicle position.
The vehicle’s current canonical position.
Canonical vehicle altitude.
The vehicle’s current canonical absolute altitude.
Canonical vehicle velocity.
The vehicle’s current canonical velocity.
Canonical vehicle attitude.
The vehicle’s current canonical attitude.
Canonical vehicle attitude rates.
The vehicle’s current canonical attitude rates.
Canonical vehicle position.
The vehicle’s current canonical position.
Canonical vehicle altitude.
The vehicle’s current canonical absolute altitude.
Canonical vehicle velocity.
The vehicle’s current canonical velocity.
Vehicle origin position - latitude.
The vehicle’s original position - latitude.
Modification time of the vehicle’s original latitude.
The modification time of the vehicle’s original latitude.
Vehicle origin position - longitude.
The vehicle’s original position - longitude.
Modification time of the vehicle’s original longitude.
The modification time of the vehicle’s original longitude.
Set vehicle’s original latitude.
value – New vehicle’s original latitude.
Set vehicle’s original longitude.
value – New vehicle’s original longitude.
Vehicle’s original altitude.
The vehicle’s original altitude (metres).
Set vehicle origin altitude.
value – The vehicle’s origin altitude (metres).
Vehicle’s original altitude.
The vehicle’s original altitude (metres).
Modification time of vehicle’s original altitude.
Timestamp when origin altitude was last set (microseconds).
vehicle’s altitude relative to origin altitude.
relative – [out] Vehicle’s altitude relative to its origin.
true if the relative value could e calculated.
Vehicle’s crash state.
true
if the craft is believed to be in a crashed state.
Set the vehicle’s crash state. @value The vehicle’s new crash state.
Accelerometer clipping state.
true
if any accelerometer is clipping.
Public Static Functions
Change the vehicle from one type to another. @detail A base vehicle is used to gather information until we determine what vehicle type we are actually analyzing. This call is used to switch to a more-specific vehicle type.
_vehicle – Vehicle to change type of. @newtype New vehicle type.
Protected Functions
Navigation state object.
Object representing Navigation Controller state.
Protected Attributes
Current servo outputs (ppm).
Public Types
Public Functions
Returns a short string describing the vehicle.
A short string describing the vehicle e.g. “Copter”.
Evaluation of whether the vehicle is flying.
true
if it is believed the vehicle is flying.
Return the default value for a parameter. @detail Default parameters are supplied so that some analysis can be done even in the absence of parameters in the logs.
name – Parameter to retrieve default value for.
ret – [out] Value of parameter.
true
if a default was found for the parameters.
Vehicle type.
The current vehicle type.
Supply number of motors configured on this vehicle.
get current PWM output of motor i
Indicate if any of the vehicle motors appears to be running at flight speed.
True if any motor is running fast enough to indicate flight.
Indicate excessive lean angles of aircraft.
True if vehicle is past its configured maximum angle.
Indicates if any motor appears to be running as slow as it can.
a set of motor numbers which appear to be running slowly
Indicates if any motor appears to be running as fast as it can.
a set of motor numbers which appear to be running flat out
Supply threshold over which a motor is considered to be running fast enough that it might cause flight.
a PWM output value
set copter frame type
frame_type – new copter frame type
set copter frame type
frame_config_string – new copter frame type, as a string as found in dataflash and mavlink logs
retrieve copter frame type
the current copter frame type
Public Types
Public Functions
Returns a short string describing the vehicle.
A short string describing the vehicle e.g. “Copter”.
Evaluation of whether the vehicle is flying.
true
if it is believed the vehicle is flying.
Return the default value for a parameter. @detail Default parameters are supplied so that some analysis can be done even in the absence of parameters in the logs.
name – Parameter to retrieve default value for.
ret – [out] Value of parameter.
true
if a default was found for the parameters.
Vehicle type.
The current vehicle type.
Return current flight mode.
current flight mode
set current flight mode
Return true currently in vertical flight mode.
true if in vertical flight mode, false otherwise
Abstraction of a vehicle attitude.
Public Functions
Abstraction of a vehicle altitude.
Abstraction of a vehicle global position (2D).
Abstraction of a vehicle velocity.
Public Functions
State information for a base Extended Kalman Filter.
Subclassed by AnalyzerVehicle::NKF
Public Functions
Attitude according to some sensor or algorithm.
Public Functions
Information about the Navigation Controller’s output.
Public Functions
A source of magnetic field information.
A source of GPS information (typically output from a GPS device).
Public Functions
Information about the AutoPilot.
Public Functions
Accelerometer and gyroscope information from onboard IMUs.
Public Functions
Retrieve average of gyroscopes by sample count.
count – number of samples to average over.
ret – [out] the returned average.
True if the average could be found.
Retrieve average of gyroscopes by time.
T – Highest timestamp to use (microseconds, typically _vehicle->T())
T_delta – Time span over which to take average (microseconds).
ret – [out] The returned average.
True if the average could be found.