Compliance control for an anthropomorphic robot with elastic joints: Theory and experiments