Temporal DMPs
Temporal Dynamic Movement Primitives
DMPs that generate time-based movements with rhythmic pattern learning, beat and tempo adaptation for temporal movement generation.
Family: Dynamic Movement Primitives Status: ๐ Planned
Need Help Understanding This Algorithm?
Overview
Temporal Dynamic Movement Primitives extend the basic DMP framework to handle time-based movement generation with emphasis on rhythmic patterns, beat adaptation, and tempo control. These DMPs are particularly valuable for applications requiring precise temporal coordination, such as musical performance, dance, rhythmic locomotion, and any task that requires synchronization with external timing cues.
The key innovation of temporal DMPs is the integration of: - Time-based canonical systems that can adapt to external timing cues - Rhythmic pattern learning and generation - Beat and tempo adaptation mechanisms - Synchronization with external rhythms and metronomes - Temporal scaling and modulation capabilities
These DMPs are particularly valuable in applications requiring precise temporal coordination, such as musical instrument playing, dance performance, rhythmic locomotion, and synchronized multi-agent systems.
Mathematical Formulation¶
๐งฎ Ask ChatGPT about Mathematical Formulation
Problem Definition
Given:
- Time-based canonical system: ฯฯฬ = ฯ(t) where ฯ(t) is the time-varying frequency
- Rhythmic DMP: ฯแบ = ฮฑ_y(ฮฒ_y(g - y) - แบ) + f(ฯ)
- Beat adaptation: ฯ(t) = ฯ_0 + k_beat * (t_beat - t_expected)
- Tempo adaptation: ฯ(t) = ฯ_0 + k_tempo * (tempo_target - tempo_current)
- Phase synchronization: ฯ_sync = ฯ + k_sync * (ฯ_external - ฯ)
The temporal DMP becomes: ฯ(t)แบ = ฮฑ_y(ฮฒ_y(g - y) - แบ) + f(ฯ_sync) ฯ(t)ฯฬ = ฯ(t)
Where: - ฯ(t) is the adaptive frequency - ฯ(t) is the adaptive time constant - ฯ_sync is the synchronized phase
Key Properties
Adaptive Frequency
ฯ(t) = ฯ_0 + k_beat * (t_beat - t_expected)
Frequency adapts to external beat cues
Tempo Adaptation
ฯ(t) = ฯ_0 + k_tempo * (tempo_target - tempo_current)
Time constant adapts to target tempo
Phase Synchronization
ฯ_sync = ฯ + k_sync * (ฯ_external - ฯ)
Phase synchronizes with external rhythm
Key Properties¶
๐ Ask ChatGPT about Key Properties
-
Rhythmic Generation
Generates rhythmic movements with precise timing
-
Beat Adaptation
Adapts to external beat cues and timing
-
Tempo Control
Controls movement tempo and speed
-
Phase Synchronization
Synchronizes with external rhythms and metronomes
Implementation Approaches¶
๐ป Ask ChatGPT about Implementation
Temporal DMPs for rhythmic movement generation with beat adaptation
Complexity:
- Time: O(T ร K)
- Space: O(K)
Advantages
-
Rhythmic movement generation
-
Beat and tempo adaptation
-
Phase synchronization
-
Temporal scaling capabilities
Disadvantages
-
Requires external timing cues
-
Complex parameter tuning
-
May not handle all temporal patterns
Temporal DMPs that synchronize with external metronomes
Complexity:
- Time: O(T ร K + T ร M)
- Space: O(K + M)
Advantages
-
Metronome synchronization
-
External timing cue integration
-
Robust temporal coordination
-
Musical performance capabilities
Disadvantages
-
Requires external metronome
-
Sensitive to metronome accuracy
-
Higher computational cost
Complete Implementation
The full implementation with error handling, comprehensive testing, and additional variants is available in the source code:
-
Main implementation with rhythmic and metronome-synchronized DMPs:
src/algokit/dynamic_movement_primitives/temporal_dmps.py
-
Comprehensive test suite including temporal coordination tests:
tests/unit/dynamic_movement_primitives/test_temporal_dmps.py
Complexity Analysis¶
๐ Ask ChatGPT about Complexity
Time & Space Complexity Comparison
Approach | Time Complexity | Space Complexity | Notes |
---|---|---|---|
Rhythmic Temporal DMP | O(T ร K) | O(K) | Time complexity scales with trajectory length and basis functions |
Use Cases & Applications¶
๐ Ask ChatGPT about Applications
Application Categories
Musical Performance
-
Instrument Playing: Playing musical instruments with precise timing
-
Conducting: Conducting orchestras with precise beat patterns
-
Dancing: Dancing with precise rhythm and timing
-
Singing: Singing with precise tempo and rhythm
Rhythmic Locomotion
-
Walking: Walking with precise gait timing
-
Running: Running with precise stride timing
-
Swimming: Swimming with precise stroke timing
-
Cycling: Cycling with precise pedal timing
Synchronized Systems
-
Multi-Robot Coordination: Coordinating multiple robots with precise timing
-
Human-Robot Interaction: Interacting with humans with precise timing
-
Synchronized Manipulation: Manipulating objects with precise timing
-
Synchronized Assembly: Assembling parts with precise timing
Entertainment and Arts
-
Dance: Dancing with precise rhythm and timing
-
Theater: Performing theatrical movements with precise timing
-
Sports: Performing sports movements with precise timing
-
Gaming: Performing game movements with precise timing
Rehabilitation and Therapy
-
Physical Therapy: Performing therapeutic exercises with precise timing
-
Speech Therapy: Performing speech exercises with precise timing
-
Occupational Therapy: Performing occupational tasks with precise timing
-
Music Therapy: Performing music therapy with precise timing
Educational Value
-
Temporal Coordination: Understanding temporal coordination in robotics
-
Rhythmic Patterns: Understanding rhythmic pattern generation
-
Beat Adaptation: Understanding beat adaptation mechanisms
-
Phase Synchronization: Understanding phase synchronization techniques
References & Further Reading¶
:material-library: Core Papers
:material-library: Temporal Coordination
:material-web: Online Resources
:material-code-tags: Implementation & Practice
Interactive Learning
Try implementing the different approaches yourself! This progression will give you deep insight into the algorithm's principles and applications.
Pro Tip: Start with the simplest implementation and gradually work your way up to more complex variants.
Need More Help? Ask ChatGPT!
Navigation¶
Related Algorithms in Dynamic Movement Primitives:
-
DMPs with Obstacle Avoidance - DMPs enhanced with real-time obstacle avoidance capabilities using repulsive forces and safe navigation in cluttered environments.
-
Spatially Coupled Bimanual DMPs - DMPs for coordinated dual-arm movements with spatial coupling between arms for synchronized manipulation tasks and hand-eye coordination.
-
Constrained Dynamic Movement Primitives (CDMPs) - DMPs with safety constraints and operational requirements that ensure movements comply with safety limits and operational constraints.
-
DMPs for Human-Robot Interaction - DMPs specialized for human-robot interaction including imitation learning, collaborative tasks, and social robot behaviors.
-
Multi-task DMP Learning - DMPs that learn from multiple demonstrations across different tasks, enabling task generalization and cross-task knowledge transfer.
-
Geometry-aware Dynamic Movement Primitives - DMPs that operate with symmetric positive definite matrices to handle stiffness and damping matrices for impedance control applications.
-
Online DMP Adaptation - DMPs with real-time parameter updates, continuous learning from feedback, and adaptive behavior modification during execution.
-
DMPs for Manipulation - DMPs specialized for robotic manipulation tasks including grasping movements, assembly tasks, and tool use behaviors.
-
Basic Dynamic Movement Primitives (DMPs) - Fundamental DMP framework for learning and reproducing point-to-point and rhythmic movements with temporal and spatial scaling.
-
Probabilistic Movement Primitives (ProMPs) - Probabilistic extension of DMPs that captures movement variability and generates movement distributions from multiple demonstrations.
-
Hierarchical Dynamic Movement Primitives - DMPs organized in hierarchical structures for multi-level movement decomposition, complex behavior composition, and task hierarchy learning.
-
DMPs for Locomotion - DMPs specialized for walking pattern generation, gait adaptation, and terrain-aware movement in legged robots and humanoid systems.
-
Reinforcement Learning DMPs - DMPs enhanced with reinforcement learning for parameter optimization, reward-driven learning, and policy gradient methods for movement refinement.