Basic DMPs
Basic Dynamic Movement Primitives (DMPs)
Fundamental DMP framework for learning and reproducing point-to-point and rhythmic movements with temporal and spatial scaling.
Family: Dynamic Movement Primitives Status: ๐ Planned
Need Help Understanding This Algorithm?
๐ค Ask ChatGPT about Basic Dynamic Movement Primitives (DMPs)
Overview
Basic Dynamic Movement Primitives (DMPs) are a fundamental framework for learning and reproducing complex movements in robotics. DMPs provide a way to encode movements as dynamical systems that can be learned from demonstrations and then generalized to new situations through temporal and spatial scaling.
The core idea of DMPs is to decompose complex movements into a set of simple dynamical systems that can be combined to create sophisticated behaviors. Each DMP consists of a canonical system that provides temporal structure and a transformation system that generates the actual movement trajectory.
DMPs are particularly powerful because they can handle both discrete (point-to-point) and rhythmic (periodic) movements, making them suitable for a wide range of robotic applications from manipulation to locomotion.
Mathematical Formulation¶
๐งฎ Ask ChatGPT about Mathematical Formulation
Problem Definition
Given:
- Demonstrated trajectory: y_demo(t) โ โ^d
- Desired start position: y_0 โ โ^d
- Desired goal position: g โ โ^d
- Temporal scaling: ฯ > 0
- Spatial scaling: s โ โ^d
Learn a dynamical system that reproduces the movement:
For discrete DMPs: ฯแบ = ฮฑ_y(ฮฒ_y(g - y) - แบ) + f(x) ฯแบ = -ฮฑ_x x
For rhythmic DMPs: ฯแบ = ฮฑ_y(ฮฒ_y(g - y) - แบ) + f(ฯ) ฯฯฬ = 1
Where f(x) or f(ฯ) is the forcing function learned from demonstrations.
Key Properties
Temporal Scaling
ฯแบ = ฮฑ_y(ฮฒ_y(g - y) - แบ) + f(x)
Allows movement speed adjustment through ฯ parameter
Spatial Scaling
s = (g_new - y_0_new) / (g_demo - y_0_demo)
Enables movement amplitude scaling to new start/goal positions
Stability
แบ โ 0, y โ g as t โ โ
Guaranteed convergence to goal position
Key Properties¶
๐ Ask ChatGPT about Key Properties
-
Movement Learning
Learns complex movements from demonstrations
-
Temporal Scaling
Can adjust movement speed while preserving shape
-
Spatial Scaling
Can adapt movements to new start/goal positions
-
Stability
Guaranteed convergence to goal position
Implementation Approaches¶
๐ป Ask ChatGPT about Implementation
Point-to-point movements with temporal and spatial scaling
Complexity:
- Time: O(T ร N_basis)
- Space: O(N_basis ร d)
Advantages
-
Simple and intuitive framework
-
Guaranteed stability and convergence
-
Temporal and spatial scaling capabilities
-
Smooth trajectory generation
Disadvantages
-
Limited to single demonstrations
-
No obstacle avoidance
-
Fixed basis function placement
Periodic movements with phase-based canonical system
Complexity:
- Time: O(T ร N_basis)
- Space: O(N_basis ร d)
Advantages
-
Handles periodic movements naturally
-
Phase-based canonical system
-
Can generate multiple periods
-
Smooth periodic trajectories
Disadvantages
-
Limited to periodic movements
-
No temporal scaling of period
-
Fixed basis function placement
DMPs for high-dimensional spaces like joint or Cartesian coordinates
Complexity:
- Time: O(T ร N_basis ร d)
- Space: O(N_basis ร d)
Advantages
-
Handles high-dimensional spaces
-
Dimension-specific scaling
-
Independent learning per dimension
-
Suitable for joint and Cartesian spaces
Disadvantages
-
No cross-dimensional coupling
-
Computational cost scales with dimensions
-
May not capture coordinated movements
Complete Implementation
The full implementation with error handling, comprehensive testing, and additional variants is available in the source code:
-
Main implementation with discrete, rhythmic, and multi-dimensional DMPs:
src/algokit/dynamic_movement_primitives/basic_dmps.py
-
Comprehensive test suite including learning and generation tests:
tests/unit/dynamic_movement_primitives/test_basic_dmps.py
Complexity Analysis¶
๐ Ask ChatGPT about Complexity
Time & Space Complexity Comparison
Approach | Time Complexity | Space Complexity | Notes |
---|---|---|---|
Discrete DMP Learning | O(T ร N_basis ร d) | O(N_basis ร d) | Time complexity for learning scales with trajectory length, basis functions, and dimensions |
Use Cases & Applications¶
๐ Ask ChatGPT about Applications
Application Categories
Robotic Manipulation
-
Pick and Place: Learning manipulation trajectories
-
Assembly Tasks: Learning complex assembly movements
-
Tool Use: Learning to use tools with proper trajectories
-
Grasping: Learning grasping movements with approach trajectories
Humanoid Robotics
-
Walking: Learning walking patterns and gaits
-
Reaching: Learning arm reaching movements
-
Balancing: Learning balance recovery movements
-
Gesture: Learning human-like gestures and expressions
Industrial Robotics
-
Welding: Learning welding trajectories
-
Painting: Learning painting patterns
-
Packaging: Learning packaging movements
-
Quality Control: Learning inspection movements
Service Robotics
-
Cleaning: Learning cleaning patterns
-
Cooking: Learning cooking movements
-
Caregiving: Learning assistive movements
-
Entertainment: Learning dance and performance movements
Research Applications
-
Movement Analysis: Studying human movement patterns
-
Rehabilitation: Learning therapeutic movements
-
Sports: Learning athletic movements
-
Art: Learning artistic and creative movements
Educational Value
-
Dynamical Systems: Understanding how movements can be encoded as dynamical systems
-
Function Approximation: Learning to approximate complex functions with basis functions
-
Temporal Scaling: Understanding how to scale movements in time
-
Spatial Scaling: Understanding how to adapt movements to new spatial contexts
References & Further Reading¶
:material-library: Core Papers
:material-library: DMP Extensions
: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.
-
Temporal Dynamic Movement Primitives - DMPs that generate time-based movements with rhythmic pattern learning, beat and tempo adaptation for temporal movement generation.
-
DMPs for Manipulation - DMPs specialized for robotic manipulation tasks including grasping movements, assembly tasks, and tool use behaviors.
-
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.