Skip to content

CLASS

IPSPositioningDebuggingWalkBuilder

final public class IPSPositioningDebuggingWalkBuilder

This class allows to construct a IPSPositioningDebuggingWalk.

Example usage:

IPSDebugging.positioningDebuggingWalk = IPSPositioningDebuggingWalkBuilder(startCalibrated: true)
   .acquireLockAt(x: 8.7, y: 11.5, duration: 5)
   .walkTo(x: 7.8, y: 5.5)
   .setSpeed(3)
   .setAccuracy(3.5)
   .walkTo(x: 5.2, y: 5.3)
   .loseAndRecoverLockAt(x: 5.5, y: 5.5, duration: 1)
   .setSpeed(10)
   .setAccuracy(1.5)
   .walkTo(x: 4.7, y: 13.3)
   .build()
   ```

- Since: 7.3.0

## Methods
### `init(startCalibrated:)`

```swift
public init(startCalibrated: Bool = true)

Creates an instance of IPSPositioningDebuggingWalkBuilder

  • Parameter startCalibrated: Indicates whether the walk begins in a calibrated state.
  • Since: 7.3.0

Parameters

Name Description
startCalibrated Indicates whether the walk begins in a calibrated state.

acquireLockAt(x:y:duration:)

public func acquireLockAt(x: Double, y: Double, duration: Double) -> IPSPositioningDebuggingWalkBuilder

Add a section with lock progress going from 0 to 1 - Parameters: - x: x coordinate where the lock will be acquired - y: y coordinate where the lock will be acquired - duration: how long should it take to reach lock, in seconds - Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 7.3.0

Parameters

Name Description
x x coordinate where the lock will be acquired
y y coordinate where the lock will be acquired
duration how long should it take to reach lock, in seconds

loseAndRecoverLockAt(x:y:duration:)

public func loseAndRecoverLockAt(x: Double, y: Double, duration: Double) -> IPSPositioningDebuggingWalkBuilder

Add a section where the lock will be lost and re-established (lock progress going from 0 to 1) - Parameters: - x: x coordinate where the lock will be acquired - y: y coordinate where the lock will be acquired - duration: how long should it take to reach lock, in seconds - Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 7.3.0

Parameters

Name Description
x x coordinate where the lock will be acquired
y y coordinate where the lock will be acquired
duration how long should it take to reach lock, in seconds

setSpeed(_:)

public func setSpeed(_ value: Double) -> IPSPositioningDebuggingWalkBuilder

Set the speed parameter that will be used for the following walking sections. Average human walking speed is around 4.5 km/h - Parameter value: speed in km/h - Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 7.3.0

Parameters

Name Description
value speed in km/h

setAccuracy(_:)

public func setAccuracy(_ value: Double) -> IPSPositioningDebuggingWalkBuilder

Set the accuracy parameter that will be used for the following walking sections. - Parameter value: accuracy radius in meters - Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 7.3.0

Parameters

Name Description
value accuracy radius in meters

walkTo(x:y:)

public func walkTo(x: Double, y: Double) -> IPSPositioningDebuggingWalkBuilder

Add a section where user will walk to the provided coordinates. Heading will be calculated by the direction from the previous destination to the next one. - Parameters: - x: destination coordinate x - y: destination coordinate y - Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 7.3.0

Parameters

Name Description
x destination coordinate x
y destination coordinate y

changeFloorTo(floorOrder:)

public func changeFloorTo(floorOrder: Int) -> IPSPositioningDebuggingWalkBuilder

Moves the following user position updates to the specified floor - Parameters: - floorOrder: Order index of the floor - Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 8.3.0

Parameters

Name Description
floorOrder Order index of the floor

dwellAround(x:y:deviation:duration:)

public func dwellAround(x: Double, y: Double, deviation: Double = 0.25, duration: Double) -> IPSPositioningDebuggingWalkBuilder

Add a section where user dwells around the specified coordinates. The coordinates of the updates will be spread randomly around the specified values, deviation parameter defines how far the coordinates can be. - Parameters: - x: x coordinate around that the position will dwell - y: y coordinate around that the position will dwell - deviation: distance in meters that limits the spreading - duration: how long the user should dwell, in seconds - Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 8.3.0

Parameters

Name Description
x x coordinate around that the position will dwell
y y coordinate around that the position will dwell
deviation distance in meters that limits the spreading
duration how long the user should dwell, in seconds

standStillAt(x:y:duration:)

public func standStillAt(x: Double, y: Double, duration: Double) -> IPSPositioningDebuggingWalkBuilder

Add a section where user stands still at the provided coordinates. - Parameters: - x: x coordinate where user stands - y: y coordinate where user stands - duration: how long the user should stand still, in seconds - Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 8.3.0

Parameters

Name Description
x x coordinate where user stands
y y coordinate where user stands
duration how long the user should stand still, in seconds

completeCalibration(duration:)

public func completeCalibration(duration: Double) -> IPSPositioningDebuggingWalkBuilder

Adds a segment representing the calibration process from 0% to 100% completion.

  • Parameter duration: Duration in seconds for the calibration process to complete.
  • Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 8.8.0

Parameters

Name Description
duration Duration in seconds for the calibration process to complete.

loseCalibration(reason:)

public func loseCalibration(reason: IPSCalibrationNeededReason) -> IPSPositioningDebuggingWalkBuilder

Adds a segment representing a loss of calibration.

  • Parameter reason: The reason for calibration loss. Supported values: .expired, .magnetic.
  • Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 8.8.0

Parameters

Name Description
reason The reason for calibration loss. Supported values: .expired, .magnetic.

moveLockProgressTo(lockProgress:)

public func moveLockProgressTo(lockProgress: Double) -> IPSPositioningDebuggingWalkBuilder

Adds a segment that sets lock progress to a constant value. - Parameter lockProgress: The lock progress value, from 0 to 1. - Returns: IPSPositioningDebuggingWalkBuilder object to chain the calls

  • Since: 9.8.0

Parameters

Name Description
lockProgress The lock progress value, from 0 to 1.

build()

public func build() -> IPSPositioningDebuggingWalk

Builds a walk considering all the previously added sections - Returns: A configured IPSPositioningDebuggingWalk.

  • Since: 7.3.0