Differentiable and bilevel optimization for control in robotics