Simulation of quadrupedal locomotion using a rigid body model