We use a tree-based structure to represent mechanical systems comprising interconnected rigid bodies. Using this representation, we derive a simple algorithm to numerically calculate forward kinematic maps, body velocities, and their derivatives. The algorithm is computationally efficient and scales to large systems very well by using recursion to take advantage of the tree structure. Moreover, this method is less prone to modeling errors because each element of the graph is simple.The tree representation provides a natural framework to simulate mechanical dynamics with numeric computations rather than large symbolically-derived equations. In particular, the representation allows one to simulate systems in generalized coordinates using Lagrangian dynamics without symbolically finding the equations of motion. This method also applies to the relatively new variational integrators which numerically integrate dynamics in a way that preserve momentum and other symmetries. We show how to implement both integration schemes for an arbitrary system of interconnected rigid bodies in a computationally efficient way while avoiding symbolic equations of motion. We end with an example simulating a marionette; a mechanically complex, high degree-of-freedom system.
I. INTRODUCTIONEuler-Lagrange simulations are often preferred for robotics and controls applications because they work directly in the generalized coordinates used to analyze the system and specify desired trajectories. Moreover, they provide a certain level of automation to derive correct equations of motion. For complex mechanical systems, however, the necessary symbolic equations become unwieldy and the resulting simulations are typically slow.The popular alternative to Euler-Lagrange simulation is the Newton-Euler force balance approach. Newton-Euler simulations have a larger configuration space than EulerLagrange simulations (typically (R 3 × SO(3)) n vs. generalized coordinates) and hide the mechanical structure in the constraint definitions. However, there are extremely fast and efficient implementations [1] [13]. Much of the performance comes from working with simple, general equations that can be efficiently implemented and evaluated rather than deriving large symbolic equations of motion. These smaller equations can be efficiently implemented and optimized by compilers.Euler-Lagrange simulations [2] [9], on the other hand, typically rely on symbolic equations of motions that are numerically integrated. Our approach avoids such symbolic