// the find
ethz-adrl/towr
A light-weight, Eigen-based C++ library for trajectory optimization for legged robots.
towr is a C++ library for trajectory optimization of legged robots — think quadrupeds and bipeds planning whole-body motions over terrain. It uses direct collocation via Hermite splines and delegates solver heavy-lifting to Ipopt or Snopt through the ifopt interface. It's for robotics researchers who want a working NLP formulation they can extend, not a plug-and-play solution for production robots.
The phase-based end-effector parameterization is the core insight: by encoding contact schedules as spline phase durations rather than per-timestep binary variables, the NLP stays tractable enough to solve in under 100ms — that's the result from the RA-L paper, and it's genuinely fast for this problem class. The separation between the core library (pure CMake, no ROS dependency) and the towr_ros visualization wrapper is clean; you can use it without touching ROS. At ~6k lines it's small enough to actually read and understand the full formulation, which matters when you inevitably need to add a constraint. The ifopt layer means swapping Ipopt for Snopt is a one-line change if you have a Snopt license.
Last commit was April 2023 and the ROS CI badge targets ROS Kinetic/Melodic — this is essentially unmaintained and the ecosystem has moved to ROS 2. The Single-Rigid-Body Dynamics model is baked into the NLP formulation; it's a reasonable simplification but it means the library has a hard ceiling on accuracy for highly dynamic motions where limb inertia matters. Terrain is modeled as an analytic height map function — there's no support for point cloud or mesh terrain out of the box, so real-world deployment requires writing your own height map wrapper. The test coverage is two unit tests on dynamic constraints and a hopper example; there's nothing testing the full NLP pipeline, so extension work has minimal safety net.