Nonlinear observers for robots with rigid and elastic joints