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


9546
9547
9548
# File 'Monkeybrains.rb', line 9546

def accuracy
  @accuracy
end

altitudeToybox::Lang::Float

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

Elevation is obtained from the GPS. If no GPS is present, then no valid elevation will be returned.

Returns:

See Also:

Since:

  • 1.0.0


9537
9538
9539
# File 'Monkeybrains.rb', line 9537

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


9554
9555
9556
# File 'Monkeybrains.rb', line 9554

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


9518
9519
9520
# File 'Monkeybrains.rb', line 9518

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


9528
9529
9530
# File 'Monkeybrains.rb', line 9528

def speed
  @speed
end

whenToybox::Time::Moment

The GPS time stamp of the obtained Location fix.

Returns:

Since:

  • 1.0.0


9560
9561
9562
# File 'Monkeybrains.rb', line 9560

def when
  @when
end