Safety-critical Motion Planning for Collaborative Legged Loco-Manipulation over Discrete Terrain