functin to check pose error