Interface Gripper

Represents a physical robotic gripper.

interface Gripper {
    getGeometries: (extra?: Struct) => Promise<commonApi.Geometry[]>;
    grab: (extra?: Struct) => Promise<void>;
    isMoving: () => Promise<boolean>;
    name: string;
    open: (extra?: Struct) => Promise<void>;
    stop: (extra?: Struct) => Promise<void>;
    doCommand(command: Struct): Promise<JsonValue>;
}

Hierarchy (View Summary, Expand)

Implemented by

Properties

getGeometries: (extra?: Struct) => Promise<commonApi.Geometry[]>

Get the geometries of the component in their current configuration.

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.

grab: (extra?: Struct) => Promise<void>

Request a gripper of the underlying robot to grab.

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

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

For more information, see Gripper API.

isMoving: () => Promise<boolean>

Report if the gripper is in motion.

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.

name: string

The name of the resource.

open: (extra?: Struct) => Promise<void>

Open a gripper of the underlying robot.

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

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

For more information, see Gripper API.

stop: (extra?: Struct) => Promise<void>

Stop a robot's gripper.

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

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

For more information, see Gripper API.

Methods

  • Send/Receive arbitrary commands to the resource.

    Parameters

    • command: Struct

      The command to execute.

    Returns Promise<JsonValue>

    const result = await resource.doCommand({
    name: 'myCommand',
    args: { key: 'value' },
    });
MMNEPVFCICPMFPCPTTAAATR