[ros] pose: check key in dict instead of try..catch

check if key in dict instead of try catch for data as well...
Also changed ```if not 'valid' in``` to ```if 'valid' not in``` as it is more readable and more common.