T-REX: A deliberative system for AUV control