Skip to content

Commit

Permalink
Merge pull request #14 from navmaticandrew/master
Browse files Browse the repository at this point in the history
Spelling Fixes
  • Loading branch information
mohammedkhider authored Sep 10, 2019
2 parents b785456 + b6b8577 commit c67e367
Show file tree
Hide file tree
Showing 17 changed files with 137 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class GnssContainer {
private boolean mLogStatuses = true;
private boolean mLogNmeas = true;
private long registrationTimeNanos = 0L;
private long firstLocatinTimeNanos = 0L;
private long firstLocationTimeNanos = 0L;
private long ttff = 0L;
private boolean firstTime = true;

Expand Down Expand Up @@ -85,8 +85,8 @@ public void onLocationChanged(Location location) {
if (firstTime && location.getProvider().equals(LocationManager.GPS_PROVIDER)) {
if (mLogLocations) {
for (GnssListener logger : mLoggers) {
firstLocatinTimeNanos = SystemClock.elapsedRealtimeNanos();
ttff = firstLocatinTimeNanos - registrationTimeNanos;
firstLocationTimeNanos = SystemClock.elapsedRealtimeNanos();
ttff = firstLocationTimeNanos - registrationTimeNanos;
logger.onTTFFReceived(ttff);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void setPositionVelocityCalculator(RealTimePositionVelocityCalculator val
mPositionVelocityCalculator = value;
}

public void updateMapViewWithPostions(
public void updateMapViewWithPositions(
final double latDegRaw,
final double lngDegRaw,
final double latDegDevice,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class PlotFragment extends Fragment {
/** The average of the average of strongest satellite signal strength over history */
private double mAverageCn0 = 0;

/** Total number of {@link GnssMeasurementsEvent} has been recieved*/
/** Total number of {@link GnssMeasurementsEvent} has been received*/
private int mMeasurementCount = 0;
private double mInitialTimeSeconds = -1;
private TextView mAnalysisView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class RealTimePositionVelocityCalculator implements GnssListener {
private int mCurrentColor = Color.rgb(0x4a, 0x5f, 0x70);
private int mCurrentColorIndex = 0;
private boolean mAllowShowingRawResults = false;
private MapFragment mMapFragement;
private MapFragment mMapFragment;
private MainActivity mMainActivity;
private PlotFragment mPlotFragment;
private int[] mRgbColorArray = {
Expand Down Expand Up @@ -250,7 +250,7 @@ public void run() {
}
logLocationEvent("onLocationChanged: " + location);
if (!Double.isNaN(posSolution[0])) {
updateMapViewWithPostions(
updateMapViewWithPositions(
posSolution[0],
posSolution[1],
location.getLatitude(),
Expand All @@ -267,16 +267,16 @@ public void run() {
}

private void clearMapMarkers() {
mMapFragement.clearMarkers();
mMapFragment.clearMarkers();
}

private void updateMapViewWithPostions(
private void updateMapViewWithPositions(
double latDegRaw,
double lngDegRaw,
double latDegDevice,
double lngDegDevice,
long timeMillis) {
mMapFragement.updateMapViewWithPostions(
mMapFragment.updateMapViewWithPositions(
latDegRaw, lngDegRaw, latDegDevice, lngDegDevice, timeMillis);
}

Expand Down Expand Up @@ -479,8 +479,8 @@ private synchronized void updateGroundTruth(double[] posSolution) {
/**
* Sets {@link MapFragment} for receiving WLS location update
*/
public void setMapFragment(MapFragment mapFragement) {
this.mMapFragement = mapFragement;
public void setMapFragment(MapFragment mapFragment) {
this.mMapFragment = mapFragment;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ public void onClick(View view) {
return null;
}

String platfromVersionString = Build.VERSION.RELEASE;
swInfo.append("Platform: " + platfromVersionString + "\n");
int apiLivelInt = Build.VERSION.SDK_INT;
swInfo.append("Api Level: " + apiLivelInt);
String platformVersionString = Build.VERSION.RELEASE;
swInfo.append("Platform: " + platformVersionString + "\n");
int apiLevelInt = Build.VERSION.SDK_INT;
swInfo.append("Api Level: " + apiLevelInt);

return view;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import android.widget.NumberPicker;
import java.util.concurrent.TimeUnit;

/** A represetation of a time as "hours:minutes:seconds" */
/** A representation of a time as "hours:minutes:seconds" */
public class TimerValues {
private static final String EMPTY = "N/A";
private static final String HOURS = "hours";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void onGnssMeasurementsReceived(GnssMeasurementsEvent event) {
}

builder.append("]");
logMeasurementEvent("onGnsssMeasurementsReceived: " + builder.toString());
logMeasurementEvent("onGnssMeasurementsReceived: " + builder.toString());
}

private String toStringClock(GnssClock gnssClock) {
Expand Down Expand Up @@ -220,7 +220,7 @@ private String toStringMeasurement(GnssMeasurement measurement) {
if (measurement.hasSnrInDb()) {
builder.append(String.format(format, "SnrInDb", measurement.getSnrInDb()));
}

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
if (measurement.hasAutomaticGainControlLevelDb()) {
builder.append(
Expand All @@ -230,7 +230,7 @@ private String toStringMeasurement(GnssMeasurement measurement) {
builder.append(String.format(format, "CarrierFreqHz", measurement.getCarrierFrequencyHz()));
}
}

return builder.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Ecef2LlaConverter {
// WGS84 Ellipsoid Parameters
private static final double EARTH_SEMI_MAJOR_AXIS_METERS = 6378137.0;
private static final double ECCENTRICITY = 8.1819190842622e-2;
private static final double INVERSE_FLATENNING = 298.257223563;
private static final double INVERSE_FLATTENING = 298.257223563;
private static final double MIN_MAGNITUDE_METERS = 1.0e-22;
private static final double MAX_ITERATIONS = 15;
private static final double RESIDUAL_TOLERANCE = 1.0e-6;
Expand Down Expand Up @@ -119,19 +119,19 @@ public static GeodeticLlaValues convertECEFToLLAByIterations(double ecefXMeters,
double ecefZMetersResidual;
// initial height (iterate next to improve accuracy)
altMeters = xyzLengthMeters - EARTH_SEMI_MAJOR_AXIS_METERS
* (1 - sinPhi * sinPhi / INVERSE_FLATENNING);
* (1 - sinPhi * sinPhi / INVERSE_FLATTENING);

for (int i = 1; i <= MAX_ITERATIONS; i++) {
sinPhi = Math.sin(latRad);

// calculate radius of curvature in prime vertical direction
ni = EARTH_SEMI_MAJOR_AXIS_METERS / Math.sqrt(1 - (2 - 1 / INVERSE_FLATENNING)
/ INVERSE_FLATENNING * Math.sin(latRad) * Math.sin(latRad));
ni = EARTH_SEMI_MAJOR_AXIS_METERS / Math.sqrt(1 - (2 - 1 / INVERSE_FLATTENING)
/ INVERSE_FLATTENING * Math.sin(latRad) * Math.sin(latRad));

// calculate residuals in p and ecefZMeters
pResidual = xyLengthMeters - (ni + altMeters) * Math.cos(latRad);
ecefZMetersResidual = ecefZMeters
- (ni * (1 - (2 - 1 / INVERSE_FLATENNING) / INVERSE_FLATENNING) + altMeters)
- (ni * (1 - (2 - 1 / INVERSE_FLATTENING) / INVERSE_FLATTENING) + altMeters)
* Math.sin(latRad);

// update height and latitude
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.apache.commons.math3.linear.RealMatrix;

/**
* Transformations from ECEF coordiantes to Topocentric coordinates
* Transformations from ECEF coordinates to Topocentric coordinates
*/
public class EcefToTopocentricConverter {
private static final double MIN_DISTANCE_MAGNITUDE_METERS = 1.0e-22;
Expand All @@ -37,7 +37,7 @@ public class EcefToTopocentricConverter {
* http://kom.aau.dk/~borre/life-l99/topocent.m
*
*/
public static TopocentricAEDValues convertCartesianToTopocentericRadMeters(
public static TopocentricAEDValues convertCartesianToTopocentricRadMeters(
final double[] originECEFMeters, final double[] inputVectorMeters) {

GeodeticLlaValues latLngAlt = Ecef2LlaConverter.convertECEFToLLACloseForm(originECEFMeters[0],
Expand Down Expand Up @@ -81,7 +81,7 @@ public static TopocentricAEDValues convertCartesianToTopocentericRadMeters(
public static TopocentricAEDValues calculateElAzDistBetween2Points(
double[] userPositionECEFMeters, double[] satPositionECEFMeters) {

return convertCartesianToTopocentericRadMeters(userPositionECEFMeters,
return convertCartesianToTopocentricRadMeters(userPositionECEFMeters,
GpsMathOperations.subtractTwoVectors(satPositionECEFMeters, userPositionECEFMeters));

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public class GpsMathOperations {
* Calculates the norm of a vector
*/
public static double vectorNorm(double[] inputVector) {
double normSqured = 0;
double normSquared = 0;
for (int i = 0; i < inputVector.length; i++) {
normSqured = Math.pow(inputVector[i], 2) + normSqured;
normSquared = Math.pow(inputVector[i], 2) + normSquared;
}

return Math.sqrt(normSqured);
return Math.sqrt(normSquared);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public class IonosphericModel {
public static final double L2_FREQ_HZ = 10.23 * 1e6 * 120;
/** Center frequency of the L5 band in Hz. */
public static final double L5_FREQ_HZ = 10.23 * 1e6 * 115;

private static final double SECONDS_PER_DAY = 86400.0;
private static final double PERIOD_OF_DELAY_TRHESHOLD_SECONDS = 72000.0;
private static final double PERIOD_OF_DELAY_THRESHOLD_SECONDS = 72000.0;
private static final double IPP_LATITUDE_THRESHOLD_SEMI_CIRCLE = 0.416;
private static final double DC_TERM = 5.0e-9;
private static final double NORTH_GEOMAGNETIC_POLE_LONGITUDE_RADIANS = 5.08;
Expand All @@ -49,10 +49,10 @@ public class IonosphericModel {
private static final int IONO_3_IDX = 3;

/**
* Calculates the Ionospheric correction of the pseudorane in seconds using the Klobuchar
* Calculates the Ionospheric correction of the pseudorange in seconds using the Klobuchar
* Ionospheric model.
*/
public static double ionoKloboucharCorrectionSeconds(
public static double ionoKlobucharCorrectionSeconds(
double[] userPositionECEFMeters,
double[] satellitePositionECEFMeters,
double gpsTOWSeconds,
Expand All @@ -70,11 +70,11 @@ public static double ionoKloboucharCorrectionSeconds(
double longitudeUSemiCircle = latLngAlt.longitudeRadians / Math.PI;

// earth's centered angle (semi-circles)
double earthCentredAngleSemiCirle = 0.0137 / (elevationSemiCircle + 0.11) - 0.022;
double earthCentredAngleSemiCircle = 0.0137 / (elevationSemiCircle + 0.11) - 0.022;

// latitude of the Ionospheric Pierce Point (IPP) (semi-circles)
double latitudeISemiCircle =
latitudeUSemiCircle + earthCentredAngleSemiCirle * Math.cos(azimuthSemiCircle * Math.PI);
latitudeUSemiCircle + earthCentredAngleSemiCircle * Math.cos(azimuthSemiCircle * Math.PI);

if (latitudeISemiCircle > IPP_LATITUDE_THRESHOLD_SEMI_CIRCLE) {
latitudeISemiCircle = IPP_LATITUDE_THRESHOLD_SEMI_CIRCLE;
Expand All @@ -83,7 +83,7 @@ public static double ionoKloboucharCorrectionSeconds(
}

// geodetic longitude of the Ionospheric Pierce Point (IPP) (semi-circles)
double longitudeISemiCircle = longitudeUSemiCircle + earthCentredAngleSemiCirle
double longitudeISemiCircle = longitudeUSemiCircle + earthCentredAngleSemiCircle
* Math.sin(azimuthSemiCircle * Math.PI) / Math.cos(latitudeISemiCircle * Math.PI);

// geomagnetic latitude of the Ionospheric Pierce Point (IPP) (semi-circles)
Expand All @@ -109,8 +109,8 @@ public static double ionoKloboucharCorrectionSeconds(
double periodOfDelaySeconds = beta[IONO_0_IDX] + beta[IONO_1_IDX] * geomLatIPPSemiCircle
+ beta[IONO_2_IDX] * geomLatIPPSemiCircle * geomLatIPPSemiCircle + beta[IONO_3_IDX]
* geomLatIPPSemiCircle * geomLatIPPSemiCircle * geomLatIPPSemiCircle;
if (periodOfDelaySeconds < PERIOD_OF_DELAY_TRHESHOLD_SECONDS) {
periodOfDelaySeconds = PERIOD_OF_DELAY_TRHESHOLD_SECONDS;
if (periodOfDelaySeconds < PERIOD_OF_DELAY_THRESHOLD_SECONDS) {
periodOfDelaySeconds = PERIOD_OF_DELAY_THRESHOLD_SECONDS;
}

// phase of ionospheric delay
Expand All @@ -130,8 +130,8 @@ public static double ionoKloboucharCorrectionSeconds(
+ (1 - Math.pow(phaseOfDelayRadians, 2) / 2.0 + Math.pow(phaseOfDelayRadians, 4) / 24.0)
* amplitudeOfDelaySeconds) * slantFactor;
}
// apply factor for frequency bands other than L1

// apply factor for frequency bands other than L1
ionoDelaySeconds *= (L1_FREQ_HZ * L1_FREQ_HZ) / (frequencyHz * frequencyHz);

return ionoDelaySeconds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public void computePositionVelocitySolutionsFromRawMeas(GnssMeasurementsEvent ev
// start with last known position and velocity of zero. Following the structure:
// [X position, Y position, Z position, clock bias,
// X Velocity, Y Velocity, Z Velocity, clock bias rate]
double[] positionVeloctySolutionEcef = GpsMathOperations.createAndFillArray(8, 0);
double[] positionVelocitySolutionEcef = GpsMathOperations.createAndFillArray(8, 0);
double[] positionVelocityUncertaintyEnu = GpsMathOperations.createAndFillArray(6, 0);
double[] pseudorangeResidualMeters
= GpsMathOperations.createAndFillArray(
Expand All @@ -211,15 +211,15 @@ public void computePositionVelocitySolutionsFromRawMeas(GnssMeasurementsEvent ev
mArrivalTimeSinceGPSWeekNs,
mDayOfYear1To366,
mGpsWeekNumber,
positionVeloctySolutionEcef,
positionVelocitySolutionEcef,
positionVelocityUncertaintyEnu,
pseudorangeResidualMeters);
// convert the position solution from ECEF to latitude, longitude and altitude
GeodeticLlaValues latLngAlt =
Ecef2LlaConverter.convertECEFToLLACloseForm(
positionVeloctySolutionEcef[0],
positionVeloctySolutionEcef[1],
positionVeloctySolutionEcef[2]);
positionVelocitySolutionEcef[0],
positionVelocitySolutionEcef[1],
positionVelocitySolutionEcef[2]);
mPositionSolutionLatLngDeg[0] = Math.toDegrees(latLngAlt.latitudeRadians);
mPositionSolutionLatLngDeg[1] = Math.toDegrees(latLngAlt.longitudeRadians);
mPositionSolutionLatLngDeg[2] = latLngAlt.altitudeMeters;
Expand Down Expand Up @@ -249,9 +249,9 @@ public void computePositionVelocitySolutionsFromRawMeas(GnssMeasurementsEvent ev
+ " "
+ mPositionSolutionLatLngDeg[2]);
EnuValues velocityEnu = Ecef2EnuConverter.convertEcefToEnu(
positionVeloctySolutionEcef[4],
positionVeloctySolutionEcef[5],
positionVeloctySolutionEcef[6],
positionVelocitySolutionEcef[4],
positionVelocitySolutionEcef[5],
positionVelocitySolutionEcef[6],
latLngAlt.latitudeRadians,
latLngAlt.longitudeRadians
);
Expand Down Expand Up @@ -364,7 +364,7 @@ private void performPositionVelocityComputationEcef(
+ positionVelocitySolutionEcef[5]
+ " "
+ positionVelocitySolutionEcef[6]);
Log.d(TAG, "Estimated Reciever clock offset rate in mps: " + positionVelocitySolutionEcef[7]);
Log.d(TAG, "Estimated Receiver clock offset rate in mps: " + positionVelocitySolutionEcef[7]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class ResidualCorrectionCalculator {
* passed in from WLS
* @param positionVelocitySolutionECEF position velocity solution passed in from WLS
* @param groundTruthInputECEFMeters the reference position in ECEF meters
* @return an array contains the corrected pseusorange residual in meters for each satellite
* @return an array contains the corrected pseudorange residual in meters for each satellite
*/
public static double[] calculateCorrectedResiduals(
SatellitesPositionPseudorangesResidualAndCovarianceMatrix
Expand Down
Loading

0 comments on commit c67e367

Please sign in to comment.