Geometry, Optimization and Control in Robot Coordination