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

Hierarchy

Constructors

Properties

_headingRadians: number
_position: Position
defaultIndices: GridIndices

The location the robot should be in at the beginning of a regular chess.

homeIndices: GridIndices

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

id: string
startHeadingRadians: number = 0
tunnel: null | BotTunnel

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>

  • Parameters

    • startPosition: {
          x: number;
          y: number;
      }
      • x: number
      • y: number
    • endPosition: {
          x: number;
          y: number;
      }
      • x: number
      • y: number
    • controlPositionA: {
          x: number;
          y: number;
      }
      • x: number
      • y: number
    • controlPositionB: {
          x: number;
          y: number;
      }
      • x: number
      • y: number
    • timeDeltaMs: number

    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>

  • Parameters

    • startPosition: {
          x: number;
          y: number;
      }
      • x: number
      • y: number
    • endPosition: {
          x: number;
          y: number;
      }
      • x: number
      • y: number
    • controlPosition: {
          x: number;
          y: number;
      }
      • x: number
      • y: number
    • timeDeltaMs: number

    Returns Promise<void>

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

    Parameters

    • distanceTicks: number

      The distance to drive forward or backwards by, in ticks.

    Returns Promise<void>

  • Parameters

    • radians: number
    • timeDeltaMs: number

    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