Optimal Control on Lie Groups: Theory and Applications