Added validation function for com and joint trajectories