The design of dynamical observers for hybrid systems: Theory and application to an automotive control problem