A local observer for linearly observable nonlinear mechanical systems subject to impacts