Trajectory speed scalingΒΆ

Demonstrates how the planning trajectory speed can be scaled.

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

OFFSET = 0.1

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

    start = arm.pose()

    # Define a forward pose.
    forward = Pose(
        position=Point(
            x=start.position.x + 2 * OFFSET,
            y=start.position.y,
            z=start.position.z - OFFSET,
        ),
        orientation=start.orientation,
    )

    # Move forward and back at different speed scalings.
    for speed_scaling in [0.2 * n for n in range(2, 6)]:
        print(f"speed_scaling={speed_scaling:.1f}")
        arm.move_linear_sequence([forward, start], speed_scaling=speed_scaling)
import { Point, Pose } from "olo/spatial";
import { connect } from "olo/web";

const OFFSET = 0.1;

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

const start = await arm.pose();

// Define a forward pose.
const forward = new Pose(
  new Point(start.position.x + 2 * OFFSET, start.position.y, start.position.z - OFFSET),
  start.orientation,
);

// Move forward and back at different speed scalings.
for (const speedScaling of [2, 3, 4, 5].map((n) => 0.2 * n)) {
  console.log(`speedScaling=${speedScaling.toFixed(1)}`);
  await arm.moveLinearSequence([forward, start], { speedScaling });
}