Class GantryClient

A gRPC-web client for the Gantry component.

Implements

Constructors

Properties

callOptions: CallOptions = ...
name: string

The name of the resource.

Methods

  • Send/Receive arbitrary commands to the resource.

    Parameters

    • command: Struct

      The command to execute.

    • callOptions: CallOptions = ...

    Returns Promise<JsonValue>

    const result = await resource.doCommand({
    name: 'myCommand',
    args: { key: 'value' },
    });
  • Get the geometries of the component in their current configuration.

    Parameters

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<commonApi.Geometry[]>

    const gantry = new VIAM.GantryClient(machine, 'my_gantry');

    // Get the geometries of this component
    const geometries = await gantry.getGeometries();

    For more information, see Gantry API.

  • Get the lengths of the axes of the gantry in millimeters.

    Parameters

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<number[]>

    A list of the length of each axis in millimeters.

    const gantry = new VIAM.GantryClient(machine, 'my_gantry');

    // Get the lengths of the axes in millimeters
    const lengths = await gantry.getLengths();

    For more information, see Gantry API.

  • Get the current position of each axis.

    Parameters

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<number[]>

    A list of the current position of each axis in millimeters.

    const gantry = new VIAM.GantryClient(machine, 'my_gantry');

    // Get the current positions of the axes in millimeters
    const positions = await gantry.getPosition();

    For more information, see Gantry API.

  • Runs the homing sequence to find the start and end positions of the gantry axis.

    Parameters

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<boolean>

    A bool representing whether the gantry has run the homing sequence successfully.

    const gantry = new VIAM.GantryClient(machine, 'my_gantry');

    // Run the homing sequence
    const success = await gantry.home();

    For more information, see Gantry API.

  • Get if the gantry is currently moving.

    Parameters

    • callOptions: CallOptions = ...

    Returns Promise<boolean>

    const gantry = new VIAM.GantryClient(machine, 'my_gantry');

    // Check if the gantry is moving
    const moving = await gantry.isMoving();
    console.log('Moving:', moving);

    For more information, see Gantry API.

  • Move each axis of the gantry to the positionsMm at the speeds in speedsMmPerSec.

    Parameters

    • positionsMm: number[]

      The goal positions for each axis of the gantry.

    • speedsMmPerSec: number[]

      The desired speed for each axis to move to the respective position in positionsMm.

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<void>

    const gantry = new VIAM.GantryClient(machine, 'my_gantry');

    // Create positions for a 3-axis gantry
    const positions = [1, 2, 3];
    const speeds = [3, 9, 12];

    // Move the axes to the specified positions
    await gantry.moveToPosition(positions, speeds);

    For more information, see Gantry API.

  • Stop the motion of the gantry.

    Parameters

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<void>

    const gantry = new VIAM.GantryClient(machine, 'my_gantry');

    // Stop all motion of the gantry
    await gantry.stop();

    For more information, see Gantry API.

MMNEPVFCICPMFPCPTTAAATR