A factor-graph approach to Lagrangian and Hamiltonian dynamics | IEEE Conference Publication | IEEE Xplore