Represents a robot. Includes information about the current location as well as tooling for communication.

Hierarchy

Constructors

Properties

_headingRadians: number
_position: Position = ZERO_POSITION
homeIndices: GridIndices

The location the robot lives in when its not in use.

id: string
startHeadingRadians: number = 0

Accessors

Methods

  • Parameters

    • headingRadians: number

      An absolute heading to turn to, in radians. 0 is up (from white to black). CW is positive.

    Returns Promise<void>

  • Turns and drives the robot to this.position + deltaPosition.

    Parameters

    • deltaPosition: Position

      The amount to offset the current position by.

    Returns Promise<void>

  • Parameters

    • deltaHeadingRadians: number

      A relative heading to turn by, in radians.

    Returns Promise<void>

  • Send a packet to the robot indicating distance to drive. Returns a promise that finishes when the robot finishes the action.

    Parameters

    • tileDistance: number

      The distance to drive forward or backwards by. 1 is defined as the length of a tile.

    Returns Promise<void>

  • Send a packet to the robot indicating angle to turn. Returns a promise that finishes when the robot finishes the action.

    Parameters

    • deltaHeadingRadians: number

      A relative heading to turn by, in radians. May be positive or negative.

    Returns Promise<void>

Generated using TypeDoc