# Forward dynamics

Forward dynamics (FD) refers to the computation of motions from forces. Given the configuration \(\bfq\), generalized velocity \(\qd\), joint torques \(\bftau\) and contact forces \(\bff\) acting on our robot, forward dynamics computes the joint accelerations \(\qdd\) such that the constrained equations of motion are satisfied:

Mathematically, we can write forward dynamics as a function \(\mathrm{FD}\) such that:

Note that this function implicitly depends on our robot model. Different robots
will have *e.g.* different inertias, thus different inertia matrices
\(\bfM(\bfq)\), thus different \(\mathrm{FD}\) functions in a given
configuration \(\bfq\).

## Algorithms

There are two common ways to compute forward dynamics. The first one relies on the articulated body algorithm:

The second one relies on the composite rigid body algorithm:

where \(\bftau_0 = \mathrm{RNEA}(\bfq, \qd, \bfzero, \bff^\mathit{ext})\) is computed using the recursive Newton-Euler algorithm and \(\bfM = \mathrm{CRBA}(\bfq)\) relies on the composite rigid body algorithm.

### Articulated body algorithm

The articulated body algorithm (ABA) computes the *unconstrained* forward dynamics:

Its output \(\qdd\) satisfies the equation of motion \(\bfM(\bfq) \qdd + \ldots = \ldots + \bfJ^\top \bff\), but it doesn't take into account the contact constraint \(\bfJ(\bfq) \qdd + \qd^\top \bfH(\bfq) \qd = \boldsymbol{0}\).

... this article is a stub, ping me if I don't come back to it ;) ...

### Composite rigid body algorithm

The composite rigid body algorithm (CRBA) computes the joint inertia matrix \(\bfM(\bfq)\) from the joint configuration \(\bfq\).

... this article is a stub, ping me if I don't come back to it ;) ...

## To go further

Both ABA and CRBA are described in Featherstone's Rigid body dynamics algorithms, a seminal book that has been implemented in rigid body dynamics libraries, such as Pinocchio or RBDL, as well as dynamic simulators, such as Bullet or Dart. ABA is the main algorithm in both Bullet and Dart.