Repository navigation
ElevationBadPointFilter
Up | Previous | Next | Русский
Below is the full source of the class in documentation form. The comments inside the block explain the purpose of the parts of the class, but they are not stored in the working file ElevationBadPointFilter.java: the production code stays clean and the explanations live in the wiki.
package com.velitask.plugin.official.processing.filters;
import com.velitask.sdk.data.ElevationSensorAtom;
/* Bad elevation points. */
public final class ElevationBadPointFilter extends BadPointFilter<ElevationSensorAtom> {
/* Stable step name in plans and settings. */
public static final String NAME = "elevationBadPoint";
/* The elevation in the atom is stored in thousandths of a metre. */
private static final double UNITS_PER_METER = 1000d;
public ElevationBadPointFilter() {
/* Step version 1; the sensor atom is ElevationSensorAtom. */
super(NAME, 1, ElevationSensorAtom.class);
}
@Override
/* Elevation in metres. */
protected double value(ElevationSensorAtom atom) {
return atom.elevation / UNITS_PER_METER;
}
}ElevationBadPointFilter is the "Bad elevation points" filter for the ElevationSensorAtom sensor. It rejects values that cannot be trusted: right after a pause, outside the limits, with a too fast jump or a single spike. The whole algorithm and the ten parameters are in the base class BadPointFilter; the class only binds it to the atom.
-
Name and version:
elevationBadPoint, version 1. -
valueis theelevationfield of the atom divided by 1000: the filter works in metres (theUNITS_PER_METERconstant). The parameters in sensor units (min,max,deviation,floor) are set in metres;maxRateis in these units per hour.
Where it is used. The step is registered in BuiltinScenarios. In GoproImportPlan it is the first step of the elevation sensor: settleSec = 8 (the elevation sensor in this plan is marked disabled()). It is not used in the other built-in plans.
- By default all parameters are off (0 or
false) and the filter removes nothing; the values are set by the import plans, the user can change them in the step settings. - The "Check the limits" checkbox without set limits will reject all values except zero (
min = max = 0by default). - The other features (the order of the checks, the comparison with the last accepted point, the median window of spikes) are in BadPointFilter.