Gripper operationsΒΆ

Use the robot end-effector handle to open, close, and command a gripper goal.

from olo import Client

with Client() as client:
    robot = client.robot()
    arm = robot.kinematics

    gripper = arm.ee

    if gripper is not None:
        # Open and close the gripper with built-in goals.
        open_result = gripper.open()
        close_result = gripper.close()

        print(open_result.reached_goal)
        print(close_result.stalled)

        # Or command an explicit gripper width.
        gripper.goal(0.02)
import { connect } from "olo/web";

const client = connect();
const robot = await client.robot();
const arm = robot.kinematics;
const gripper = await arm.getEndEffector();

if (gripper !== undefined) {
  // Open and close the gripper with built-in goals.
  const openResult = await gripper.open();
  const closeResult = await gripper.close();

  console.log(openResult.reachedGoal);
  console.log(closeResult.stalled);

  // Or command an explicit gripper width.
  await gripper.goal(0.02);
}