On the modeling of robots in contact with a dynamic environment