bam.trajectory ============== .. py:module:: bam.trajectory Attributes ---------- .. autoapisummary:: bam.trajectory.trajectories bam.trajectory.trajectory Classes ------- .. autoapisummary:: bam.trajectory.Trajectory bam.trajectory.LiftAndDrop bam.trajectory.SinusTimeSquare bam.trajectory.UpAndDown bam.trajectory.SinSin bam.trajectory.Nothing Functions --------- .. autoapisummary:: bam.trajectory.cubic_interpolate Module Contents --------------- .. py:function:: 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. :param keyframes: List of ``[t, x, dx/dt]`` triplets, sorted by time. :param t: Query time. :returns: Interpolated value at time ``t``. .. py:class:: 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. .. py:attribute:: duration :type: float :value: None .. py:class:: LiftAndDrop Bases: :py:obj:`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. .. py:attribute:: duration :value: 6.0 .. py:class:: SinusTimeSquare Bases: :py:obj:`Trajectory` Progressively faster sinusoidal trajectory: :math:`\sin(t^2)`. General-purpose trajectory that sweeps a wide velocity range in a single run. Recommended as the primary identification trajectory. .. py:attribute:: duration :value: 6.0 .. py:class:: UpAndDown Bases: :py:obj:`Trajectory` Slow cubic path 0 → π/2 → 0.8·π/2. Emphasises static friction and load-dependent effects at low to medium speed. .. py:attribute:: duration :value: 6.0 .. py:class:: SinSin Bases: :py:obj:`Trajectory` Multi-frequency trajectory: :math:`\sin(t)\cdot\pi/2 + \sin(5t)\cdot 0.5\cdot\sin(2t)`. Rich spectral content covers a broad range of velocities and accelerations. .. py:attribute:: duration :value: 6.0 .. py:class:: Nothing Bases: :py:obj:`Trajectory` Zero torque for the full duration (pure gravity response). Useful to isolate backdrivability and measure passive dynamics. .. py:attribute:: duration :value: 6.0 .. py:data:: trajectories :type: dict[str, Trajectory] .. py:data:: trajectory