Integration of Riemannian Motion Policy with Whole-Body Control for Collision-Free Legged Locomotion