Quadrupedal robots’ gaits identification via contact forces optimization