Class GripperClient

A gRPC-web client for the Gripper 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 gripper = new VIAM.GripperClient(machine, 'my_gripper');

    // Get the geometries of this component
    const geometries = await gripper.getGeometries();
    console.log('Geometries:', geometries);

    For more information, see Gripper API.

  • Request a gripper of the underlying robot to grab.

    Parameters

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

    Returns Promise<void>

    const gripper = new VIAM.GripperClient(machine, 'my_gripper');

    // Close the gripper to grab
    await gripper.grab();

    For more information, see Gripper API.

  • Report if the gripper is in motion.

    Parameters

    • callOptions: CallOptions = ...

    Returns Promise<boolean>

    const gripper = new VIAM.GripperClient(machine, 'my_gripper');

    // Check if the gripper is currently moving
    const moving = await gripper.isMoving();
    console.log('Gripper is moving:', moving);

    For more information, see Gripper API.

  • Open a gripper of the underlying robot.

    Parameters

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

    Returns Promise<void>

    const gripper = new VIAM.GripperClient(machine, 'my_gripper');

    // Open the gripper
    await gripper.open();

    For more information, see Gripper API.

  • Stop a robot's gripper.

    Parameters

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

    Returns Promise<void>

    const gripper = new VIAM.GripperClient(machine, 'my_gripper');

    // Stop the gripper's current motion
    await gripper.stop();

    For more information, see Gripper API.

MMNEPVFCICPMFPCPTTAAATR