Class: Toybox::Position::Info

Inherits:
Lang::Object show all

Overview

The Position.Info class contains all of the information provided by the positioning system.

Position Info can be retrieved on every call of onUpdate() or it can be obtained on demand. Fields in this class may return null so should be checked for null values prior to use.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Method Summary

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Instance Attribute Details

accuracyToybox::Lang::Number

The positional accuracy.

This is given as one of the following values: good, usable, poor, or not available, which corresponds with the Position.QUALITY_* constants. This cannot be null.

Returns:

Since:

  • 1.0.0


8394
8395
8396
# File 'Monkeybrains.rb', line 8394

def accuracy
  @accuracy
end

altitudeToybox::Lang::Float

The elevation above mean sea level in meters (m).

Elevation is derived from the most accurate source: Barometer or GPS in order of descending accuracy. If no GPS is present, then barometer readings will be used.

Returns:

See Also:

Since:

  • 1.0.0


8385
8386
8387
# File 'Monkeybrains.rb', line 8385

def altitude
  @altitude
end

headingToybox::Lang::Float

The true north referenced heading in radians.

This provides the direction of travel when moving. If supported by the device, it provides compass orientation when stopped.

Returns:

Since:

  • 1.0.0


8402
8403
8404
# File 'Monkeybrains.rb', line 8402

def heading
  @heading
end

positionToybox::Position::Location

The latitude and longitude of the position.

If no GPS is available or is between GPS fix intervals (typically 1 second), the position is propagated (i.e. dead-reckoned) using the last known heading and last known speed. After a short period of time, the position will cease to be propagated to avoid excessive accumulation of position errors.

Returns:

Since:

  • 1.0.0


8365
8366
8367
# File 'Monkeybrains.rb', line 8365

def position
  @position
end

speedToybox::Lang::Float

The horizontal speed in meters per second (mps).

Speed is derived from the most accurate source in the following order:

  1. GPS

  2. Foot pod

  3. Accelerometer

Returns:

Since:

  • 1.0.0


8375
8376
8377
# File 'Monkeybrains.rb', line 8375

def speed
  @speed
end

whenToybox::Time::Moment

The GPS time stamp of the obtained Location fix.

Returns:

Since:

  • 1.0.0


8408
8409
8410
# File 'Monkeybrains.rb', line 8408

def when
  @when
end