bam.trajectory#
Attributes#
Classes#
Abstract base class for identification trajectories. |
|
Cubic move to −π/2 over 2 s, then torque disabled (gravity drop). |
|
Progressively faster sinusoidal trajectory: \(\sin(t^2)\). |
|
Slow cubic path 0 → π/2 → 0.8·π/2. |
|
Multi-frequency trajectory: \(\sin(t)\cdot\pi/2 + \sin(5t)\cdot 0.5\cdot\sin(2t)\). |
|
Zero torque for the full duration (pure gravity response). |
Functions#
|
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')wheretis the time,xthe value, andx'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
tto a target angle and a torque-enable flag. All built-in trajectories run for 6 seconds.- duration: float = None#
- class bam.trajectory.LiftAndDrop#
Bases:
TrajectoryCubic 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:
TrajectoryProgressively 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:
TrajectorySlow 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:
TrajectoryMulti-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:
TrajectoryZero 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#