bam.trajectory#

Attributes#

Classes#

Trajectory

Abstract base class for identification trajectories.

LiftAndDrop

Cubic move to −π/2 over 2 s, then torque disabled (gravity drop).

SinusTimeSquare

Progressively faster sinusoidal trajectory: \(\sin(t^2)\).

UpAndDown

Slow cubic path 0 → π/2 → 0.8·π/2.

SinSin

Multi-frequency trajectory: \(\sin(t)\cdot\pi/2 + \sin(5t)\cdot 0.5\cdot\sin(2t)\).

Nothing

Zero torque for the full duration (pure gravity response).

Functions#

cubic_interpolate(→ float)

Interpolate a scalar signal through a list of keyframes with cubic splines.

Module Contents#

bam.trajectory.cubic_interpolate(keyframes: list, t: float) float#

Interpolate a scalar signal through a list of keyframes with cubic splines.

Each keyframe is a triplet (t, x, x') where t is the time, x the value, and x' the desired first derivative at that point.

Parameters:
  • keyframes – List of [t, x, dx/dt] triplets, sorted by time.

  • t – Query time.

Returns:

Interpolated value at time t.

class bam.trajectory.Trajectory#

Abstract base class for identification trajectories.

A trajectory is a callable that maps a time t to a target angle and a torque-enable flag. All built-in trajectories run for 6 seconds.

duration: float = None#
class bam.trajectory.LiftAndDrop#

Bases: Trajectory

Cubic move to −π/2 over 2 s, then torque disabled (gravity drop).

Useful for identifying backdrivability and Stribeck effects at very low speed, as the arm falls freely under gravity after the motor is released.

duration = 6.0#
class bam.trajectory.SinusTimeSquare#

Bases: Trajectory

Progressively faster sinusoidal trajectory: \(\sin(t^2)\).

General-purpose trajectory that sweeps a wide velocity range in a single run. Recommended as the primary identification trajectory.

duration = 6.0#
class bam.trajectory.UpAndDown#

Bases: Trajectory

Slow cubic path 0 → π/2 → 0.8·π/2.

Emphasises static friction and load-dependent effects at low to medium speed.

duration = 6.0#
class bam.trajectory.SinSin#

Bases: Trajectory

Multi-frequency trajectory: \(\sin(t)\cdot\pi/2 + \sin(5t)\cdot 0.5\cdot\sin(2t)\).

Rich spectral content covers a broad range of velocities and accelerations.

duration = 6.0#
class bam.trajectory.Nothing#

Bases: Trajectory

Zero torque for the full duration (pure gravity response).

Useful to isolate backdrivability and measure passive dynamics.

duration = 6.0#
bam.trajectory.trajectories: dict[str, Trajectory]#
bam.trajectory.trajectory#