Only run inverse dynamics when needed.