$ show RussTedrake/underactuated
The repository is the companion software for the MIT course 'Underactuated Robotics' (6.832/6.821) by Russ Tedrake. It provides a Python package (`underactuated`) that integrates with the Drake robotics simulation library to implement algorithms for walking, running, swimming, flying, and manipulation. The repository includes the full HTML textbook, Jupyter notebooks with examples and autograded exercises, robot models (URDF/SDF), and utilities for simulation, visualization, and grading. The codebase is primarily an educational software library, but it also serves as a research resource with advanced topics like sum-of-squares optimization, trajectory optimization, and reinforcement learning. It is heavily tied to Drake and uses its `LeafSystem`, `MultibodyPlant`, `MeshcatVisualizer`, and `MathematicalProgram` APIs extensively. The architecture is modular: the `underactuated` package provides reusable components (meshcat utilities, plotting helpers, scenario generators, a grader for exercises) that are used across notebooks. The notebooks themselves are the primary user interface, demonstrating concepts with interactive simulations. The repository is actively maintained, with recent commits and a CI pipeline. It has a large number of stars (1030) and forks (254), indicating a strong community. However, it has some technical debt: deprecated functions, TODO comments, and a tight coupling to specific Drake versions.
The LLM identified 4 files worth highlighting for reuse:
Provides a set of utilities for interactive visualization with Drake's Meshcat, including `StartMeshcat` for initializing a Meshcat server, `DisplayMeshcat` for displaying the visualizer in notebooks, `MeshcatSliders` for adding interactive sliders to control simulation parameters, `WsgButton` and `StopButton` for adding buttons, `AddMeshcatTriad` for adding coordinate axes, and `plot_mathematical_program` for visualizing optimization problems. This module encapsulates common patterns for setting up Meshcat visualizers and is reusable in any Drake-based project requiring interactive 3D visualization.
Provides custom PyPlot visualizer subclasses that extend Drake's visualization capabilities: `AdvanceToAndVisualize` for stepping through simulation time with visualization, `AnimatePositionTrajectory` for creating animations of position trajectories, and `HistogramVisualizer` for visualizing distributions. These are self-contained components that can be extracted and used in other Drake projects for 2D plotting and animation.
Implements a `Grader` class for autograding Jupyter notebook exercises. It provides methods to grade student outputs against expected results and generate results in a format compatible with Gradescope. This is a self-contained pattern that can be extracted and used in any educational context requiring automated assessment of notebook-based assignments.
Implements `UavEnvironment`, a class for generating 3D grid worlds with buildings, walls, doors, trees, and other obstacles for UAV motion planning. It uses Drake's GraphOfConvexSets for planning collision-free paths. The environment generation is parameterized and randomized, making it reusable for different UAV planning scenarios. It demonstrates non-obvious skill in combining procedural generation with convex optimization.