Move along linear paths

Move the end-effector along a straight line, then follow a sequence of linear segments down, back up, and finally to the starting pose.

Unlike Move to end-effector poses, linear moves keep the tool on a straight path between waypoints. The planner does not reroute around obstacles — use pose moves when you need collision-aware motion instead.

Note

Linear paths can require high joint speeds or accelerations depending on the robot’s configuration. If planning fails because a joint limit would be exceeded, retry with a lower speed_scaling value.

from olo import Client
from olo.spatial import Pose, Vector

OFFSET = 0.15

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

    # Define poses relative to the current end-effector pose.
    p0 = arm.pose()
    p1 = Pose(
        position=p0.position + Vector(0, OFFSET, 0),
        orientation=p0.orientation,
    )
    p2 = Pose(
        position=p0.position + Vector(0, OFFSET, -OFFSET),
        orientation=p0.orientation,
    )

    # Move in a straight line to p1.
    arm.move_linear(p1)

    # Move down to p2, back to p1, then return to p0.
    arm.move_linear_sequence([p2, p1, p0])
import { Pose, Vector } from "olo/spatial";
import { connect } from "olo/web";

const OFFSET = 0.15;

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

// Define poses relative to the current end-effector pose.
const p0 = await arm.pose();
const p1 = new Pose(p0.position.add(new Vector(0, OFFSET, 0)), p0.orientation);
const p2 = new Pose(
  p0.position.add(new Vector(0, OFFSET, -OFFSET)),
  p0.orientation,
);

// Move in a straight line to p1.
await arm.moveLinear(p1);

// Move down to p2, back to p1, then return to p0.
await arm.moveLinearSequence([p2, p1, p0]);